summaryrefslogtreecommitdiff
path: root/capplets
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-11-26 10:59:05 +0100
committerraveit65 <[email protected]>2020-12-04 22:00:43 +0100
commitff32e170961fa1999f802c844ead5d962dfec505 (patch)
tree0e4d8971ecdb745960bbbe676bce1f3ae6efde94 /capplets
parent6bebceb3dbbd9e9fc2b4661499785157cebbc8a4 (diff)
downloadmate-control-center-ff32e170961fa1999f802c844ead5d962dfec505.tar.bz2
mate-control-center-ff32e170961fa1999f802c844ead5d962dfec505.tar.xz
Use g_slist_free_full
Diffstat (limited to 'capplets')
-rw-r--r--capplets/appearance/appearance-desktop.c3
-rw-r--r--capplets/appearance/appearance-font.c15
-rw-r--r--capplets/appearance/appearance-style.c3
-rw-r--r--capplets/common/file-transfer-dialog.c6
-rw-r--r--capplets/common/gtkrc-utils.c6
-rw-r--r--capplets/network/mate-network-properties.c6
6 files changed, 15 insertions, 24 deletions
diff --git a/capplets/appearance/appearance-desktop.c b/capplets/appearance/appearance-desktop.c
index 694c56db..971cb065 100644
--- a/capplets/appearance/appearance-desktop.c
+++ b/capplets/appearance/appearance-desktop.c
@@ -1378,8 +1378,7 @@ desktop_shutdown (AppearanceData *data)
data->screen_size_handler = 0;
}
- g_slist_foreach (data->wp_uris, (GFunc) g_free, NULL);
- g_slist_free (data->wp_uris);
+ g_slist_free_full (data->wp_uris, g_free);
if (data->wp_filesel)
{
g_object_ref_sink (data->wp_filesel);
diff --git a/capplets/appearance/appearance-font.c b/capplets/appearance/appearance-font.c
index 9f1bdba5..7eb9f43d 100644
--- a/capplets/appearance/appearance-font.c
+++ b/capplets/appearance/appearance-font.c
@@ -392,15 +392,16 @@ enum_group_create (GSettings *settings,
}
static void
-enum_group_destroy (EnumGroup *group)
+enum_group_destroy (gpointer data)
{
+ EnumGroup *group = data;
+
g_signal_handler_disconnect (group->settings, group->settings_signal_id);
g_clear_object (&group->settings);
group->settings_signal_id = 0;
g_free (group->settings_key);
- g_slist_foreach (group->items, (GFunc) g_free, NULL);
- g_slist_free (group->items);
+ g_slist_free_full (group->items, g_free);
g_free (group);
}
@@ -795,10 +796,8 @@ void font_init(AppearanceData* data)
g_signal_connect (appearance_capplet_get_widget (data, "details_button"), "clicked", G_CALLBACK (cb_show_details), data);
}
-void font_shutdown(AppearanceData* data)
+void font_shutdown (AppearanceData *data)
{
- g_slist_foreach(data->font_groups, (GFunc) enum_group_destroy, NULL);
- g_slist_free(data->font_groups);
- g_slist_foreach(font_pairs, (GFunc) g_free, NULL);
- g_slist_free(font_pairs);
+ g_slist_free_full (data->font_groups, enum_group_destroy);
+ g_slist_free_full (font_pairs, g_free);
}
diff --git a/capplets/appearance/appearance-style.c b/capplets/appearance/appearance-style.c
index 0b4773ad..05be0a13 100644
--- a/capplets/appearance/appearance-style.c
+++ b/capplets/appearance/appearance-style.c
@@ -322,8 +322,7 @@ check_color_schemes_enabled (GtkSettings *settings,
enable_colors |= found;
}
- g_slist_foreach (symbolic_colors, (GFunc) g_free, NULL);
- g_slist_free (symbolic_colors);
+ g_slist_free_full (symbolic_colors, g_free);
gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "color_scheme_table"), enable_colors);
gtk_widget_set_sensitive (appearance_capplet_get_widget (data, "color_scheme_defaults_button"), enable_colors);
diff --git a/capplets/common/file-transfer-dialog.c b/capplets/common/file-transfer-dialog.c
index 4536e071..3d1cf240 100644
--- a/capplets/common/file-transfer-dialog.c
+++ b/capplets/common/file-transfer-dialog.c
@@ -387,10 +387,8 @@ static void
file_transfer_job_destroy (FileTransferJob *job)
{
g_object_unref (job->dialog);
- g_slist_foreach (job->source_files, (GFunc) g_object_unref, NULL);
- g_slist_foreach (job->target_files, (GFunc) g_object_unref, NULL);
- g_slist_free (job->source_files);
- g_slist_free (job->target_files);
+ g_slist_free_full (job->source_files, g_object_unref);
+ g_slist_free_full (job->target_files, g_object_unref);
if (job->overwrite_dialog != NULL)
gtk_widget_destroy (GTK_WIDGET (job->overwrite_dialog));
g_free (job);
diff --git a/capplets/common/gtkrc-utils.c b/capplets/common/gtkrc-utils.c
index 27e01dae..286eb1be 100644
--- a/capplets/common/gtkrc-utils.c
+++ b/capplets/common/gtkrc-utils.c
@@ -169,8 +169,7 @@ void gtkrc_get_details(gchar* filename, GSList** engines, GSList** symbolic_colo
}
}
- g_slist_foreach (read_files, (GFunc) g_free, NULL);
- g_slist_free (read_files);
+ g_slist_free_full (read_files, g_free);
g_scanner_destroy (scanner);
}
@@ -235,8 +234,7 @@ gtkrc_get_color_scheme (const gchar *gtkrc_file)
}
}
- g_slist_foreach (read_files, (GFunc) g_free, NULL);
- g_slist_free (read_files);
+ g_slist_free_full (read_files, g_free);
g_scanner_destroy (scanner);
return result;
diff --git a/capplets/network/mate-network-properties.c b/capplets/network/mate-network-properties.c
index a4d546e9..5cda10f2 100644
--- a/capplets/network/mate-network-properties.c
+++ b/capplets/network/mate-network-properties.c
@@ -231,8 +231,7 @@ cb_dialog_response (GtkDialog *dialog, gint response_id)
else if (response_id == GTK_RESPONSE_CLOSE || response_id == GTK_RESPONSE_DELETE_EVENT)
{
if (ignore_hosts) {
- g_slist_foreach (ignore_hosts, (GFunc) g_free, NULL);
- g_slist_free (ignore_hosts);
+ g_slist_free_full (ignore_hosts, g_free);
}
gtk_main_quit ();
@@ -368,8 +367,7 @@ connect_sensitivity_signals (GtkBuilder *builder, GSList *mode_group)
static void
cb_ignore_hosts_gsettings_changed (GSettings *settings, gchar *key, gpointer user_data)
{
- g_slist_foreach (ignore_hosts, (GFunc) g_free, NULL);
- g_slist_free (ignore_hosts);
+ g_slist_free_full (ignore_hosts, g_free);
read_ignore_hosts_from_gsettings ();