summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-file-changes-queue.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-11-23 03:09:17 -0800
committerStefano Karapetsas <[email protected]>2012-11-23 03:09:17 -0800
commitf6f5c1bb6d060aff5fb334017c640733675c2ae2 (patch)
treecde88ea4e11a2f0809da857feaefa6824d4ba8fa /libcaja-private/caja-file-changes-queue.c
parentcbfe84ee50d01e523472a8e086add01245fad6bb (diff)
parentae06676815e24a27549e0c79a74bc81c77822554 (diff)
downloadcaja-f6f5c1bb6d060aff5fb334017c640733675c2ae2.tar.bz2
caja-f6f5c1bb6d060aff5fb334017c640733675c2ae2.tar.xz
Merge pull request #56 from jasmineaura/develop
[all] add and use glibcompat.h for glib-2.27.2 forward-compat
Diffstat (limited to 'libcaja-private/caja-file-changes-queue.c')
-rw-r--r--libcaja-private/caja-file-changes-queue.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libcaja-private/caja-file-changes-queue.c b/libcaja-private/caja-file-changes-queue.c
index 39cf123e..43495c93 100644
--- a/libcaja-private/caja-file-changes-queue.c
+++ b/libcaja-private/caja-file-changes-queue.c
@@ -25,6 +25,8 @@
#include "caja-directory-notify.h"
+#include <src/glibcompat.h> /* for g_list_free_full */
+
#ifdef G_THREADS_ENABLED
#define MUTEX_LOCK(a) if ((a) != NULL) g_mutex_lock (a)
#define MUTEX_UNLOCK(a) if ((a) != NULL) g_mutex_unlock (a)
@@ -288,8 +290,7 @@ pairs_list_free (GList *pairs)
}
/* delete the list and the now empty pair structs */
- g_list_foreach(pairs, (GFunc) g_free, NULL);
- g_list_free(pairs);
+ g_list_free_full (pairs, g_free);
}
static void
@@ -304,8 +305,7 @@ position_set_list_free (GList *list)
g_object_unref (item->location);
}
/* delete the list and the now empty structs */
- g_list_foreach(list, (GFunc) g_free, NULL);
- g_list_free(list);
+ g_list_free_full (list, g_free);
}
/* go through changes in the change queue, send ones with the same kind
@@ -387,8 +387,7 @@ caja_file_changes_consume_changes (gboolean consume_all)
{
deletions = g_list_reverse (deletions);
caja_directory_notify_files_removed (deletions);
- g_list_foreach(deletions, (GFunc) g_object_unref, NULL);
- g_list_free(deletions);
+ g_list_free_full (deletions, g_object_unref);
deletions = NULL;
}
if (moves != NULL)
@@ -402,16 +401,14 @@ caja_file_changes_consume_changes (gboolean consume_all)
{
additions = g_list_reverse (additions);
caja_directory_notify_files_added (additions);
- g_list_foreach(additions, (GFunc) g_object_unref, NULL);
- g_list_free(additions);
+ g_list_free_full (additions, g_object_unref);
additions = NULL;
}
if (changes != NULL)
{
changes = g_list_reverse (changes);
caja_directory_notify_files_changed (changes);
- g_list_foreach(changes, (GFunc) g_object_unref, NULL);
- g_list_free(changes);
+ g_list_free_full (changes, g_object_unref);
changes = NULL;
}
if (position_set_requests != NULL)