summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-04-12 11:48:50 +0200
committerCarlos Soriano <csoriano@gnome.org>2016-04-12 13:23:06 +0200
commit4bfb7ad21b51924857d3d4dcdbbb42865d175ab9 (patch)
treea4734c44106694dc36800f1b40c79308f2a899ad
parent63e6491ecb9032cb3e11d4b402bda364f6a740fc (diff)
downloadnautilus-4bfb7ad21b51924857d3d4dcdbbb42865d175ab9.tar.gz
desktop-application: use g_clear_error
-rw-r--r--src/nautilus-desktop-application.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/nautilus-desktop-application.c b/src/nautilus-desktop-application.c
index 7373226eb..8c5d37841 100644
--- a/src/nautilus-desktop-application.c
+++ b/src/nautilus-desktop-application.c
@@ -50,14 +50,12 @@ on_show_folders (GObject *source_object,
nautilus_freedesktop_file_manager1_call_show_items_finish (freedesktop_proxy,
res,
&error);
- if (error != NULL)
+ if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
{
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- {
- g_warning ("Unable to show items with File Manager freedesktop proxy: %s", error->message);
- }
- g_error_free (error);
+ g_warning ("Unable to show items with File Manager freedesktop proxy: %s", error->message);
}
+
+ g_clear_error (&error);
}
static void
@@ -84,14 +82,12 @@ on_freedesktop_bus_proxy_created (GObject *source_object,
freedesktop_proxy = nautilus_freedesktop_file_manager1_proxy_new_for_bus_finish (res, &error);
- if (error != NULL)
+ if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
{
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- {
- g_warning ("Unable to create File Manager freedesktop proxy: %s", error->message);
- }
- g_error_free (error);
+ g_warning ("Unable to create File Manager freedesktop proxy: %s", error->message);
}
+
+ g_clear_error (&error);
}
static void