aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-11-06 21:40:28 -0600
committerTed Gould <ted@canonical.com>2009-11-06 21:40:28 -0600
commitbca77a7a1e38c1d97211394799cf103bc02b0547 (patch)
tree57f127a0edca77c5e9d4d748f0d2717adfa5c85a /src
parent78a6d0dc74a7ea166e207f8036cc4930bcdcbbbd (diff)
downloadayatana-indicator-application-bca77a7a1e38c1d97211394799cf103bc02b0547.tar.gz
ayatana-indicator-application-bca77a7a1e38c1d97211394799cf103bc02b0547.tar.bz2
ayatana-indicator-application-bca77a7a1e38c1d97211394799cf103bc02b0547.zip
Getting the registration signal, and passing it up the stack.
Diffstat (limited to 'src')
-rw-r--r--src/custom-service-appstore.c4
-rw-r--r--src/custom-service-appstore.h8
-rw-r--r--src/custom-service-watcher.c24
-rw-r--r--src/notification-watcher.xml1
4 files changed, 20 insertions, 17 deletions
diff --git a/src/custom-service-appstore.c b/src/custom-service-appstore.c
index ceb2c17..b25ffa7 100644
--- a/src/custom-service-appstore.c
+++ b/src/custom-service-appstore.c
@@ -106,7 +106,7 @@ custom_service_appstore_finalize (GObject *object)
}
void
-custom_service_appstore_application_add (CustomServiceAppstore * appstore, gchar * dbus_name, gchar * dbus_object)
+custom_service_appstore_application_add (CustomServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object)
{
g_return_if_fail(IS_CUSTOM_SERVICE_APPSTORE(appstore));
g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0');
@@ -117,7 +117,7 @@ custom_service_appstore_application_add (CustomServiceAppstore * appstore, gchar
}
void
-custom_service_appstore_application_remove (CustomServiceAppstore * appstore, gchar * dbus_name, gchar * dbus_object)
+custom_service_appstore_application_remove (CustomServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object)
{
g_return_if_fail(IS_CUSTOM_SERVICE_APPSTORE(appstore));
g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0');
diff --git a/src/custom-service-appstore.h b/src/custom-service-appstore.h
index e1cb52a..7263617 100644
--- a/src/custom-service-appstore.h
+++ b/src/custom-service-appstore.h
@@ -29,11 +29,11 @@ struct _CustomServiceAppstore {
GType custom_service_appstore_get_type (void);
void custom_service_appstore_application_add (CustomServiceAppstore * appstore,
- gchar * dbus_name,
- gchar * dbus_object);
+ const gchar * dbus_name,
+ const gchar * dbus_object);
void custom_service_appstore_application_remove (CustomServiceAppstore * appstore,
- gchar * dbus_name,
- gchar * dbus_object);
+ const gchar * dbus_name,
+ const gchar * dbus_object);
G_END_DECLS
diff --git a/src/custom-service-watcher.c b/src/custom-service-watcher.c
index 4f6c6d3..a0a1b27 100644
--- a/src/custom-service-watcher.c
+++ b/src/custom-service-watcher.c
@@ -3,14 +3,15 @@
#endif
#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
#include "custom-service-watcher.h"
#include "dbus-shared.h"
-static gboolean _notification_watcher_server_register_service (CustomServiceWatcher * appstore, const gchar * service, DBusGMethodInvocation * method);
-static gboolean _notification_watcher_server_registered_services (CustomServiceWatcher * appstore, GArray ** apps);
-static gboolean _notification_watcher_server_protocol_version (CustomServiceWatcher * appstore, char ** version);
-static gboolean _notification_watcher_server_register_notification_host (CustomServiceWatcher * appstore, const gchar * host);
-static gboolean _notification_watcher_server_is_notification_host_registered (CustomServiceWatcher * appstore, gboolean * haveHost);
+static gboolean _notification_watcher_server_register_service (CustomServiceWatcher * appwatcher, const gchar * service, DBusGMethodInvocation * method);
+static gboolean _notification_watcher_server_registered_services (CustomServiceWatcher * appwatcher, GArray ** apps);
+static gboolean _notification_watcher_server_protocol_version (CustomServiceWatcher * appwatcher, char ** version);
+static gboolean _notification_watcher_server_register_notification_host (CustomServiceWatcher * appwatcher, const gchar * host);
+static gboolean _notification_watcher_server_is_notification_host_registered (CustomServiceWatcher * appwatcher, gboolean * haveHost);
#include "notification-watcher-server.h"
@@ -142,38 +143,39 @@ custom_service_watcher_new (CustomServiceAppstore * appstore)
}
static gboolean
-_notification_watcher_server_register_service (CustomServiceWatcher * appstore, const gchar * service, DBusGMethodInvocation * method)
+_notification_watcher_server_register_service (CustomServiceWatcher * appwatcher, const gchar * service, DBusGMethodInvocation * method)
{
+ CustomServiceWatcherPrivate * priv = CUSTOM_SERVICE_WATCHER_GET_PRIVATE(appwatcher);
-
+ custom_service_appstore_application_add(priv->appstore, dbus_g_method_get_sender(method), service);
dbus_g_method_return(method, G_TYPE_NONE);
return TRUE;
}
static gboolean
-_notification_watcher_server_registered_services (CustomServiceWatcher * appstore, GArray ** apps)
+_notification_watcher_server_registered_services (CustomServiceWatcher * appwatcher, GArray ** apps)
{
return FALSE;
}
static gboolean
-_notification_watcher_server_protocol_version (CustomServiceWatcher * appstore, char ** version)
+_notification_watcher_server_protocol_version (CustomServiceWatcher * appwatcher, char ** version)
{
*version = g_strdup("Ayatana Version 1");
return TRUE;
}
static gboolean
-_notification_watcher_server_register_notification_host (CustomServiceWatcher * appstore, const gchar * host)
+_notification_watcher_server_register_notification_host (CustomServiceWatcher * appwatcher, const gchar * host)
{
return FALSE;
}
static gboolean
-_notification_watcher_server_is_notification_host_registered (CustomServiceWatcher * appstore, gboolean * haveHost)
+_notification_watcher_server_is_notification_host_registered (CustomServiceWatcher * appwatcher, gboolean * haveHost)
{
*haveHost = TRUE;
return TRUE;
diff --git a/src/notification-watcher.xml b/src/notification-watcher.xml
index 06e3e68..7b034e7 100644
--- a/src/notification-watcher.xml
+++ b/src/notification-watcher.xml
@@ -7,6 +7,7 @@
<!-- Methods -->
<method name="RegisterService">
+ <annotation name="org.freedesktop.DBus.GLib.Async" value="true" />
<arg type="s" name="service" direction="in" />
</method>
<method name="RegisteredServices">