file chooser: Remove a wrong assumption
authorMatthias Clasen <mclasen@redhat.com>
Fri, 3 Jul 2015 14:52:39 +0000 (07:52 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 4 Jul 2015 04:29:26 +0000 (00:29 -0400)
The code for getting the selected files was assuming that
we are always in browse mode, and was causing warnings when
hitting Ctrl-L twice, right after opening the file chooser.

The fix is to simple use the model that is passed into the
callback.

gtk/gtkfilechooserwidget.c

index ba65dbf0c0051974361bf2651e87e7dd81ea2466..7ca22825854708bc054f39fe5ee10eca796131ea 100644 (file)
@@ -5320,12 +5320,9 @@ get_files_foreach (GtkTreeModel *model,
                   GtkTreeIter  *iter,
                   gpointer      data)
 {
-  struct get_files_closure *info;
+  GtkFileSystemModel *fs_model = GTK_FILE_SYSTEM_MODEL (model);
+  struct get_files_closure *info = data;
   GFile *file;
-  GtkFileSystemModel *fs_model;
-
-  info = data;
-  fs_model = info->impl->priv->browse_files_model;
 
   file = _gtk_file_system_model_get_file (fs_model, iter);
   if (!file)