]> Pileus Git - ~andy/gtk/commitdiff
Just use the file under the cursor; we don't need the logic from
authorFederico Mena Quintero <federico@ximian.com>
Thu, 25 Mar 2004 21:52:04 +0000 (21:52 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Thu, 25 Mar 2004 21:52:04 +0000 (21:52 +0000)
2004-03-25  Federico Mena Quintero  <federico@ximian.com>

* gtk/gtkfilechooserdefault.c (check_preview_change): Just use the
file under the cursor; we don't need the logic from
GtkFileSelection after all.  Fixes #132255.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkfilechooserdefault.c

index f96283ed1707c4125d03c816155627f344a9f7aa..b284d0598a1879bcf3e70772a76850bcf61a9b58 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-25  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (check_preview_change): Just use the
+       file under the cursor; we don't need the logic from
+       GtkFileSelection after all.  Fixes #132255.
+
 2004-03-25  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdefault.c (location_entry_create): Fill the
index f96283ed1707c4125d03c816155627f344a9f7aa..b284d0598a1879bcf3e70772a76850bcf61a9b58 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-25  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (check_preview_change): Just use the
+       file under the cursor; we don't need the logic from
+       GtkFileSelection after all.  Fixes #132255.
+
 2004-03-25  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdefault.c (location_entry_create): Fill the
index f96283ed1707c4125d03c816155627f344a9f7aa..b284d0598a1879bcf3e70772a76850bcf61a9b58 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-25  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (check_preview_change): Just use the
+       file under the cursor; we don't need the logic from
+       GtkFileSelection after all.  Fixes #132255.
+
 2004-03-25  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdefault.c (location_entry_create): Fill the
index f96283ed1707c4125d03c816155627f344a9f7aa..b284d0598a1879bcf3e70772a76850bcf61a9b58 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-25  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (check_preview_change): Just use the
+       file under the cursor; we don't need the logic from
+       GtkFileSelection after all.  Fixes #132255.
+
 2004-03-25  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdefault.c (location_entry_create): Fill the
index f96283ed1707c4125d03c816155627f344a9f7aa..b284d0598a1879bcf3e70772a76850bcf61a9b58 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-25  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (check_preview_change): Just use the
+       file under the cursor; we don't need the logic from
+       GtkFileSelection after all.  Fixes #132255.
+
 2004-03-25  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkfilechooserdefault.c (location_entry_create): Fill the
index 0a74308caf1ffd18dc0c8c65f008b839fbb755b0..6d7800bafb71ec0b749d9049c5788e9a38ab8199 100644 (file)
@@ -1452,8 +1452,6 @@ new_folder_button_clicked (GtkButton             *button,
   GtkTreeIter iter;
   GtkTreePath *path;
 
-  /* FIXME: this doesn't work for folder mode, just for file mode */
-
   _gtk_file_system_model_add_editable (impl->browse_files_model, &iter);
 
   path = gtk_tree_model_get_path (GTK_TREE_MODEL (impl->browse_files_model), &iter);
@@ -3028,7 +3026,6 @@ set_select_multiple (GtkFileChooserDefault *impl,
   impl->select_multiple = select_multiple;
   g_object_notify (G_OBJECT (impl), "select-multiple");
 
-  /* FIXME #132255: See note in check_preview_change() */
   check_preview_change (impl);
 }
 
@@ -4462,30 +4459,28 @@ filter_combo_changed (GtkComboBox           *combo_box,
 static void
 check_preview_change (GtkFileChooserDefault *impl)
 {
-  const GtkFilePath *new_path = NULL;
-  const GtkFileInfo *new_info = NULL;
+  GtkTreePath *cursor_path;
+  const GtkFilePath *new_path;
+  const GtkFileInfo *new_info;
 
-  /* FIXME #132255: Fixing preview for multiple selection involves getting the
-   * full selection and diffing to find out what the most recently selected file
-   * is; there is logic in GtkFileSelection that probably can be
-   * copied.
-   */
-  if (impl->sort_model && !impl->select_multiple)
+  gtk_tree_view_get_cursor (GTK_TREE_VIEW (impl->browse_files_tree_view), &cursor_path, NULL);
+  if (cursor_path)
     {
-      GtkTreeSelection *selection;
       GtkTreeIter iter;
+      GtkTreeIter child_iter;
 
-      selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_files_tree_view));
-      if (gtk_tree_selection_get_selected (selection, NULL, &iter))
-       {
-         GtkTreeIter child_iter;
+      gtk_tree_model_get_iter (GTK_TREE_MODEL (impl->sort_model), &iter, cursor_path);
+      gtk_tree_path_free (cursor_path);
 
-         gtk_tree_model_sort_convert_iter_to_child_iter (impl->sort_model,
-                                                         &child_iter, &iter);
+      gtk_tree_model_sort_convert_iter_to_child_iter (impl->sort_model, &child_iter, &iter);
 
-         new_path = _gtk_file_system_model_get_path (impl->browse_files_model, &child_iter);
-         new_info = _gtk_file_system_model_get_info (impl->browse_files_model, &child_iter);
-       }
+      new_path = _gtk_file_system_model_get_path (impl->browse_files_model, &child_iter);
+      new_info = _gtk_file_system_model_get_info (impl->browse_files_model, &child_iter);
+    }
+  else
+    {
+      new_path = NULL;
+      new_info = NULL;
     }
 
   if (new_path != impl->preview_path &&