diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-05-02 09:29:35 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-05-02 09:29:35 -0400 |
commit | c6894cd6063851d70d1687d468cf67757939595d (patch) | |
tree | 6d19238867dd1a1c7008b00237ffdf1d3365e0cb | |
parent | f7f63ae3eede9c2e6aa6dd12307ee4972d44abb4 (diff) | |
download | gtk+-c6894cd6063851d70d1687d468cf67757939595d.tar.gz |
Try this again
When the hostnamed call is cancelled, we get a G_IO_ERROR_CANCELLED
error back. Handle it properly.
-rw-r--r-- | gtk/gtkplacessidebar.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 9b08485df0..310b6c7975 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -3568,11 +3568,14 @@ hostname_proxy_new_cb (GObject *source_object, { GtkPlacesSidebar *sidebar = user_data; GError *error = NULL; + GDBusProxy *proxy; - sidebar->hostnamed_proxy = g_dbus_proxy_new_for_bus_finish (res, &error); - g_clear_object (&sidebar->hostnamed_cancellable); + proxy = g_dbus_proxy_new_for_bus_finish (res, &error); + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + return; - g_object_unref (sidebar); + sidebar->hostnamed_proxy = proxy; + g_clear_object (&sidebar->hostnamed_cancellable); if (error != NULL) { g_debug ("Failed to create D-Bus proxy: %s", error->message); @@ -3833,7 +3836,7 @@ gtk_places_sidebar_init (GtkPlacesSidebar *sidebar) "org.freedesktop.hostname1", sidebar->hostnamed_cancellable, hostname_proxy_new_cb, - g_object_ref (sidebar)); + sidebar); sidebar->drop_state = DROP_STATE_NORMAL; sidebar->new_bookmark_index = -1; |