[gnome-settings-daemon/f16] Fix a typo in registration of an object on DBus

mkasik mkasik at fedoraproject.org
Tue Oct 25 10:12:34 UTC 2011


commit 8a5fba5ff6ad63abc27b5bf63b77d857f4ab4c2c
Author: Marek Kasik <mkasik at redhat.com>
Date:   Tue Oct 25 12:10:57 2011 +0200

    Fix a typo in registration of an object on DBus
    
    Fixes #747318.

 gnome-settings-daemon.spec            |    7 ++-
 gsd-printer-object-registration.patch |   93 +++++++++++++++++++++++++++++++++
 2 files changed, 99 insertions(+), 1 deletions(-)
---
diff --git a/gnome-settings-daemon.spec b/gnome-settings-daemon.spec
index 4c68595..c0b5837 100644
--- a/gnome-settings-daemon.spec
+++ b/gnome-settings-daemon.spec
@@ -1,6 +1,6 @@
 Name:           gnome-settings-daemon
 Version:        3.2.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        The daemon sharing settings from GNOME to GTK+/KDE applications
 
 Group:          System Environment/Daemons
@@ -9,6 +9,7 @@ URL:            http://download.gnome.org/sources/%{name}
 #VCS: git:git://git.gnome.org/gnome-settings-daemon
 Source:         http://download.gnome.org/sources/%{name}/3.1/%{name}-%{version}.tar.xz
 Patch0: gsd-calculator.patch
+Patch1: gsd-printer-object-registration.patch
 
 Requires(pre):    GConf2 >= 2.14
 Requires(preun):  GConf2 >= 2.14
@@ -63,6 +64,7 @@ developing applications that use %{name}.
 %prep
 %setup -q
 %patch0 -p1 
+%patch1 -p1 -b .gsd-printer
 
 # autoreconf -i -f
 
@@ -218,6 +220,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
 %{_datadir}/gnome-settings-daemon-3.0/input-device-example.sh
 
 %changelog
+* Tue Oct 25 2011 Marek Kasik <mkasik at redhat.com> - 3.2.1-3
+- Fix a typo in registration of an object on DBus (#747318)
+
 * Mon Oct 24 2011 Matthias Clasen <mclasen at redhat.com> - 3.2.1-2
 - Fix calculator keybinding (#745367)
 
diff --git a/gsd-printer-object-registration.patch b/gsd-printer-object-registration.patch
new file mode 100644
index 0000000..d64f54e
--- /dev/null
+++ b/gsd-printer-object-registration.patch
@@ -0,0 +1,93 @@
+diff --git a/plugins/print-notifications/gsd-printer.c b/plugins/print-notifications/gsd-printer.c
+index c1c2235..63481e1 100644
+--- a/plugins/print-notifications/gsd-printer.c
++++ b/plugins/print-notifications/gsd-printer.c
+@@ -1140,14 +1140,20 @@ on_npn_bus_acquired (GDBusConnection *connection,
+                      const gchar     *name,
+                      gpointer         user_data)
+ {
++        GError *error = NULL;
++
+         npn_registration_id = g_dbus_connection_register_object (connection,
+                                                                  SCP_DBUS_NPN_PATH,
+                                                                  npn_introspection_data->interfaces[0],
+                                                                  &interface_vtable,
+                                                                  NULL,
+                                                                  NULL,
+-                                                                 NULL);
+-        g_assert (npn_registration_id > 0);
++                                                                 &error);
++
++        if (npn_registration_id == 0) {
++                g_warning ("Failed to register object: %s\n", error->message);
++                g_error_free (error);
++        }
+ }
+ 
+ static void
+@@ -1155,14 +1161,20 @@ on_pdi_bus_acquired (GDBusConnection *connection,
+                      const gchar     *name,
+                      gpointer         user_data)
+ {
++        GError *error = NULL;
++
+         pdi_registration_id = g_dbus_connection_register_object (connection,
+                                                                  SCP_DBUS_PDI_PATH,
+-                                                                 npn_introspection_data->interfaces[0],
++                                                                 pdi_introspection_data->interfaces[0],
+                                                                  &interface_vtable,
+                                                                  NULL,
+                                                                  NULL,
+-                                                                 NULL);
+-        g_assert (npn_registration_id > 0);
++                                                                 &error);
++
++        if (pdi_registration_id == 0) {
++                g_warning ("Failed to register object: %s\n", error->message);
++                g_error_free (error);
++        }
+ }
+ 
+ static void
+@@ -1351,12 +1363,22 @@ main (int argc, char *argv[])
+   notify_init ("gnome-settings-daemon-printer");
+ 
+   npn_introspection_data =
+-          g_dbus_node_info_new_for_xml (npn_introspection_xml, NULL);
+-  g_assert (npn_introspection_data != NULL);
++          g_dbus_node_info_new_for_xml (npn_introspection_xml, &error);
++
++  if (npn_introspection_data == NULL) {
++          g_warning ("Error parsing introspection XML: %s\n", error->message);
++          g_error_free (error);
++          goto error;
++  }
+ 
+   pdi_introspection_data =
+-          g_dbus_node_info_new_for_xml (pdi_introspection_xml, NULL);
+-  g_assert (pdi_introspection_data != NULL);
++          g_dbus_node_info_new_for_xml (pdi_introspection_xml, &error);
++
++  if (pdi_introspection_data == NULL) {
++          g_warning ("Error parsing introspection XML: %s\n", error->message);
++          g_error_free (error);
++          goto error;
++  }
+ 
+   connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
+ 
+@@ -1426,4 +1448,14 @@ main (int argc, char *argv[])
+   g_dbus_node_info_unref (pdi_introspection_data);
+ 
+   return 0;
++
++error:
++
++  if (npn_introspection_data)
++          g_dbus_node_info_unref (npn_introspection_data);
++
++  if (pdi_introspection_data)
++          g_dbus_node_info_unref (pdi_introspection_data);
++
++  return 1;
+ }


More information about the scm-commits mailing list