SHA256
1
0
forked from pool/nemo
nemo/nemo-2.0.1-g_list_copy_deep.patch

83 lines
2.8 KiB
Diff

Index: nemo-2.0.1/src/nemo-window.c
===================================================================
--- nemo-2.0.1.orig/src/nemo-window.c
+++ nemo-2.0.1/src/nemo-window.c
@@ -2344,17 +2344,58 @@ nemo_window_set_ignore_meta_zoom_level (
window->details->ignore_meta_zoom_level = level;
}
+/* FIXME:
+ *
+ * Remove this and just use g_list_copy_deep
+ * when we no longer need to support GLib < 2.34
+ *
+ */
+
+static GList *
+list_copy_deep (GList *list, GCopyFunc func, gpointer user_data)
+{
+ GList *new_list = NULL;
+
+ if (list)
+ {
+ GList *last;
+
+ new_list = g_slice_new (GList);
+ if (func)
+ new_list->data = func (list->data, user_data);
+ else
+ new_list->data = list->data;
+ new_list->prev = NULL;
+ last = new_list;
+ list = list->next;
+ while (list)
+ {
+ last->next = g_slice_new (GList);
+ last->next->prev = last;
+ last = last->next;
+ if (func)
+ last->data = func (list->data, user_data);
+ else
+ last->data = list->data;
+ list = list->next;
+ }
+ last->next = NULL;
+ }
+
+ return new_list;
+}
+
GList *
nemo_window_get_ignore_meta_visible_columns (NemoWindow *window)
{
- return g_list_copy_deep (window->details->ignore_meta_visible_columns, (GCopyFunc) g_strdup, NULL);
+ return list_copy_deep (window->details->ignore_meta_visible_columns, (GCopyFunc) g_strdup, NULL);
}
void
nemo_window_set_ignore_meta_visible_columns (NemoWindow *window, GList *list)
{
GList *old = window->details->ignore_meta_visible_columns;
- window->details->ignore_meta_visible_columns = list != NULL ? g_list_copy_deep (list, (GCopyFunc) g_strdup, NULL) :
+ window->details->ignore_meta_visible_columns = list != NULL ? list_copy_deep (list, (GCopyFunc) g_strdup, NULL) :
NULL;
if (old != NULL)
g_list_free_full (old, g_free);
@@ -2363,14 +2404,14 @@ nemo_window_set_ignore_meta_visible_colu
GList *
nemo_window_get_ignore_meta_column_order (NemoWindow *window)
{
- return g_list_copy_deep (window->details->ignore_meta_column_order, (GCopyFunc) g_strdup, NULL);
+ return list_copy_deep (window->details->ignore_meta_column_order, (GCopyFunc) g_strdup, NULL);
}
void
nemo_window_set_ignore_meta_column_order (NemoWindow *window, GList *list)
{
GList *old = window->details->ignore_meta_column_order;
- window->details->ignore_meta_column_order = list != NULL ? g_list_copy_deep (list, (GCopyFunc) g_strdup, NULL) :
+ window->details->ignore_meta_column_order = list != NULL ? list_copy_deep (list, (GCopyFunc) g_strdup, NULL) :
NULL;
if (old != NULL)
g_list_free_full (old, g_free);