diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2014-05-27 14:05:56 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-05-27 14:05:56 +0000 |
commit | dc8fa9b01f61aebd4f34ea18960cdf1b156fb675 (patch) | |
tree | b60b30cba5080aedda79f24cfc55c2ce48452c64 | |
parent | 622b83e42b00ef8406d74d8d861fc9b6eab7dd3e (diff) | |
parent | 42129701bdc59b406dbecbc7512b17fae5dc9120 (diff) | |
download | ayatana-indicator-printers-dc8fa9b01f61aebd4f34ea18960cdf1b156fb675.tar.gz ayatana-indicator-printers-dc8fa9b01f61aebd4f34ea18960cdf1b156fb675.tar.bz2 ayatana-indicator-printers-dc8fa9b01f61aebd4f34ea18960cdf1b156fb675.zip |
service: own bus name so that the panel can find it on the bus Fixes: 1304434
-rw-r--r-- | src/indicator-printers-service.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/indicator-printers-service.c b/src/indicator-printers-service.c index f7878a7..b8d15da 100644 --- a/src/indicator-printers-service.c +++ b/src/indicator-printers-service.c @@ -132,6 +132,17 @@ cancel_subscription (int id) ippDelete (resp); } +static void +name_lost (GDBusConnection *connection, + const gchar *name, + gpointer user_data) +{ + int subscription_id = GPOINTER_TO_INT (user_data); + + cancel_subscription (subscription_id); + gtk_main_quit (); +} + int main (int argc, char *argv[]) { /* Init i18n */ @@ -154,6 +165,12 @@ int main (int argc, char *argv[]) renew_subscription_timeout, &subscription_id); + g_bus_own_name (G_BUS_TYPE_SESSION, + INDICATOR_PRINTERS_DBUS_NAME, + G_BUS_NAME_OWNER_FLAGS_NONE, + NULL, NULL, name_lost, + GINT_TO_POINTER (subscription_id), NULL); + cups_notifier = cups_notifier_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, 0, NULL, |