aboutsummaryrefslogtreecommitdiff
path: root/libindicate/server.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-02 16:12:19 -0500
committerTed Gould <ted@canonical.com>2009-04-02 16:12:19 -0500
commit682684874b40d4a18ae0ebec29e4d42c5184501e (patch)
treeeff43f6efe9c30a0df0d7f0058e91aaab4424899 /libindicate/server.c
parent155442540ae6eb95c04657c8151634e6e8803005 (diff)
downloadlibayatana-indicator-682684874b40d4a18ae0ebec29e4d42c5184501e.tar.gz
libayatana-indicator-682684874b40d4a18ae0ebec29e4d42c5184501e.tar.bz2
libayatana-indicator-682684874b40d4a18ae0ebec29e4d42c5184501e.zip
Filling in the dbus owner changing code. Now we should catch those.
Diffstat (limited to 'libindicate/server.c')
-rw-r--r--libindicate/server.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/libindicate/server.c b/libindicate/server.c
index 0dba9fa..ca3257b 100644
--- a/libindicate/server.c
+++ b/libindicate/server.c
@@ -428,8 +428,46 @@ indicate_server_hide (IndicateServer * server)
static void
dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, IndicateServer * server)
{
+ if (prev != NULL) {
+ /* We only care about people leaving the bus */
+ return;
+ }
+
+ IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server);
+
+ IndicateServerInterestedFolk searchitem;
+ searchitem.sender = (gchar *)name;
+ GList * entry = g_list_find_custom(priv->interestedfolks, &searchitem, indicate_server_interested_folks_equal);
+
+ if (entry == NULL) {
+ return;
+ }
+ IndicateServerInterestedFolk * folk = (IndicateServerInterestedFolk *)entry->data;
+ priv->interestedfolks = g_list_remove(priv->interestedfolks, entry);
+ guint i;
+ for (i = INDICATE_INTEREST_NONE; i < INDICATE_INTEREST_LAST; i++) {
+ priv->interests[i] = FALSE;
+ }
+
+ GList * listi = NULL;
+ for (listi = priv->interestedfolks ; listi != NULL ; listi = listi->next) {
+ IndicateServerInterestedFolk * folkpointer = (IndicateServerInterestedFolk *)listi->data;
+ indicate_server_interested_folks_copy(folkpointer, priv->interests);
+ }
+
+ for (i = INDICATE_INTEREST_NONE; i < INDICATE_INTEREST_LAST; i++) {
+ if (folk->interests[i] != priv->interests[i]) {
+ /* We can only remove interest here. Think about it for a
+ moment and I think you'll be cool with it. */
+ g_signal_emit(G_OBJECT(server), signals[INTEREST_REMOVED], 0, i, TRUE);
+ }
+ }
+
+ g_free(folk);
+
+ return;
}
static guint