From 42129701bdc59b406dbecbc7512b17fae5dc9120 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Thu, 15 May 2014 13:13:15 +0200 Subject: service: own bus name so that the panel can find it on the bus This got accidentally removed in r68. --- src/indicator-printers-service.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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, -- cgit v1.2.3