[Xfce4-commits] [xfce/xfdesktop] 09/34: g_error_free -> g_clear_error
noreply at xfce.org
noreply at xfce.org
Sun Apr 16 07:06:43 CEST 2017
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository xfce/xfdesktop.
commit 040cade122b701aae1d1ada3374589d2654794f3
Author: Eric Koegel <eric.koegel at gmail.com>
Date: Wed Mar 1 08:32:12 2017 +0300
g_error_free -> g_clear_error
clear error handles freeing the error message and setting it
to NULL if required for us.
---
common/xfdesktop-thumbnailer.c | 7 ++-----
settings/main.c | 6 +++---
src/xfce-desktop-menu.c | 2 +-
src/xfdesktop-app-menu-item.c | 4 ++--
src/xfdesktop-application.c | 6 +++---
src/xfdesktop-file-icon-manager.c | 6 +++---
src/xfdesktop-file-utils.c | 11 +++++------
src/xfdesktop-volume-icon.c | 6 +++---
8 files changed, 22 insertions(+), 26 deletions(-)
diff --git a/common/xfdesktop-thumbnailer.c b/common/xfdesktop-thumbnailer.c
index 494884d..2cdd2f9 100644
--- a/common/xfdesktop-thumbnailer.c
+++ b/common/xfdesktop-thumbnailer.c
@@ -484,9 +484,7 @@ xfdesktop_thumbnailer_queue_request_timer(XfdesktopThumbnailer *thumbnailer)
g_free(uris);
g_free(mimetypes);
-
- if(error)
- g_error_free(error);
+ g_clear_error(&error);
thumbnailer->priv->request_timer_id = 0;
@@ -634,6 +632,5 @@ xfdesktop_thumbnailer_delete_thumbnail(XfdesktopThumbnailer *thumbnailer, gchar
}
g_object_unref(file);
- if(error)
- g_error_free(error);
+ g_clear_error(&error);
}
diff --git a/settings/main.c b/settings/main.c
index c97c4a2..a69ed92 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -1816,7 +1816,7 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml,
{
g_printerr("Failed to parse appearance settings UI description: %s\n",
error->message);
- g_error_free(error);
+ g_clear_error(&error);
exit(1);
}
@@ -2087,7 +2087,7 @@ main(int argc, char **argv)
g_printerr("%s: %s.\n", G_LOG_DOMAIN, error->message);
g_printerr(_("Type '%s --help' for usage."), G_LOG_DOMAIN);
g_printerr("\n");
- g_error_free(error);
+ g_clear_error(&error);
} else
g_error("Unable to open display.");
@@ -2122,7 +2122,7 @@ main(int argc, char **argv)
&error))
{
g_printerr("Failed to parse UI description: %s\n", error->message);
- g_error_free(error);
+ g_clear_error(&error);
return 1;
}
diff --git a/src/xfce-desktop-menu.c b/src/xfce-desktop-menu.c
index 480b7cb..da0aa12 100644
--- a/src/xfce-desktop-menu.c
+++ b/src/xfce-desktop-menu.c
@@ -189,7 +189,7 @@ _generate_menu(XfceDesktopMenu *desktop_menu)
if(!garcon_menu_load(desktop_menu->garcon_menu, NULL, &error)) {
g_warning("Unable to load menu: %s", error->message);
- g_error_free(error);
+ g_clear_error(&error);
return FALSE;
}
diff --git a/src/xfdesktop-app-menu-item.c b/src/xfdesktop-app-menu-item.c
index 213befa..101f54a 100644
--- a/src/xfdesktop-app-menu-item.c
+++ b/src/xfdesktop-app-menu-item.c
@@ -353,7 +353,7 @@ xfdesktop_app_menu_item_edit_launcher(XfdesktopAppMenuItem *app_menu_item)
_("Unable to launch \"exo-desktop-item-edit\", which is required to create and edit launchers and links on the desktop."),
error->message, GTK_STOCK_CLOSE,
GTK_RESPONSE_ACCEPT, NULL);
- g_error_free(error);
+ g_clear_error(&error);
} else {
ret = TRUE;
}
@@ -409,7 +409,7 @@ xfdesktop_app_menu_item_activate(XfdesktopAppMenuItem *app_menu_item)
&error)) {
g_warning("XfdesktopAppMenuItem: unable to spawn %s: %s",
command, error->message);
- g_error_free(error);
+ g_clear_error(&error);
}
gdk_event_free((GdkEvent*)evt);
diff --git a/src/xfdesktop-application.c b/src/xfdesktop-application.c
index f7e2cba..025cba0 100644
--- a/src/xfdesktop-application.c
+++ b/src/xfdesktop-application.c
@@ -714,7 +714,7 @@ xfdesktop_application_start(XfdesktopApplication *app)
if(!xfconf_init(&error)) {
g_warning("%s: unable to connect to settings daemon: %s. Defaults will be used",
PACKAGE, error->message);
- g_error_free(error);
+ g_clear_error(&error);
error = NULL;
} else
app->channel = xfconf_channel_get(XFDESKTOP_CHANNEL);
@@ -762,7 +762,7 @@ xfdesktop_application_start(XfdesktopApplication *app)
app, NULL);
} else {
g_warning("Unable to set up POSIX signal handlers: %s", error->message);
- g_error_free(error);
+ g_clear_error(&error);
}
gtk_main();
@@ -861,7 +861,7 @@ xfdesktop_application_local_command_line(GApplication *g_application,
if(!g_option_context_parse(octx, &argc, arguments, &error)) {
g_printerr(_("Failed to parse arguments: %s\n"), error->message);
g_option_context_free(octx);
- g_error_free(error);
+ g_clear_error(&error);
*exit_status = 1;
return TRUE;
}
diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c
index 2c4a9b8..5b3b71f 100644
--- a/src/xfdesktop-file-icon-manager.c
+++ b/src/xfdesktop-file-icon-manager.c
@@ -861,7 +861,7 @@ xfdesktop_file_icon_menu_app_info_executed(GtkWidget *widget,
GTK_STOCK_DIALOG_ERROR, primary, error->message,
GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT, NULL);
g_free(primary);
- g_error_free(error);
+ g_clear_error(&error);
}
}
@@ -1156,7 +1156,7 @@ xfdesktop_file_icon_menu_create_launcher(GtkWidget *widget,
_("Unable to launch \"exo-desktop-item-edit\", which is required to create and edit launchers and links on the desktop."),
error->message, GTK_STOCK_CLOSE,
GTK_RESPONSE_ACCEPT, NULL);
- g_error_free(error);
+ g_clear_error(&error);
}
g_free(display_name);
@@ -1368,7 +1368,7 @@ xfdesktop_settings_launch(GtkWidget *w,
GTK_STOCK_DIALOG_ERROR, primary, error->message,
GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT, NULL);
g_free(primary);
- g_error_free(error);
+ g_clear_error(&error);
}
g_free(cmd);
diff --git a/src/xfdesktop-file-utils.c b/src/xfdesktop-file-utils.c
index 5295ed3..a7cc6e4 100644
--- a/src/xfdesktop-file-utils.c
+++ b/src/xfdesktop-file-utils.c
@@ -667,7 +667,7 @@ xfdesktop_file_utils_open_folder(GFile *file,
error->message, GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT,
NULL);
- g_error_free(error);
+ g_clear_error(&error);
}
g_free(uri);
@@ -687,7 +687,7 @@ xfdesktop_file_utils_async_cb(DBusGProxy *proxy, GError *error, gpointer userdat
error->message, GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT,
NULL);
}
- g_error_free(error);
+ g_clear_error(&error);
}
}
@@ -1172,8 +1172,7 @@ xfdesktop_file_utils_execute(GFile *working_directory,
g_free(primary);
g_free(name);
g_free(filename);
-
- g_error_free(error);
+ g_clear_error(&error);
success = FALSE;
}
@@ -1305,7 +1304,7 @@ xfdesktop_file_utils_transfer_file(GdkDragAction action,
error->message, GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT,
NULL);
- g_error_free(error);
+ g_clear_error(&error);
}
g_free(startup_id);
@@ -1381,7 +1380,7 @@ xfdesktop_file_utils_transfer_files(GdkDragAction action,
error->message, GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT,
NULL);
- g_error_free(error);
+ g_clear_error(&error);
success = FALSE;
}
diff --git a/src/xfdesktop-volume-icon.c b/src/xfdesktop-volume-icon.c
index fe462d6..51077ff 100644
--- a/src/xfdesktop-volume-icon.c
+++ b/src/xfdesktop-volume-icon.c
@@ -528,7 +528,7 @@ xfdesktop_volume_icon_eject_finish(GObject *object,
g_free(volume_name);
}
- g_error_free(error);
+ g_clear_error(&error);
}
#ifdef HAVE_LIBNOTIFY
@@ -573,7 +573,7 @@ xfdesktop_volume_icon_unmount_finish(GObject *object,
g_free(mount_name);
}
- g_error_free(error);
+ g_clear_error(&error);
}
#ifdef HAVE_LIBNOTIFY
@@ -607,7 +607,7 @@ xfdesktop_volume_icon_mount_finish(GObject *object,
g_free(volume_name);
}
- g_error_free(error);
+ g_clear_error(&error);
} else {
GMount *mount = g_volume_get_mount(volume);
GFile *file = NULL;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list