[Commits] [SCM] claws branch, master, updated. 3.16.0-178-g70bb44f
wwp at claws-mail.org
wwp at claws-mail.org
Thu May 24 17:40:45 CEST 2018
The branch, master has been updated
via 70bb44f2e2ed7723da538982dac0575e669c4bc7 (commit)
from 37988be084ad9646d898eef595edf0f1bad58bbc (commit)
Summary of changes:
src/common/utils.c | 22 ++--------------------
src/common/utils.h | 3 +--
src/compose.c | 17 +++++++----------
src/folderview.c | 5 ++---
src/main.c | 3 +--
src/messageview.c | 9 +++------
src/plugins/vcalendar/vcal_folder.c | 3 +--
src/plugins/vcalendar/vcal_meeting_gtk.c | 3 +--
8 files changed, 18 insertions(+), 47 deletions(-)
- Log -----------------------------------------------------------------
commit 70bb44f2e2ed7723da538982dac0575e669c4bc7
Author: wwp <wwp at free.fr>
Date: Thu May 24 17:39:03 2018 +0200
Since we depend on GLib 2.28, make real use of GList/GSList's _free_full
functions. Remove unused list freeing functions.
diff --git a/src/common/utils.c b/src/common/utils.c
index 6bb2d6f..17dcabb 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -134,32 +134,14 @@ GSList *slist_copy_deep(GSList *list, GCopyFunc func)
#endif
}
-void list_free_strings(GList *list)
+void slist_free_strings_full(GList *list)
{
- list = g_list_first(list);
-
- while (list != NULL) {
- g_free(list->data);
- list = list->next;
- }
-}
-
-void slist_free_strings(GSList *list)
-{
- while (list != NULL) {
- g_free(list->data);
- list = list->next;
- }
+ g_list_free_full(list, (GDestroyNotify)g_free);
}
void slist_free_strings_full(GSList *list)
{
-#if GLIB_CHECK_VERSION(2,28,0)
g_slist_free_full(list, (GDestroyNotify)g_free);
-#else
- g_slist_foreach(list, (GFunc)g_free, NULL);
- g_slist_free(list);
-#endif
}
static void hash_free_strings_func(gpointer key, gpointer value, gpointer data)
diff --git a/src/common/utils.h b/src/common/utils.h
index c904874..b3c088c 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -278,8 +278,7 @@ GSList *slist_copy_deep (GSList *list,
/* String utilities. */
-void list_free_strings (GList *list);
-void slist_free_strings (GSList *list);
+void list_free_strings_full (GList *list);
void slist_free_strings_full (GSList *list);
void hash_free_strings (GHashTable *table);
diff --git a/src/compose.c b/src/compose.c
index 7888cd4..5583ba4 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -11552,10 +11552,10 @@ static void compose_attach_drag_received_cb (GtkWidget *widget,
utf8_filename, NULL, NULL);
g_free(utf8_filename);
}
- if (list) compose_changed_cb(NULL, compose);
- list_free_strings(list);
- g_list_free(list);
- } else if (gtk_drag_get_source_widget(context)
+ if (list)
+ compose_changed_cb(NULL, compose);
+ list_free_strings_full(list);
+ } else if (gtk_drag_get_source_widget(context)
== summary_get_main_widget(mainwindow_get_mainwindow()->summaryview)) {
/* comes from our summaryview */
SummaryView * summaryview = NULL;
@@ -11683,21 +11683,18 @@ static void compose_insert_drag_received_cb (GtkWidget *widget,
if (val == G_ALERTDEFAULT || val == G_ALERTCANCEL) {
gtk_drag_finish(drag_context, FALSE, FALSE, time);
- list_free_strings(list);
- g_list_free(list);
+ list_free_strings_full(list);
return;
} else if (val == G_ALERTOTHER) {
compose_attach_drag_received_cb(widget, drag_context, x, y, data, info, time, user_data);
- list_free_strings(list);
- g_list_free(list);
+ list_free_strings_full(list);
return;
}
for (tmp = list; tmp != NULL; tmp = tmp->next) {
compose_insert_file(compose, (const gchar *)tmp->data);
}
- list_free_strings(list);
- g_list_free(list);
+ list_free_strings_full(list);
gtk_drag_finish(drag_context, TRUE, FALSE, time);
return;
}
diff --git a/src/folderview.c b/src/folderview.c
index ae53b90..8c19b19 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -3138,10 +3138,9 @@ void folderview_finish_dnd(const gchar *data, GdkDragContext *drag_context,
g_slist_free(msglist);
gtk_drag_finish(drag_context, TRUE, FALSE, time);
} else {
- gtk_drag_finish(drag_context, FALSE, FALSE, time);
+ gtk_drag_finish(drag_context, FALSE, FALSE, time);
}
- list_free_strings(list);
- g_list_free(list);
+ list_free_strings_full(list);
}
static void folderview_drag_received_cb(GtkWidget *widget,
diff --git a/src/main.c b/src/main.c
index c9590a7..22baeb4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1585,8 +1585,7 @@ int main(int argc, char *argv[])
open_compose_new(cmd.compose_mailto, cmd.attach_files);
}
if (cmd.attach_files) {
- list_free_strings(cmd.attach_files);
- g_list_free(cmd.attach_files);
+ list_free_strings_full(cmd.attach_files);
cmd.attach_files = NULL;
}
if (cmd.subscribe) {
diff --git a/src/messageview.c b/src/messageview.c
index 95d851f..558ab6b 100644
--- a/src/messageview.c
+++ b/src/messageview.c
@@ -1195,11 +1195,9 @@ static void messageview_register_nav(MessageView *messageview)
if (end->prev) {
end->prev->next = NULL;
end->prev = NULL;
- list_free_strings(end);
- g_list_free(end);
+ list_free_strings_full(end);
} else {
- list_free_strings(messageview->trail);
- g_list_free(messageview->trail);
+ list_free_strings_full(messageview->trail);
messageview->trail = NULL;
}
}
@@ -1656,8 +1654,7 @@ void messageview_destroy(MessageView *messageview)
g_free(messageview->toolbar);
}
- list_free_strings(messageview->trail);
- g_list_free(messageview->trail);
+ list_free_strings_full(messageview->trail);
msgview_list = g_list_remove(msgview_list, messageview);
if (messageview->window)
diff --git a/src/plugins/vcalendar/vcal_folder.c b/src/plugins/vcalendar/vcal_folder.c
index 1c987bd..d4217a1 100644
--- a/src/plugins/vcalendar/vcal_folder.c
+++ b/src/plugins/vcalendar/vcal_folder.c
@@ -1531,8 +1531,7 @@ gchar* get_item_event_list_for_date(FolderItem *item, EventTime date)
strcpy(result+e_len+2, (gchar *)cur->data);
}
}
- slist_free_strings(strs);
- g_slist_free(strs);
+ slist_free_strings_full(strs);
return result;
}
diff --git a/src/plugins/vcalendar/vcal_meeting_gtk.c b/src/plugins/vcalendar/vcal_meeting_gtk.c
index 967ac8c..5b2dc26 100644
--- a/src/plugins/vcalendar/vcal_meeting_gtk.c
+++ b/src/plugins/vcalendar/vcal_meeting_gtk.c
@@ -1418,8 +1418,7 @@ static VCalMeeting *vcal_meeting_create_real(VCalEvent *event, gboolean visible)
gtk_combo_box_set_active(GTK_COMBO_BOX(meet->end_time), -1);
combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(meet->end_time), times);
- list_free_strings(times);
- g_list_free(times);
+ list_free_strings_full(times);
meet->location = gtk_entry_new();
meet->summary = gtk_entry_new();
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list