r36197 - in /desktop/unstable/gnome-settings-daemon/debian: changelog patches/01_print_proxy.patch patches/02_print_init.patch patches/03_print_async.patch patches/series

joss at users.alioth.debian.org joss at users.alioth.debian.org
Fri Oct 26 16:51:44 UTC 2012


Author: joss
Date: Fri Oct 26 16:51:44 2012
New Revision: 36197

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=36197
Log:
* Pull upstream fixes for the print-notifications plugin:
  + 01_print_proxy.patch: don’t create an unused GDBusProxy.
  + 02_print_init.patch: delay CUPS initialization.
  + 03_print_async.patch: test asynchronously whether the CUPS server 
    actually works. Closes: #687978.

Added:
    desktop/unstable/gnome-settings-daemon/debian/patches/01_print_proxy.patch
    desktop/unstable/gnome-settings-daemon/debian/patches/02_print_init.patch
    desktop/unstable/gnome-settings-daemon/debian/patches/03_print_async.patch
Modified:
    desktop/unstable/gnome-settings-daemon/debian/changelog
    desktop/unstable/gnome-settings-daemon/debian/patches/series

Modified: desktop/unstable/gnome-settings-daemon/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-settings-daemon/debian/changelog?rev=36197&op=diff
==============================================================================
--- desktop/unstable/gnome-settings-daemon/debian/changelog [utf-8] (original)
+++ desktop/unstable/gnome-settings-daemon/debian/changelog [utf-8] Fri Oct 26 16:51:44 2012
@@ -1,3 +1,13 @@
+gnome-settings-daemon (3.4.2+git20120925.a4c817-2) UNRELEASED; urgency=low
+
+  * Pull upstream fixes for the print-notifications plugin:
+    + 01_print_proxy.patch: don’t create an unused GDBusProxy.
+    + 02_print_init.patch: delay CUPS initialization.
+    + 03_print_async.patch: test asynchronously whether the CUPS server 
+      actually works. Closes: #687978.
+
+ -- Josselin Mouette <joss at debian.org>  Fri, 26 Oct 2012 18:48:37 +0200
+
 gnome-settings-daemon (3.4.2+git20120925.a4c817-1) unstable; urgency=low
 
   * debian/g-s-d.gsettings-override: disable remember-numlock-state, 

