aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-07-23 21:11:50 -0500
committerTed Gould <ted@canonical.com>2009-07-23 21:11:50 -0500
commit7419d52e1e26079f01c8981306d8fed50fd8c265 (patch)
treeead5141454742c8f1646186dd78f618c9f72770e
parent44fe17857bc3fca0093a83c4d4d4c344d14fca46 (diff)
downloadayatana-indicator-session-7419d52e1e26079f01c8981306d8fed50fd8c265.tar.gz
ayatana-indicator-session-7419d52e1e26079f01c8981306d8fed50fd8c265.tar.bz2
ayatana-indicator-session-7419d52e1e26079f01c8981306d8fed50fd8c265.zip
Building the DKP proxies
-rw-r--r--src/session-service.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/session-service.c b/src/session-service.c
index c281a8a..7b686d5 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -15,6 +15,35 @@
static DbusmenuMenuitem * root_menuitem = NULL;
static GMainLoop * mainloop = NULL;
+static DBusGProxy * dkp_main_proxy = NULL;
+static DBusGProxy * dkp_prop_proxy = NULL;
+
+/* This function goes through and sets up what we need for
+ DKp checking. We're even setting up the calls for the props
+ we need */
+static void
+setup_dkp (void) {
+ DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
+ g_return_if_fail(bus != NULL);
+
+ if (dkp_main_proxy == NULL) {
+ dkp_main_proxy = dbus_g_proxy_new_for_name(bus,
+ DKP_ADDRESS,
+ DKP_OBJECT,
+ DKP_INTERFACE);
+ }
+ g_return_if_fail(dkp_main_proxy != NULL);
+
+ if (dkp_prop_proxy == NULL) {
+ dkp_prop_proxy = dbus_g_proxy_new_for_name(bus,
+ DKP_ADDRESS,
+ DKP_OBJECT,
+ DBUS_INTERFACE_PROPERTIES);
+ }
+ g_return_if_fail(dkp_prop_proxy != NULL);
+
+ return;
+}
/* This is the function to show a dialog on actions that
can destroy data. Currently it just calls the GTK version
@@ -100,6 +129,7 @@ main (int argc, char ** argv)
g_debug("Root ID: %d", dbusmenu_menuitem_get_id(root_menuitem));
create_items(root_menuitem);
+ setup_dkp();
DbusmenuServer * server = dbusmenu_server_new(INDICATOR_SESSION_DBUS_OBJECT);
dbusmenu_server_set_root(server, root_menuitem);