diff options
author | Carlos Soriano <csoriano@gnome.org> | 2016-04-12 11:48:50 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-04-12 13:23:06 +0200 |
commit | 4bfb7ad21b51924857d3d4dcdbbb42865d175ab9 (patch) | |
tree | a4734c44106694dc36800f1b40c79308f2a899ad | |
parent | 63e6491ecb9032cb3e11d4b402bda364f6a740fc (diff) | |
download | nautilus-4bfb7ad21b51924857d3d4dcdbbb42865d175ab9.tar.gz |
desktop-application: use g_clear_error
-rw-r--r-- | src/nautilus-desktop-application.c | 20 |
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 |