Added: desktop/unstable/gnome-settings-daemon/debian/patches/01_print_proxy.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-settings-daemon/debian/patches/01_print_proxy.patch?rev=36197&op=file
==============================================================================
--- desktop/unstable/gnome-settings-daemon/debian/patches/01_print_proxy.patch (added)
+++ desktop/unstable/gnome-settings-daemon/debian/patches/01_print_proxy.patch [utf-8] Fri Oct 26 16:51:44 2012
@@ -1,0 +1,87 @@
+From 4dd2bc1f5ba76663710285d4d9c17172682af56e Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen at redhat.com>
+Date: Sat, 21 Apr 2012 23:26:05 +0000
+Subject: print-notifications: Don't create an unused proxy object
+
+The proxy object was not used for anything, and it was creating
+synchronously.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=674550
+---
+diff --git a/plugins/print-notifications/gsd-print-notifications-manager.c b/plugins/print-notifications/gsd-print-notifications-manager.c
+index bb9c7b9..44fbbbe 100644
+--- a/plugins/print-notifications/gsd-print-notifications-manager.c
++++ b/plugins/print-notifications/gsd-print-notifications-manager.c
+@@ -54,7 +54,6 @@
+ 
+ struct GsdPrintNotificationsManagerPrivate
+ {
+-        GDBusProxy                   *cups_proxy;
+         GDBusConnection              *cups_bus_connection;
+         gint                          subscription_id;
+         cups_dest_t                  *dests;
+@@ -909,8 +908,6 @@ gboolean
+ gsd_print_notifications_manager_start (GsdPrintNotificationsManager *manager,
+                                        GError                      **error)
+ {
+-        GError     *lerror;
+-
+         g_debug ("Starting print-notifications manager");
+ 
+         gnome_settings_profile_start (NULL);
+@@ -925,25 +922,12 @@ gsd_print_notifications_manager_start (GsdPrintNotificationsManager *manager,
+ 
+         renew_subscription (manager);
+         g_timeout_add_seconds (RENEW_INTERVAL, renew_subscription, manager);
++        gnome_settings_profile_msg ("renewed subscriptions");
+ 
+         manager->priv->num_dests = cupsGetDests (&manager->priv->dests);
++        gnome_settings_profile_msg ("got dests");
+ 
+-        lerror = NULL;
+-        manager->priv->cups_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+-                                                                   0,
+-                                                                   NULL,
+-                                                                   CUPS_DBUS_NAME,
+-                                                                   CUPS_DBUS_PATH,
+-                                                                   CUPS_DBUS_INTERFACE,
+-                                                                   NULL,
+-                                                                   &lerror);
+-
+-        if (lerror != NULL) {
+-                g_propagate_error (error, lerror);
+-                return FALSE;
+-        }
+-
+-        manager->priv->cups_bus_connection = g_dbus_proxy_get_connection (manager->priv->cups_proxy);
++        manager->priv->cups_bus_connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
+ 
+         g_dbus_connection_signal_subscribe (manager->priv->cups_bus_connection,
+                                             NULL,
+@@ -981,12 +965,7 @@ gsd_print_notifications_manager_stop (GsdPrintNotificationsManager *manager)
+ 
+         g_hash_table_destroy (manager->priv->printing_printers);
+ 
+-        manager->priv->cups_bus_connection = NULL;
+-
+-        if (manager->priv->cups_proxy != NULL) {
+-                g_object_unref (manager->priv->cups_proxy);
+-                manager->priv->cups_proxy = NULL;
+-        }
++        g_clear_object (&manager->priv->cups_bus_connection);
+ 
+         for (tmp = manager->priv->timeouts; tmp; tmp = g_list_next (tmp)) {
+                 data = (TimeoutData *) tmp->data;
+@@ -1058,10 +1037,6 @@ gsd_print_notifications_manager_finalize (GObject *object)
+ 
+         g_return_if_fail (manager->priv != NULL);
+ 
+-        if (manager->priv->cups_proxy != NULL) {
+-                g_object_unref (manager->priv->cups_proxy);
+-        }
+-
+         G_OBJECT_CLASS (gsd_print_notifications_manager_parent_class)->finalize (object);
+ }
+ 
+--
+cgit v0.9.0.2

Added: desktop/unstable/gnome-settings-daemon/debian/patches/02_print_init.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-settings-daemon/debian/patches/02_print_init.patch?rev=36197&op=file
==============================================================================
--- desktop/unstable/gnome-settings-daemon/debian/patches/02_print_init.patch (added)
+++ desktop/unstable/gnome-settings-daemon/debian/patches/02_print_init.patch [utf-8] Fri Oct 26 16:51:44 2012
@@ -1,0 +1,89 @@
+From 5f1df8fc7767b9d5967bbbe988346f22995a6285 Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen at redhat.com>
+Date: Mon, 23 Apr 2012 15:14:28 +0000
+Subject: printers: Move expensive initialization to an idle
+
+The start() function is running before gsd finishes its
+session registration, so everything we do here is in the
+critical path for session startup. Both cupsGetDests and
+the subscription registration are potentially expensive,
+and can very well be done later.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=674551
+---
+diff --git a/plugins/print-notifications/gsd-print-notifications-manager.c b/plugins/print-notifications/gsd-print-notifications-manager.c
+index 44fbbbe..33e6452 100644
+--- a/plugins/print-notifications/gsd-print-notifications-manager.c
++++ b/plugins/print-notifications/gsd-print-notifications-manager.c
+@@ -904,25 +904,17 @@ renew_subscription (gpointer data)
+         return TRUE;
+ }
+ 
+-gboolean
+-gsd_print_notifications_manager_start (GsdPrintNotificationsManager *manager,
+-                                       GError                      **error)
++static gboolean
++gsd_print_notifications_manager_start_idle (gpointer data)
+ {
+-        g_debug ("Starting print-notifications manager");
++        GsdPrintNotificationsManager *manager = data;
+ 
+         gnome_settings_profile_start (NULL);
+ 
+-        manager->priv->subscription_id = -1;
+-        manager->priv->dests = NULL;
+-        manager->priv->num_dests = 0;
+-        manager->priv->scp_handler_spawned = FALSE;
+-        manager->priv->timeouts = NULL;
+         manager->priv->printing_printers = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+-        manager->priv->active_notifications = NULL;
+ 
+         renew_subscription (manager);
+         g_timeout_add_seconds (RENEW_INTERVAL, renew_subscription, manager);
+-        gnome_settings_profile_msg ("renewed subscriptions");
+ 
+         manager->priv->num_dests = cupsGetDests (&manager->priv->dests);
+         gnome_settings_profile_msg ("got dests");
+@@ -944,6 +936,30 @@ gsd_print_notifications_manager_start (GsdPrintNotificationsManager *manager,
+ 
+         gnome_settings_profile_end (NULL);
+ 
++        return G_SOURCE_REMOVE;
++}
++
++gboolean
++gsd_print_notifications_manager_start (GsdPrintNotificationsManager *manager,
++                                       GError                      **error)
++{
++        g_debug ("Starting print-notifications manager");
++
++        gnome_settings_profile_start (NULL);
++
++        manager->priv->subscription_id = -1;
++        manager->priv->dests = NULL;
++        manager->priv->num_dests = 0;
++        manager->priv->scp_handler_spawned = FALSE;
++        manager->priv->timeouts = NULL;
++        manager->priv->printing_printers = NULL;
++        manager->priv->active_notifications = NULL;
++        manager->priv->cups_bus_connection = NULL;
++
++        g_idle_add (gsd_print_notifications_manager_start_idle, manager);
++
++        gnome_settings_profile_end (NULL);
++
+         return TRUE;
+ }
+ 
+@@ -963,7 +979,8 @@ gsd_print_notifications_manager_stop (GsdPrintNotificationsManager *manager)
+         if (manager->priv->subscription_id >= 0)
+                 cancel_subscription (manager->priv->subscription_id);
+ 
+-        g_hash_table_destroy (manager->priv->printing_printers);
++        if (manager->priv->printing_printers)
++                g_hash_table_destroy (manager->priv->printing_printers);
+ 
+         g_clear_object (&manager->priv->cups_bus_connection);
+ 
+--
+cgit v0.9.0.2

Added: desktop/unstable/gnome-settings-daemon/debian/patches/03_print_async.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-settings-daemon/debian/patches/03_print_async.patch?rev=36197&op=file
==============================================================================
--- desktop/unstable/gnome-settings-daemon/debian/patches/03_print_async.patch (added)
+++ desktop/unstable/gnome-settings-daemon/debian/patches/03_print_async.patch [utf-8] Fri Oct 26 16:51:44 2012
@@ -1,0 +1,209 @@
+From f2da010bb2423ff8d797306d7b0bdcd6f33c93f8 Mon Sep 17 00:00:00 2001
+From: Marek Kasik <mkasik at redhat.com>
+Date: Tue, 26 Jun 2012 12:04:29 +0000
+Subject: print-notifications: Perform async connection tests to CUPS during start
+
+Perform asynchronous connection tests before getting destinations
+from CUPS server and before creating a subscription for CUPS
+messages (#677081).
+---
+diff --git a/plugins/print-notifications/gsd-print-notifications-manager.c b/plugins/print-notifications/gsd-print-notifications-manager.c
+index 33e6452..0092865 100644
+--- a/plugins/print-notifications/gsd-print-notifications-manager.c
++++ b/plugins/print-notifications/gsd-print-notifications-manager.c
+@@ -47,10 +47,11 @@
+ #define CUPS_DBUS_PATH      "/org/cups/cupsd/Notifier"
+ #define CUPS_DBUS_INTERFACE "org.cups.cupsd.Notifier"
+ 
+-#define RENEW_INTERVAL        3500
+-#define SUBSCRIPTION_DURATION 3600
+-#define CONNECTING_TIMEOUT    60
+-#define REASON_TIMEOUT        15000
++#define RENEW_INTERVAL                   3500
++#define SUBSCRIPTION_DURATION            3600
++#define CONNECTING_TIMEOUT               60
++#define REASON_TIMEOUT                   15000
++#define CUPS_CONNECTION_TEST_INTERVAL    300
+ 
+ struct GsdPrintNotificationsManagerPrivate
+ {
+@@ -63,6 +64,7 @@ struct GsdPrintNotificationsManagerPrivate
+         GList                        *timeouts;
+         GHashTable                   *printing_printers;
+         GList                        *active_notifications;
++        guint                         cups_connection_timeout_id;
+ };
+ 
+ enum {
+@@ -72,6 +74,7 @@ enum {
+ static void     gsd_print_notifications_manager_class_init  (GsdPrintNotificationsManagerClass *klass);
+ static void     gsd_print_notifications_manager_init        (GsdPrintNotificationsManager      *print_notifications_manager);
+ static void     gsd_print_notifications_manager_finalize    (GObject                           *object);
++static gboolean cups_connection_test                        (gpointer                           user_data);
+ 
+ G_DEFINE_TYPE (GsdPrintNotificationsManager, gsd_print_notifications_manager, G_TYPE_OBJECT)
+ 
+@@ -904,6 +907,140 @@ renew_subscription (gpointer data)
+         return TRUE;
+ }
+ 
++static void
++renew_subscription_with_connection_test_cb (GObject      *source_object,
++                                            GAsyncResult *res,
++                                            gpointer      user_data)
++{
++        GSocketConnection *connection;
++        GError            *error = NULL;
++
++        connection = g_socket_client_connect_to_host_finish (G_SOCKET_CLIENT (source_object),
++                                                             res,
++                                                             &error);
++
++        if (connection) {
++                g_debug ("Test connection to CUPS server \'%s:%d\' succeeded.", cupsServer (), ippPort ());
++
++                g_io_stream_close (G_IO_STREAM (connection), NULL, NULL);
++                g_object_unref (connection);
++
++                renew_subscription (user_data);
++        }
++        else {
++                g_debug ("Test connection to CUPS server \'%s:%d\' failed.", cupsServer (), ippPort ());
++        }
++}
++
++static gboolean
++renew_subscription_with_connection_test (gpointer user_data)
++{
++        GSocketClient *client;
++        gchar         *address;
++
++        address = g_strdup_printf ("%s:%d", cupsServer (), ippPort ());
++
++        if (address && address[0] != '/') {
++                client = g_socket_client_new ();
++
++                g_debug ("Initiating test connection to CUPS server \'%s:%d\'.", cupsServer (), ippPort ());
++
++                g_socket_client_connect_to_host_async (client,
++                                                       address,
++                                                       631,
++                                                       NULL,
++                                                       renew_subscription_with_connection_test_cb,
++                                                       user_data);
++
++                g_object_unref (client);
++        }
++        else {
++                renew_subscription (user_data);
++        }
++
++        g_free (address);
++
++        return TRUE;
++}
++
++static void
++cups_connection_test_cb (GObject      *source_object,
++                         GAsyncResult *res,
++                         gpointer      user_data)
++{
++        GsdPrintNotificationsManager *manager = (GsdPrintNotificationsManager *) user_data;
++        GSocketConnection            *connection;
++        GError                       *error = NULL;
++
++        connection = g_socket_client_connect_to_host_finish (G_SOCKET_CLIENT (source_object),
++                                                             res,
++                                                             &error);
++
++        if (connection) {
++                g_debug ("Test connection to CUPS server \'%s:%d\' succeeded.", cupsServer (), ippPort ());
++
++                g_io_stream_close (G_IO_STREAM (connection), NULL, NULL);
++                g_object_unref (connection);
++
++                manager->priv->num_dests = cupsGetDests (&manager->priv->dests);
++                gnome_settings_profile_msg ("got dests");
++
++                renew_subscription (user_data);
++                g_timeout_add_seconds (RENEW_INTERVAL, renew_subscription_with_connection_test, manager);
++        }
++        else {
++                g_debug ("Test connection to CUPS server \'%s:%d\' failed.", cupsServer (), ippPort ());
++                if (manager->priv->cups_connection_timeout_id == 0)
++                        manager->priv->cups_connection_timeout_id =
++                                g_timeout_add_seconds (CUPS_CONNECTION_TEST_INTERVAL, cups_connection_test, manager);
++        }
++}
++
++static gboolean
++cups_connection_test (gpointer user_data)
++{
++        GsdPrintNotificationsManager *manager = (GsdPrintNotificationsManager *) user_data;
++        GSocketClient                *client;
++        gchar                        *address;
++
++        if (!manager->priv->dests) {
++                address = g_strdup_printf ("%s:%d", cupsServer (), ippPort ());
++
++                if (address && address[0] != '/') {
++                        client = g_socket_client_new ();
++
++                        g_debug ("Initiating test connection to CUPS server \'%s:%d\'.", cupsServer (), ippPort ());
++
++                        g_socket_client_connect_to_host_async (client,
++                                                               address,
++                                                               631,
++                                                               NULL,
++                                                               cups_connection_test_cb,
++                                                               manager);
++
++                        g_object_unref (client);
++                }
++                else {
++                        manager->priv->num_dests = cupsGetDests (&manager->priv->dests);
++                        gnome_settings_profile_msg ("got dests");
++
++                        renew_subscription (user_data);
++                        g_timeout_add_seconds (RENEW_INTERVAL, renew_subscription_with_connection_test, manager);
++                }
++
++                g_free (address);
++        }
++
++        if (manager->priv->dests) {
++                manager->priv->cups_connection_timeout_id = 0;
++
++                return FALSE;
++        }
++        else {
++                return TRUE;
++        }
++}
++
+ static gboolean
+ gsd_print_notifications_manager_start_idle (gpointer data)
+ {
+@@ -913,11 +1050,7 @@ gsd_print_notifications_manager_start_idle (gpointer data)
+ 
+         manager->priv->printing_printers = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+ 
+-        renew_subscription (manager);
+-        g_timeout_add_seconds (RENEW_INTERVAL, renew_subscription, manager);
+-
+-        manager->priv->num_dests = cupsGetDests (&manager->priv->dests);
+-        gnome_settings_profile_msg ("got dests");
++        cups_connection_test (manager);
+ 
+         manager->priv->cups_bus_connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
+ 
+@@ -955,6 +1088,7 @@ gsd_print_notifications_manager_start (GsdPrintNotificationsManager *manager,
+         manager->priv->printing_printers = NULL;
+         manager->priv->active_notifications = NULL;
+         manager->priv->cups_bus_connection = NULL;
++        manager->priv->cups_connection_timeout_id = 0;
+ 
+         g_idle_add (gsd_print_notifications_manager_start_idle, manager);
+ 
+--
+cgit v0.9.0.2

Modified: desktop/unstable/gnome-settings-daemon/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-settings-daemon/debian/patches/series?rev=36197&op=diff
==============================================================================
--- desktop/unstable/gnome-settings-daemon/debian/patches/series [utf-8] (original)
+++ desktop/unstable/gnome-settings-daemon/debian/patches/series [utf-8] Fri Oct 26 16:51:44 2012
@@ -1,3 +1,6 @@
+01_print_proxy.patch
+02_print_init.patch
+03_print_async.patch
 04_superP.patch
 10_smaller_syndaemon_timeout.patch
 power-check-null-devices.patch




More information about the pkg-gnome-commits mailing list