Re: Debugging file save combo



Owen Taylor <otaylor redhat com> writes:

> I put in a few quick fixes there (not committed, because they weren't
> really finished) but things still aren't working right - with my
> fixes, I get the file chooser dying immediately with:
> 
>   Gtk-ERROR **: file gtkfilechooserdefault.c: line 947
> (shortcuts_remove_rows): should not be reached
> 
> I think this is likely a GtkFileChooser bug, not a GtkComboBox bug.

I had a quick look at this before going to bed.  Setting the path will
update the shortcuts model which results in the combo being set, which
then triggers a changed path event...

The following patch is a quick fix to ignore changes when we are
updating the list.  With it (and Owen's GtkComboBox patch) applied, SAVE
mode seems to work as expected.

Thanks,
-Jonathan

Index: gtkfilechooserdefault.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfilechooserdefault.c,v
retrieving revision 1.98
diff -u -p -r1.98 gtkfilechooserdefault.c
--- gtkfilechooserdefault.c     2 Mar 2004 05:27:51 -0000       1.98
+++ gtkfilechooserdefault.c     2 Mar 2004 08:15:12 -0000
@@ -2852,10 +2854,14 @@ gtk_file_chooser_default_set_current_fol
   /* Create a new list model */
   set_list_model (impl);
  
-  /* Refresh controls */
-
-  shortcuts_unselect_all (impl);
-  shortcuts_update_current_folder (impl);
+  if (!impl->changing_folder)
+    {
+      impl->changing_folder = TRUE;
+      /* Refresh controls */
+      shortcuts_unselect_all (impl);
+      shortcuts_update_current_folder (impl);
+      impl->changing_folder = FALSE;
+    }
  
   g_signal_emit_by_name (impl, "current-folder-changed", 0);
  
@@ -3609,6 +3615,9 @@ shortcuts_activate_item (GtkFileChooserD
       || item_num == shortcuts_get_index (impl,
       SHORTCUTS_CURRENT_FOLDER_SEPARATOR))
     return;
  
+  if (impl->changing_folder)
+    return;
+
   path = gtk_tree_path_new_from_indices (item_num, -1);
   result = gtk_tree_model_get_iter (GTK_TREE_MODEL
   (impl->shortcuts_model), &iter, path);
   gtk_tree_path_free (path);


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