From ced0ec2c7e9e9138fb42422e662bf03deb957343 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 6 Nov 2009 17:13:47 -0600 Subject: Connecting the watcher and the appstore. And actually building one. We're on DBus now. --- src/custom-service-watcher.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/custom-service-watcher.c') diff --git a/src/custom-service-watcher.c b/src/custom-service-watcher.c index b4680ab..2b83c13 100644 --- a/src/custom-service-watcher.c +++ b/src/custom-service-watcher.c @@ -16,7 +16,7 @@ static gboolean _notification_watcher_server_is_notification_host_registered (Cu typedef struct _CustomServiceWatcherPrivate CustomServiceWatcherPrivate; struct _CustomServiceWatcherPrivate { - int dummy; + CustomServiceAppstore * appstore; }; #define CUSTOM_SERVICE_WATCHER_GET_PRIVATE(o) \ @@ -48,6 +48,10 @@ custom_service_watcher_class_init (CustomServiceWatcherClass *klass) static void custom_service_watcher_init (CustomServiceWatcher *self) { + CustomServiceWatcherPrivate * priv = CUSTOM_SERVICE_WATCHER_GET_PRIVATE(self); + + priv->appstore = NULL; + GError * error = NULL; DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); if (error != NULL) { @@ -66,6 +70,12 @@ custom_service_watcher_init (CustomServiceWatcher *self) static void custom_service_watcher_dispose (GObject *object) { + CustomServiceWatcherPrivate * priv = CUSTOM_SERVICE_WATCHER_GET_PRIVATE(object); + + if (priv->appstore != NULL) { + g_object_unref(G_OBJECT(priv->appstore)); + priv->appstore = NULL; + } G_OBJECT_CLASS (custom_service_watcher_parent_class)->dispose (object); return; @@ -79,6 +89,16 @@ custom_service_watcher_finalize (GObject *object) return; } +CustomServiceWatcher * +custom_service_watcher_new (CustomServiceAppstore * appstore) +{ + GObject * obj = g_object_new(CUSTOM_SERVICE_WATCHER_TYPE, NULL); + CustomServiceWatcherPrivate * priv = CUSTOM_SERVICE_WATCHER_GET_PRIVATE(obj); + priv->appstore = appstore; + g_object_ref(G_OBJECT(priv->appstore)); + return CUSTOM_SERVICE_WATCHER(obj); +} + static gboolean _notification_watcher_server_register_service (CustomServiceWatcher * appstore, const gchar * service, DBusGMethodInvocation * method) { -- cgit v1.2.3