diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2014-05-15 13:13:15 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2014-05-15 13:13:15 +0200 |
commit | 42129701bdc59b406dbecbc7512b17fae5dc9120 (patch) | |
tree | b60b30cba5080aedda79f24cfc55c2ce48452c64 /src | |
parent | 622b83e42b00ef8406d74d8d861fc9b6eab7dd3e (diff) | |
download | ayatana-indicator-printers-42129701bdc59b406dbecbc7512b17fae5dc9120.tar.gz ayatana-indicator-printers-42129701bdc59b406dbecbc7512b17fae5dc9120.tar.bz2 ayatana-indicator-printers-42129701bdc59b406dbecbc7512b17fae5dc9120.zip |
service: own bus name so that the panel can find it on the bus
This got accidentally removed in r68.
Diffstat (limited to 'src')
-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, |