aboutsummaryrefslogtreecommitdiff
path: root/libindicate
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-08-07 18:18:55 +0100
committerTed Gould <ted@canonical.com>2009-08-07 18:18:55 +0100
commitae15eee281b9e3a3df5d0a5d91450def1e76db4a (patch)
tree8cdad5d9b3f74e8c9f4ef8f226d245c0b39749d3 /libindicate
parenta3eb3eaa1500d9c9778f407c7e939a890aa9bdca (diff)
parent8fd9f27b56503242b97313e0f758c01195fe2f79 (diff)
downloadlibayatana-indicator-ae15eee281b9e3a3df5d0a5d91450def1e76db4a.tar.gz
libayatana-indicator-ae15eee281b9e3a3df5d0a5d91450def1e76db4a.tar.bz2
libayatana-indicator-ae15eee281b9e3a3df5d0a5d91450def1e76db4a.zip
Updating from upstream with two (count them) two applets
installed in the source.
Diffstat (limited to 'libindicate')
-rw-r--r--libindicate/indicator.c29
-rw-r--r--libindicate/indicator.h3
2 files changed, 29 insertions, 3 deletions
diff --git a/libindicate/indicator.c b/libindicate/indicator.c
index cb257eb..18cdc4a 100644
--- a/libindicate/indicator.c
+++ b/libindicate/indicator.c
@@ -220,16 +220,39 @@ indicate_indicator_new_with_server (IndicateServer * server)
IndicateIndicator * indicator = g_object_new(INDICATE_TYPE_INDICATOR, NULL);
+ indicate_indicator_set_server (indicator, server);
+
+ return indicator;
+}
+
+/**
+ indicate_indicator_set_server:
+ @indicator: a #IndicateIndicator to act on
+ @server: the #IndicateServer which should be associated with @indicator
+
+ Defines which server this indicator must be associated to. Also, adds a
+ reference to the server.
+*/
+void
+indicate_indicator_set_server (IndicateIndicator * indicator, IndicateServer * server)
+{
IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator);
+
+ if (server != NULL) {
+ g_object_ref(server);
+ }
+
if (priv->server != NULL) {
+ indicate_server_remove_indicator (priv->server, indicator);
g_object_unref(priv->server);
- priv->server = NULL;
}
priv->server = server;
- g_object_ref(priv->server);
+ if (server != NULL) {
+ indicate_server_add_indicator (server, indicator);
+ }
- return indicator;
+ return;
}
diff --git a/libindicate/indicator.h b/libindicate/indicator.h
index 20b998d..b2e33c0 100644
--- a/libindicate/indicator.h
+++ b/libindicate/indicator.h
@@ -119,6 +119,9 @@ void indicate_indicator_hide (IndicateIndicator * indicator);
gboolean indicate_indicator_is_visible (IndicateIndicator * indicator);
+/* Define this indicator server */
+void indicate_indicator_set_server (IndicateIndicator * indicator, IndicateServer * server);
+
/* Every entry has an ID, here's how to get it */
guint indicate_indicator_get_id (IndicateIndicator * indicator);