summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2005-10-03 08:46:24 +0000
committerAlexander Larsson <alexl@src.gnome.org>2005-10-03 08:46:24 +0000
commit35bd03e33f9a4d42abcf84448fb3ded01a75856e (patch)
treeaea43864ad0814bfcba5aa0f7a6a5d94e7cab5b9
parenta5b074c0ea25d8b3ec0ddf40292e6171ecb0791d (diff)
downloadnautilus-35bd03e33f9a4d42abcf84448fb3ded01a75856e.tar.gz
Correctly pass iter to gtk_tree_model_rows_reordered() (#315704) Patch
2005-10-03 Alexander Larsson <alexl@redhat.com> * src/file-manager/fm-list-model.c: (fm_list_model_sort_file_entries): Correctly pass iter to gtk_tree_model_rows_reordered() (#315704) Patch from Christian Neumair.
-rw-r--r--ChangeLog7
-rw-r--r--src/file-manager/fm-list-model.c13
2 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ddb4510a1..4ab3c26ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2005-10-03 Alexander Larsson <alexl@redhat.com>
+ * src/file-manager/fm-list-model.c:
+ (fm_list_model_sort_file_entries):
+ Correctly pass iter to gtk_tree_model_rows_reordered() (#315704)
+ Patch from Christian Neumair.
+
+2005-10-03 Alexander Larsson <alexl@redhat.com>
+
* libnautilus-private/nautilus-directory-metafile.c:
(nautilus_directory_get_file_metadata):
On assert failure, return default metadata, not NULL.
diff --git a/src/file-manager/fm-list-model.c b/src/file-manager/fm-list-model.c
index 32a9c5b23..e1f4a5e7c 100644
--- a/src/file-manager/fm-list-model.c
+++ b/src/file-manager/fm-list-model.c
@@ -572,10 +572,12 @@ static void
fm_list_model_sort_file_entries (FMListModel *model, GSequence *files, GtkTreePath *path)
{
GSequencePtr *old_order;
+ GtkTreeIter iter;
int *new_order;
int length;
int i;
FileEntry *file_entry;
+ gboolean has_iter;
length = g_sequence_get_length (files);
@@ -611,8 +613,17 @@ fm_list_model_sort_file_entries (FMListModel *model, GSequence *files, GtkTreePa
/* Let the world know about our new order */
g_assert (new_order != NULL);
+
+ has_iter = FALSE;
+ if (gtk_tree_path_get_depth (path) != 0) {
+ gboolean get_iter_result;
+ has_iter = TRUE;
+ get_iter_result = gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path);
+ g_assert (get_iter_result);
+ }
+
gtk_tree_model_rows_reordered (GTK_TREE_MODEL (model),
- path, NULL, new_order);
+ path, has_iter ? &iter : NULL, new_order);
g_free (old_order);
g_free (new_order);