From 85f82b21e62960e857a3a1fbca36c889741127c6 Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Tue, 25 Oct 2011 12:10:57 +0200 Subject: [PATCH] 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 deletion(-) create mode 100644 gsd-printer-object-registration.patch diff --git a/gnome-settings-daemon.spec b/gnome-settings-daemon.spec index 1f760f0..1a75725 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 @@ -60,6 +61,7 @@ developing applications that use %{name}. %prep %setup -q %patch0 -p1 +%patch1 -p1 -b .gsd-printer # autoreconf -i -f @@ -215,6 +217,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 - 3.2.1-3 +- Fix a typo in registration of an object on DBus (#747318) + * Mon Oct 24 2011 Matthias Clasen - 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; + }