aboutsummaryrefslogtreecommitdiff
path: root/src/session-dbus.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-12 14:22:40 -0600
committerTed Gould <ted@gould.cx>2010-03-12 14:22:40 -0600
commitd9427c6a4ecc0a50cac8a674c465631c59ff59f2 (patch)
tree4fa4704f4297a3ccb7ca286e1960c1472c9bbdf4 /src/session-dbus.c
parent2922e646021966770309caf17538b4b241885973 (diff)
downloadayatana-indicator-session-d9427c6a4ecc0a50cac8a674c465631c59ff59f2.tar.gz
ayatana-indicator-session-d9427c6a4ecc0a50cac8a674c465631c59ff59f2.tar.bz2
ayatana-indicator-session-d9427c6a4ecc0a50cac8a674c465631c59ff59f2.zip
Setting up the object and giving it a name.
Diffstat (limited to 'src/session-dbus.c')
-rw-r--r--src/session-dbus.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/session-dbus.c b/src/session-dbus.c
index 3f5e6c7..96b4500 100644
--- a/src/session-dbus.c
+++ b/src/session-dbus.c
@@ -10,7 +10,7 @@ static gboolean _session_dbus_server_get_icon (SessionDbus * service, gchar ** i
typedef struct _SessionDbusPrivate SessionDbusPrivate;
struct _SessionDbusPrivate {
- gint dummy;
+ gchar * name;
};
#define SESSION_DBUS_GET_PRIVATE(o) \
@@ -41,6 +41,14 @@ session_dbus_class_init (SessionDbusClass *klass)
static void
session_dbus_init (SessionDbus *self)
{
+ DBusGConnection * session = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
+ dbus_g_connection_register_g_object(session, "/bob", G_OBJECT(self));
+
+ SessionDbusPrivate * priv = SESSION_DBUS_GET_PRIVATE(self);
+
+ priv->name = g_strdup("icon");
+
+ return;
}
static void
@@ -54,6 +62,12 @@ session_dbus_dispose (GObject *object)
static void
session_dbus_finalize (GObject *object)
{
+ SessionDbusPrivate * priv = SESSION_DBUS_GET_PRIVATE(object);
+
+ if (priv->name != NULL) {
+ g_free(priv->name);
+ priv->name = NULL;
+ }
G_OBJECT_CLASS (session_dbus_parent_class)->finalize (object);
return;
@@ -62,6 +76,7 @@ session_dbus_finalize (GObject *object)
static gboolean
_session_dbus_server_get_icon (SessionDbus * service, gchar ** icon, GError ** error)
{
-
+ SessionDbusPrivate * priv = SESSION_DBUS_GET_PRIVATE(service);
+ *icon = g_strdup(priv->name);
return TRUE;
}