[nautilus/origin/wip/desktop-split-nofonclicts: 4/26] desktop-application: use g_clear_error
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/origin/wip/desktop-split-nofonclicts: 4/26] desktop-application: use g_clear_error
- Date: Tue, 12 Apr 2016 14:27:35 +0000 (UTC)
commit 4bfb7ad21b51924857d3d4dcdbbb42865d175ab9
Author: Carlos Soriano <csoriano gnome org>
Date: Tue Apr 12 11:48:50 2016 +0200
desktop-application: use g_clear_error
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 7373226..8c5d378 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]