aboutsummaryrefslogtreecommitdiff
path: root/libindicate/indicator.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-01-09 16:32:09 -0600
committerTed Gould <ted@canonical.com>2009-01-09 16:32:09 -0600
commit791b5f802bf0d0ffb72d39c85da512332c889453 (patch)
tree674915dc1d59d5777a19ea06d1e0ca6b48c26603 /libindicate/indicator.c
parent57b3f5814a7059fb382b377610b58703af6359b0 (diff)
downloadlibayatana-indicator-791b5f802bf0d0ffb72d39c85da512332c889453.tar.gz
libayatana-indicator-791b5f802bf0d0ffb72d39c85da512332c889453.tar.bz2
libayatana-indicator-791b5f802bf0d0ffb72d39c85da512332c889453.zip
Connecting indicators and servers. They create themselves easily.
Diffstat (limited to 'libindicate/indicator.c')
-rw-r--r--libindicate/indicator.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libindicate/indicator.c b/libindicate/indicator.c
index 74eefbf..2db8468 100644
--- a/libindicate/indicator.c
+++ b/libindicate/indicator.c
@@ -40,7 +40,8 @@ indicate_indicator_init (IndicateIndicator * indicator)
{
indicator->id = 0;
- /* TODO: Need to connect to a server here */
+ indicator->server = indicate_server_ref_default();
+ indicate_server_add_indicator(indicator->server, indicator);
return;
}
@@ -48,8 +49,19 @@ indicate_indicator_init (IndicateIndicator * indicator)
static void
indicate_indicator_finalize (GObject * obj)
{
- /* TODO: Need to disconnect from server here */
+ IndicateIndicator * indicator = INDICATE_INDICATOR(obj);
+
+ indicate_server_remove_indicator(indicator->server, indicator);
+ g_object_unref(indicator->server);
+ indicator->server = NULL;
return;
}
+IndicateIndicator *
+indicate_indicator_new (void)
+{
+ IndicateIndicator * indicator = g_object_new(INDICATE_TYPE_INDICATOR, NULL);
+ return indicator;
+}
+