pidgin/plugins/disco/xmppdiscoservice.c

Mon, 30 Jun 2025 23:04:59 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 30 Jun 2025 23:04:59 -0500
changeset 43273
b2e7a32950ae
parent 43072
a59a119b74f5
child 43286
1861a365a664
permissions
-rw-r--r--

Update metainfo.xml for the release

And prepare for the next release right away.

Testing Done:
Ran `meson dist`

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

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(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
223 "list", NULL, NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
224 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
42037
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(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
227 "name", NULL, NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
228 NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
229 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
42037
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(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
232 "description", NULL, NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
233 NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
234 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
42037
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(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
237 "service-type", NULL, NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
238 XMPP_DISCO_TYPE_SERVICE_TYPE, XMPP_DISCO_SERVICE_TYPE_UNSET,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
239 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
42037
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(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
242 "gateway-type", NULL, NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
243 NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
244 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
42037
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(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
247 "flags", NULL, NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
248 XMPP_DISCO_TYPE_SERVICE_FLAGS, XMPP_DISCO_NONE,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
249 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
42037
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(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
252 "jid", NULL, NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
253 NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
254 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
42037
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(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
257 "node", NULL, NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
258 NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
259 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
42037
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(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
262 "expanded", NULL, NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
263 FALSE,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
264 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
42037
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(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
267 "icon-name", NULL, NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
268 NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
269 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
42037
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(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
272 "child-model", NULL, NULL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
273 G_TYPE_LIST_MODEL,
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42767
diff changeset
274 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
275
42584
687260353985 Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42573
diff changeset
276 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
277 }
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 static void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
280 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
281 }
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 static void
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
284 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
285 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
286 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
287 }
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 * Public API
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
291 *****************************************************************************/
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 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
294 xmpp_disco_service_register(PurplePlugin *plugin) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
295 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
296 }
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 XmppDiscoService *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
299 xmpp_disco_service_new(PidginDiscoList *list) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
300 return g_object_new(
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
301 XMPP_DISCO_TYPE_SERVICE,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
302 "list", list,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
303 NULL);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
304 }
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 PidginDiscoList *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
307 xmpp_disco_service_get_list(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
308 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
309
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
310 return service->list;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
311 }
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 const char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
314 xmpp_disco_service_get_name(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
315 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
316
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
317 return service->name;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
318 }
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 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
321 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
322 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
323
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
324 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
325 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
326 }
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
327 }
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 const char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
330 xmpp_disco_service_get_description(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
331 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
332
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
333 return service->description;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
334 }
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 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
337 xmpp_disco_service_set_description(XmppDiscoService *service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
338 const char *description)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
339 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
340 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
341
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
342 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
343 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
344 properties[PROP_DESCRIPTION]);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
345 }
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
346 }
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 XmppDiscoServiceType
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
349 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
350 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
351 XMPP_DISCO_SERVICE_TYPE_UNSET);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
352
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
353 return service->type;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
354 }
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 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
357 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
358 XmppDiscoServiceType type)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
359 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
360 GObject *obj = NULL;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
361 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
362
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
363 service->type = type;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
364
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
365 obj = G_OBJECT(service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
366 g_object_freeze_notify(obj);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
367 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
368 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
369 g_object_thaw_notify(obj);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
370 }
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 const char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
373 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
374 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
375
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
376 return service->gateway_type;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
377 }
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 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
380 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
381 const char *gateway_type)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
382 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
383 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
384
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
385 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
386 GObject *obj = G_OBJECT(service);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
387 g_object_freeze_notify(obj);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
388 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
389 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
390 g_object_thaw_notify(obj);
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
391 }
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
392 }
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 XmppDiscoServiceFlags
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
395 xmpp_disco_service_get_flags(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
396 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
397
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
398 return service->flags;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
399 }
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 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
402 xmpp_disco_service_set_flags(XmppDiscoService *service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
403 XmppDiscoServiceFlags flags)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
404 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
405 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
406
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
407 service->flags = flags;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
408
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
409 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
410 }
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 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
413 xmpp_disco_service_add_flags(XmppDiscoService *service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
414 XmppDiscoServiceFlags flags)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
415 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
416 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
417
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
418 service->flags |= flags;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
419
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
420 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
421 }
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 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
424 xmpp_disco_service_remove_flags(XmppDiscoService *service,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
425 XmppDiscoServiceFlags flags)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
426 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
427 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
428
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
429 service->flags &= ~flags;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
430
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
431 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
432 }
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 const char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
435 xmpp_disco_service_get_jid(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
436 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
437
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
438 return service->jid;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
439 }
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 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
442 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
443 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
444
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
445 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
446 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
447 }
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
448 }
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 const char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
451 xmpp_disco_service_get_node(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
452 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
453
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
454 return service->node;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
455 }
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 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
458 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
459 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
460
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
461 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
462 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
463 }
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
464 }
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 gboolean
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
467 xmpp_disco_service_get_expanded(XmppDiscoService *service) {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
468 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
469
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
470 return service->expanded;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
471 }
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 void
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
474 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
475 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
476
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
477 service->expanded = expanded;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
478
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
479 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
480 }
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 char *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
483 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
484 {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
485 char *icon_name = NULL;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
486
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
487 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
488
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
489 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
490 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
491 #if 0
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
492 } 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
493 icon_name = g_strdup("person");
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
494 #endif
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
495 } 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
496 icon_name = g_strdup("chat");
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
497 }
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 return icon_name;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
500 }
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
501
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
502 GListModel *
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
503 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
504 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
505
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
506 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
507 }
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 void
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
510 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
511 XmppDiscoService *child)
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
512 {
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
513 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
514 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
515 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
516
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
517 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
518 }

mercurial