diff options
-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, |