Try this again

When the hostnamed call is cancelled, we get a G_IO_ERROR_CANCELLED
error back. Handle it properly.
This commit is contained in:
Matthias Clasen
2013-05-02 09:29:35 -04:00
parent f7f63ae3ee
commit c6894cd606

View File

@@ -3568,12 +3568,15 @@ 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);
proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
return;
sidebar->hostnamed_proxy = proxy;
g_clear_object (&sidebar->hostnamed_cancellable);
g_object_unref (sidebar);
if (error != NULL) {
g_debug ("Failed to create D-Bus proxy: %s", error->message);
g_error_free (error);
@@ -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;