aboutsummaryrefslogtreecommitdiff
path: root/src/custom-service-watcher.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-11-06 17:13:47 -0600
committerTed Gould <ted@canonical.com>2009-11-06 17:13:47 -0600
commitced0ec2c7e9e9138fb42422e662bf03deb957343 (patch)
tree44c308f472d22edadb04c8ba123b4d3379c3982a /src/custom-service-watcher.c
parentfa2ac0047468678ee0bd6cf8e03731bbfdd98dd3 (diff)
downloadlibayatana-appindicator-ced0ec2c7e9e9138fb42422e662bf03deb957343.tar.gz
libayatana-appindicator-ced0ec2c7e9e9138fb42422e662bf03deb957343.tar.bz2
libayatana-appindicator-ced0ec2c7e9e9138fb42422e662bf03deb957343.zip
Connecting the watcher and the appstore. And actually building one. We're on DBus now.
Diffstat (limited to 'src/custom-service-watcher.c')
-rw-r--r--src/custom-service-watcher.c22
1 files changed, 21 insertions, 1 deletions
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)
{