diff options
author | Nick Schermer <nick@xfce.org> | 2012-10-22 20:38:58 +0200 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2012-10-22 20:40:42 +0200 |
commit | 5a0fd479b4a6e87ff9dea1597386ba935bf2aa6d (patch) | |
tree | 589fe89ad640855fbbd910c77caf776f7b7e373e /thunarx | |
parent | 7012c86e217454141e24f7d819c4a93178a01c1f (diff) | |
download | thunar-5a0fd479b4a6e87ff9dea1597386ba935bf2aa6d.tar.gz |
Uniform the deep copy function.
There were 2 versions used. Use the one in thunarx
and use marcos for deep appending/prepending.
Diffstat (limited to 'thunarx')
-rw-r--r-- | thunarx/thunarx-file-info.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/thunarx/thunarx-file-info.c b/thunarx/thunarx-file-info.c index 60c8dcff..623560a9 100644 --- a/thunarx/thunarx-file-info.c +++ b/thunarx/thunarx-file-info.c @@ -418,16 +418,16 @@ thunarx_file_info_list_get_type (void) GList* thunarx_file_info_list_copy (GList *file_infos) { - GList *list = NULL; - GList *lp; +#if GLIB_CHECK_VERSION (2, 34, 0) + return g_list_copy_deep (file_infos, (GCopyFunc) g_object_ref, NULL); +#else + GList *copy; - if (file_infos != NULL) - { - for (lp = g_list_last (file_infos); lp != NULL; lp = lp->prev) - list = g_list_prepend (list, g_object_ref (G_OBJECT (lp->data))); - } + copy = g_list_copy (file_infos); + g_list_foreach (copy, (GFunc) g_object_ref, NULL); - return list; + return copy; +#endif } |