diff options
author | Carlos Soriano <csoriano@gnome.org> | 2016-04-12 11:48:50 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-04-14 10:35:17 +0200 |
commit | 9997a74f6fb623508c865d2c1034bb2225cadfed (patch) | |
tree | fb51a3017bb40590240b1f031936f410b41f7fb7 | |
parent | 66ad6bec76e46aa1c73d4799c028a8fdc1cfd627 (diff) | |
download | nautilus-9997a74f6fb623508c865d2c1034bb2225cadfed.tar.gz |
desktop-application: use g_clear_error
https://bugzilla.gnome.org/show_bug.cgi?id=712620
-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 |