pidgin/plugins/disco/xmppdiscoservice.c

Sun, 03 Nov 2024 00:05:44 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sun, 03 Nov 2024 00:05:44 -0500
changeset 43045
308e8d0ce68c
parent 42767
8cf1d11b59c1
child 43072
a59a119b74f5
permissions
-rw-r--r--

remove purple3-url-handler.desktop.in.in

The application that did the launching was removed long ago. Also this should
be implemented by the user interfaces and they might provide separate files to
groups schemas as well.

Testing Done:
Called in the turtles.

Reviewed at https://reviews.imfreedom.org/r/3640/

42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
1 /*
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
2 * Purple - XMPP Service Disco Browser
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
4 *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
5 * Pidgin is the legal property of its developers, whose names are too numerous
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
7 * source distribution.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
8 *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
12 * (at your option) any later version.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
13 *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
17 * GNU General Public License for more details.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
18 *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
21 */
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
22
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
23 #include <glib/gi18n-lib.h>
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
24
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
25 #include "xmppdiscoservice.h"
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
26 #include "xmppdiscoenums.h"
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
27
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
28 struct _XmppDiscoService {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
29 GObject parent;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
30
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
31 PidginDiscoList *list;
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
32 GListStore *children;
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
33 char *name;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
34 char *description;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
35
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
36 char *gateway_type;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
37 XmppDiscoServiceType type;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
38 XmppDiscoServiceFlags flags;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
39
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
40 char *jid;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
41 char *node;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
42 gboolean expanded;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
43 };
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
44
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
45 enum {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
46 PROP_0,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
47 PROP_LIST,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
48 PROP_NAME,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
49 PROP_DESCRIPTION,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
50 PROP_SERVICE_TYPE,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
51 PROP_GATEWAY_TYPE,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
52 PROP_FLAGS,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
53 PROP_JID,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
54 PROP_NODE,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
55 PROP_EXPANDED,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
56 PROP_ICON_NAME,
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
57 PROP_CHILD_MODEL,
42584
687260353985 Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42573
diff changeset
58 N_PROPERTIES,
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
59 };
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
60
42584
687260353985 Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42573
diff changeset
61 static GParamSpec *properties[N_PROPERTIES] = {NULL, };
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
62
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
63 /******************************************************************************
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
64 * Helpers
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
65 *****************************************************************************/
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
66 static void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
67 xmpp_disco_service_set_list(XmppDiscoService *service, PidginDiscoList *list) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
68 service->list = list;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
69
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
70 g_object_notify_by_pspec(G_OBJECT(service), properties[PROP_LIST]);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
71 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
72
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
73 static void
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
74 xmpp_disco_service_refresh_child_model(GObject *obj,
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
75 G_GNUC_UNUSED GParamSpec *pspec,
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
76 G_GNUC_UNUSED gpointer data)
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
77 {
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
78 XmppDiscoService *service = XMPP_DISCO_SERVICE(obj);
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
79 gboolean changed = FALSE;
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
80
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
81 if((service->flags & XMPP_DISCO_BROWSE) != 0) {
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
82 if(service->children == NULL) {
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
83 service->children = g_list_store_new(XMPP_DISCO_TYPE_SERVICE);
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
84 changed = TRUE;
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
85 }
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
86 } else {
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
87 changed = service->children != NULL;
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
88 g_clear_object(&service->children);
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
89 }
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
90
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
91 if(changed) {
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
92 g_object_notify_by_pspec(G_OBJECT(service), properties[PROP_CHILD_MODEL]);
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
93 }
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
94 }
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
95
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
96 /******************************************************************************
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
97 * GObject implementation
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
98 *****************************************************************************/
42573
9dc369a7d7da Make sure all of the final types in pidgin plugins are defined as such
Gary Kramlich <grim@reaperworld.com>
parents: 42090
diff changeset
99 G_DEFINE_DYNAMIC_TYPE_EXTENDED(XmppDiscoService, xmpp_disco_service,
9dc369a7d7da Make sure all of the final types in pidgin plugins are defined as such
Gary Kramlich <grim@reaperworld.com>
parents: 42090
diff changeset
100 G_TYPE_OBJECT, G_TYPE_FLAG_FINAL, {})
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
101
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
102 static void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
103 xmpp_disco_service_get_property(GObject *object, guint prop_id, GValue *value,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
104 GParamSpec *pspec)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
105 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
106 XmppDiscoService *service = XMPP_DISCO_SERVICE(object);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
107
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
108 switch(prop_id) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
109 case PROP_LIST:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
110 g_value_set_pointer(value, xmpp_disco_service_get_list(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
111 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
112 case PROP_NAME:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
113 g_value_set_string(value, xmpp_disco_service_get_name(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
114 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
115 case PROP_DESCRIPTION:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
116 g_value_set_string(value,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
117 xmpp_disco_service_get_description(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
118 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
119 case PROP_SERVICE_TYPE:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
120 g_value_set_enum(value,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
121 xmpp_disco_service_get_service_type(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
122 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
123 case PROP_GATEWAY_TYPE:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
124 g_value_set_string(value,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
125 xmpp_disco_service_get_gateway_type(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
126 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
127 case PROP_FLAGS:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
128 g_value_set_flags(value, xmpp_disco_service_get_flags(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
129 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
130 case PROP_JID:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
131 g_value_set_string(value, xmpp_disco_service_get_jid(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
132 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
133 case PROP_NODE:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
134 g_value_set_string(value, xmpp_disco_service_get_node(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
135 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
136 case PROP_EXPANDED:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
137 g_value_set_boolean(value,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
138 xmpp_disco_service_get_expanded(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
139 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
140 case PROP_ICON_NAME:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
141 g_value_take_string(value,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
142 xmpp_disco_service_get_icon_name(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
143 break;
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
144 case PROP_CHILD_MODEL:
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
145 g_value_set_object(value,
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
146 xmpp_disco_service_get_child_model(service));
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
147 break;
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
148 default:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
149 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
150 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
151 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
152 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
153
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
154 static void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
155 xmpp_disco_service_set_property(GObject *object, guint prop_id,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
156 const GValue *value, GParamSpec *pspec)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
157 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
158 XmppDiscoService *service = XMPP_DISCO_SERVICE(object);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
159
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
160 switch(prop_id) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
161 case PROP_LIST:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
162 xmpp_disco_service_set_list(service, g_value_get_pointer(value));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
163 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
164 case PROP_NAME:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
165 xmpp_disco_service_set_name(service, g_value_get_string(value));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
166 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
167 case PROP_DESCRIPTION:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
168 xmpp_disco_service_set_description(service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
169 g_value_get_string(value));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
170 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
171 case PROP_SERVICE_TYPE:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
172 xmpp_disco_service_set_service_type(service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
173 g_value_get_enum(value));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
174 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
175 case PROP_GATEWAY_TYPE:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
176 xmpp_disco_service_set_gateway_type(service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
177 g_value_get_string(value));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
178 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
179 case PROP_FLAGS:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
180 xmpp_disco_service_set_flags(service, g_value_get_flags(value));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
181 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
182 case PROP_JID:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
183 xmpp_disco_service_set_jid(service, g_value_get_string(value));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
184 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
185 case PROP_NODE:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
186 xmpp_disco_service_set_node(service, g_value_get_string(value));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
187 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
188 case PROP_EXPANDED:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
189 xmpp_disco_service_set_expanded(service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
190 g_value_get_boolean(value));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
191 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
192 default:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
193 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
194 break;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
195 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
196 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
197
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
198 static void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
199 xmpp_disco_service_finalize(GObject *obj) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
200 XmppDiscoService *service = XMPP_DISCO_SERVICE(obj);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
201
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
202 g_clear_pointer(&service->name, g_free);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
203 g_clear_pointer(&service->description, g_free);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
204 g_clear_pointer(&service->gateway_type, g_free);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
205 g_clear_pointer(&service->jid, g_free);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
206 g_clear_pointer(&service->node, g_free);
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
207 g_clear_object(&service->children);
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
208
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
209 G_OBJECT_CLASS(xmpp_disco_service_parent_class)->finalize(obj);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
210 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
211
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
212 static void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
213 xmpp_disco_service_class_init(XmppDiscoServiceClass *klass)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
214 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
215 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
216
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
217 /* Properties */
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
218 obj_class->get_property = xmpp_disco_service_get_property;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
219 obj_class->set_property = xmpp_disco_service_set_property;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
220 obj_class->finalize = xmpp_disco_service_finalize;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
221
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
222 properties[PROP_LIST] = g_param_spec_pointer(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
223 "list", "list", "The list displaying this service.",
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
224 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
225
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
226 properties[PROP_NAME] = g_param_spec_string(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
227 "name", "name", "The name of this service.",
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
228 NULL,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
229 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
230
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
231 properties[PROP_DESCRIPTION] = g_param_spec_string(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
232 "description", "description", "The description of this service.",
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
233 NULL,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
234 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
235
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
236 properties[PROP_SERVICE_TYPE] = g_param_spec_enum(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
237 "service-type", "service-type", "The service type of this service.",
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
238 XMPP_DISCO_TYPE_SERVICE_TYPE, XMPP_DISCO_SERVICE_TYPE_UNSET,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
239 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
240
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
241 properties[PROP_GATEWAY_TYPE] = g_param_spec_string(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
242 "gateway-type", "gateway-type", "The gateway type of this service.",
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
243 NULL,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
244 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
245
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
246 properties[PROP_FLAGS] = g_param_spec_flags(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
247 "flags", "flags", "The flags of this service.",
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
248 XMPP_DISCO_TYPE_SERVICE_FLAGS, XMPP_DISCO_NONE,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
249 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
250
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
251 properties[PROP_JID] = g_param_spec_string(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
252 "jid", "jid", "The jid of this service.",
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
253 NULL,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
254 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
255
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
256 properties[PROP_NODE] = g_param_spec_string(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
257 "node", "node", "The node of this service.",
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
258 NULL,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
259 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
260
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
261 properties[PROP_EXPANDED] = g_param_spec_boolean(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
262 "expanded", "expanded", "Whether this service expanded.",
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
263 FALSE,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
264 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
265
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
266 properties[PROP_ICON_NAME] = g_param_spec_string(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
267 "icon-name", "icon-name", "The icon name of this service.",
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
268 NULL,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
269 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
270
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
271 properties[PROP_CHILD_MODEL] = g_param_spec_object(
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
272 "child-model", "child-model",
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
273 "The model containing children of this service.",
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
274 G_TYPE_LIST_MODEL,
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
275 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
276
42584
687260353985 Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42573
diff changeset
277 g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
278 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
279
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
280 static void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
281 xmpp_disco_service_class_finalize(G_GNUC_UNUSED XmppDiscoServiceClass *klass) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
282 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
283
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
284 static void
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
285 xmpp_disco_service_init(XmppDiscoService *service) {
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
286 g_signal_connect(service, "notify::flags",
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
287 G_CALLBACK(xmpp_disco_service_refresh_child_model), NULL);
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
288 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
289
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
290 /******************************************************************************
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
291 * Public API
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
292 *****************************************************************************/
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
293
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
294 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
295 xmpp_disco_service_register(PurplePlugin *plugin) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
296 xmpp_disco_service_register_type(G_TYPE_MODULE(plugin));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
297 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
298
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
299 XmppDiscoService *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
300 xmpp_disco_service_new(PidginDiscoList *list) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
301 return g_object_new(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
302 XMPP_DISCO_TYPE_SERVICE,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
303 "list", list,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
304 NULL);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
305 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
306
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
307 PidginDiscoList *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
308 xmpp_disco_service_get_list(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
309 g_return_val_if_fail(XMPP_DISCO_IS_SERVICE(service), NULL);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
310
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
311 return service->list;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
312 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
313
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
314 const char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
315 xmpp_disco_service_get_name(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
316 g_return_val_if_fail(XMPP_DISCO_IS_SERVICE(service), NULL);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
317
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
318 return service->name;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
319 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
320
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
321 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
322 xmpp_disco_service_set_name(XmppDiscoService *service, const char *name) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
323 g_return_if_fail(XMPP_DISCO_IS_SERVICE(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
324
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
325 if(g_set_str(&service->name, name)) {
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
326 g_object_notify_by_pspec(G_OBJECT(service), properties[PROP_NAME]);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
327 }
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
328 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
329
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
330 const char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
331 xmpp_disco_service_get_description(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
332 g_return_val_if_fail(XMPP_DISCO_IS_SERVICE(service), NULL);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
333
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
334 return service->description;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
335 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
336
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
337 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
338 xmpp_disco_service_set_description(XmppDiscoService *service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
339 const char *description)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
340 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
341 g_return_if_fail(XMPP_DISCO_IS_SERVICE(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
342
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
343 if(g_set_str(&service->description, description)) {
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
344 g_object_notify_by_pspec(G_OBJECT(service),
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
345 properties[PROP_DESCRIPTION]);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
346 }
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
347 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
348
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
349 XmppDiscoServiceType
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
350 xmpp_disco_service_get_service_type(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
351 g_return_val_if_fail(XMPP_DISCO_IS_SERVICE(service),
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
352 XMPP_DISCO_SERVICE_TYPE_UNSET);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
353
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
354 return service->type;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
355 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
356
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
357 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
358 xmpp_disco_service_set_service_type(XmppDiscoService *service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
359 XmppDiscoServiceType type)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
360 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
361 GObject *obj = NULL;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
362 g_return_if_fail(XMPP_DISCO_IS_SERVICE(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
363
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
364 service->type = type;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
365
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
366 obj = G_OBJECT(service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
367 g_object_freeze_notify(obj);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
368 g_object_notify_by_pspec(obj, properties[PROP_SERVICE_TYPE]);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
369 g_object_notify_by_pspec(obj, properties[PROP_ICON_NAME]);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
370 g_object_thaw_notify(obj);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
371 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
372
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
373 const char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
374 xmpp_disco_service_get_gateway_type(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
375 g_return_val_if_fail(XMPP_DISCO_IS_SERVICE(service), NULL);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
376
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
377 return service->gateway_type;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
378 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
379
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
380 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
381 xmpp_disco_service_set_gateway_type(XmppDiscoService *service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
382 const char *gateway_type)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
383 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
384 g_return_if_fail(XMPP_DISCO_IS_SERVICE(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
385
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
386 if(g_set_str(&service->gateway_type, gateway_type)) {
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
387 GObject *obj = G_OBJECT(service);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
388 g_object_freeze_notify(obj);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
389 g_object_notify_by_pspec(obj, properties[PROP_GATEWAY_TYPE]);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
390 g_object_notify_by_pspec(obj, properties[PROP_ICON_NAME]);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
391 g_object_thaw_notify(obj);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
392 }
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
393 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
394
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
395 XmppDiscoServiceFlags
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
396 xmpp_disco_service_get_flags(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
397 g_return_val_if_fail(XMPP_DISCO_IS_SERVICE(service), XMPP_DISCO_NONE);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
398
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
399 return service->flags;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
400 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
401
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
402 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
403 xmpp_disco_service_set_flags(XmppDiscoService *service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
404 XmppDiscoServiceFlags flags)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
405 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
406 g_return_if_fail(XMPP_DISCO_IS_SERVICE(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
407
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
408 service->flags = flags;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
409
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
410 g_object_notify_by_pspec(G_OBJECT(service), properties[PROP_FLAGS]);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
411 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
412
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
413 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
414 xmpp_disco_service_add_flags(XmppDiscoService *service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
415 XmppDiscoServiceFlags flags)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
416 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
417 g_return_if_fail(XMPP_DISCO_IS_SERVICE(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
418
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
419 service->flags |= flags;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
420
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
421 g_object_notify_by_pspec(G_OBJECT(service), properties[PROP_FLAGS]);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
422 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
423
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
424 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
425 xmpp_disco_service_remove_flags(XmppDiscoService *service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
426 XmppDiscoServiceFlags flags)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
427 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
428 g_return_if_fail(XMPP_DISCO_IS_SERVICE(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
429
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
430 service->flags &= ~flags;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
431
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
432 g_object_notify_by_pspec(G_OBJECT(service), properties[PROP_FLAGS]);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
433 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
434
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
435 const char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
436 xmpp_disco_service_get_jid(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
437 g_return_val_if_fail(XMPP_DISCO_IS_SERVICE(service), NULL);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
438
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
439 return service->jid;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
440 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
441
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
442 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
443 xmpp_disco_service_set_jid(XmppDiscoService *service, const char *jid) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
444 g_return_if_fail(XMPP_DISCO_IS_SERVICE(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
445
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
446 if(g_set_str(&service->jid, jid)) {
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
447 g_object_notify_by_pspec(G_OBJECT(service), properties[PROP_JID]);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
448 }
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
449 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
450
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
451 const char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
452 xmpp_disco_service_get_node(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
453 g_return_val_if_fail(XMPP_DISCO_IS_SERVICE(service), NULL);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
454
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
455 return service->node;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
456 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
457
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
458 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
459 xmpp_disco_service_set_node(XmppDiscoService *service, const char *node) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
460 g_return_if_fail(XMPP_DISCO_IS_SERVICE(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
461
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
462 if(g_set_str(&service->node, node)) {
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
463 g_object_notify_by_pspec(G_OBJECT(service), properties[PROP_NODE]);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
464 }
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
465 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
466
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
467 gboolean
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
468 xmpp_disco_service_get_expanded(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
469 g_return_val_if_fail(XMPP_DISCO_IS_SERVICE(service), FALSE);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
470
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
471 return service->expanded;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
472 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
473
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
474 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
475 xmpp_disco_service_set_expanded(XmppDiscoService *service, gboolean expanded) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
476 g_return_if_fail(XMPP_DISCO_IS_SERVICE(service));
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
477
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
478 service->expanded = expanded;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
479
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
480 g_object_notify_by_pspec(G_OBJECT(service), properties[PROP_EXPANDED]);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
481 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
482
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
483 char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
484 xmpp_disco_service_get_icon_name(XmppDiscoService *service)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
485 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
486 char *icon_name = NULL;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
487
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
488 g_return_val_if_fail(XMPP_DISCO_IS_SERVICE(service), NULL);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
489
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
490 if(service->type == XMPP_DISCO_SERVICE_TYPE_GATEWAY && service->gateway_type != NULL) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
491 icon_name = g_strconcat("im-", service->gateway_type, NULL);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
492 #if 0
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
493 } else if(service->type == XMPP_DISCO_SERVICE_TYPE_USER) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
494 icon_name = g_strdup("person");
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
495 #endif
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
496 } else if(service->type == XMPP_DISCO_SERVICE_TYPE_CHAT) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
497 icon_name = g_strdup("chat");
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
498 }
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
499
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
500 return icon_name;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
501 }
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
502
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
503 GListModel *
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
504 xmpp_disco_service_get_child_model(XmppDiscoService *service) {
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
505 g_return_val_if_fail(XMPP_DISCO_IS_SERVICE(service), NULL);
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
506
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
507 return G_LIST_MODEL(service->children);
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
508 }
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
509
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
510 void
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
511 xmpp_disco_service_add_child(XmppDiscoService *service,
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
512 XmppDiscoService *child)
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
513 {
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
514 g_return_if_fail(XMPP_DISCO_IS_SERVICE(service));
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
515 g_return_if_fail(XMPP_DISCO_IS_SERVICE(child));
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
516 g_return_if_fail((service->flags & XMPP_DISCO_BROWSE) != 0);
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
517
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
518 g_list_store_append(service->children, child);
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
519 }

mercurial