[gthumb] Thumbnails not shown when changing sorting



commit 1d3bd5c108ddf1df4df2d5b47c89a6c8acca8b60
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Nov 7 11:39:32 2010 +0100

    Thumbnails not shown when changing sorting
    
    [bug #631816]

 gthumb/gth-file-list.c  |   16 ++++++++++++++++
 gthumb/gth-file-store.c |   13 ++++++++++---
 2 files changed, 26 insertions(+), 3 deletions(-)
---
diff --git a/gthumb/gth-file-list.c b/gthumb/gth-file-list.c
index c04180c..293d238 100644
--- a/gthumb/gth-file-list.c
+++ b/gthumb/gth-file-list.c
@@ -589,6 +589,18 @@ file_store_visibility_changed_cb (GthFileStore *file_store,
 
 
 static void
+file_store_rows_reordered_cb (GtkTreeModel *tree_model,
+			      GtkTreePath  *path,
+			      GtkTreeIter  *iter,
+			      gpointer      new_order,
+			      gpointer      user_data)
+{
+	GthFileList *file_list = user_data;
+	file_list->priv->visibility_changed = TRUE;
+}
+
+
+static void
 gth_file_list_construct (GthFileList     *file_list,
 			 GthFileListType  list_type,
 			 gboolean         enable_drag_drop)
@@ -639,6 +651,10 @@ gth_file_list_construct (GthFileList     *file_list,
 			  "visibility-changed",
 			  G_CALLBACK (file_store_visibility_changed_cb),
 			  file_list);
+	g_signal_connect (model,
+			  "rows-reordered",
+			  G_CALLBACK (file_store_rows_reordered_cb),
+			  file_list);
 
 	if (enable_drag_drop) {
 		GtkTargetList  *target_list;
diff --git a/gthumb/gth-file-store.c b/gthumb/gth-file-store.c
index d3d32a1..74db77d 100644
--- a/gthumb/gth-file-store.c
+++ b/gthumb/gth-file-store.c
@@ -980,7 +980,10 @@ for (i = 0; i < old_rows_n; i++)
 g_print ("\n");
 #endif
 
-			gtk_tree_model_rows_reordered (GTK_TREE_MODEL (file_store), NULL, NULL, new_order);
+			gtk_tree_model_rows_reordered (GTK_TREE_MODEL (file_store),
+						       NULL,
+						       NULL,
+						       new_order);
 		}
 
 		g_free (new_order);
@@ -1089,8 +1092,12 @@ _gth_file_store_reorder (GthFileStore *file_store)
 		}
 		row->abs_pos = i;
 	}
-	if (new_order != NULL)
-		gtk_tree_model_rows_reordered (GTK_TREE_MODEL (file_store), NULL, NULL, new_order);
+	if (new_order != NULL) {
+		gtk_tree_model_rows_reordered (GTK_TREE_MODEL (file_store),
+					       NULL,
+					       NULL,
+					       new_order);
+	}
 	g_free (new_order);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]