bgo#625416 - Don't reload the filechooser's folder during a re-map event

Long ago, before we had file monitoring at the GIO/Glib level, we would
reload the current folder each time a file chooser gets (re)mapped.
This was basically to let the GIMP recycle the same file chooser for all
file/open or file/save operations, instead of creating a new one every time.
In that case, we reloaded the folder with each ::map() event so that the
file chooser would present an up-to-date view of the folder that was being
displayed.  Now, the folder should always be up-to-date as we do
file monitoring all the time.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
This commit is contained in:
Federico Mena Quintero 2010-08-10 11:36:03 -05:00
parent 316b9da873
commit 3a1ba3bd1e
3 changed files with 1 additions and 16 deletions

View File

@ -5860,17 +5860,6 @@ gtk_file_chooser_default_map (GtkWidget *widget)
*/
break;
case RELOAD_WAS_UNMAPPED:
/* Just reload the current folder; else continue
* the pending load.
*/
if (impl->current_folder)
{
pending_select_files_store_selection (impl);
change_folder_and_display_error (impl, impl->current_folder, FALSE);
}
break;
default:
g_assert_not_reached ();
}
@ -5894,8 +5883,6 @@ gtk_file_chooser_default_unmap (GtkWidget *widget)
settings_save (impl);
GTK_WIDGET_CLASS (_gtk_file_chooser_default_parent_class)->unmap (widget);
impl->reload_state = RELOAD_WAS_UNMAPPED;
}
static void

View File

@ -138,8 +138,7 @@ typedef enum {
typedef enum {
RELOAD_EMPTY, /* No folder has been set */
RELOAD_HAS_FOLDER, /* We have a folder, although it may not be completely loaded yet; no need to reload */
RELOAD_WAS_UNMAPPED /* We had a folder but got unmapped; reload is needed */
RELOAD_HAS_FOLDER /* We have a folder, although it may not be completely loaded yet; no need to reload */
} ReloadState;
typedef enum {

View File

@ -758,7 +758,6 @@ test_reload_sequence (gboolean set_folder_before_map)
passed = passed && (impl->current_folder != NULL
&& impl->browse_files_model != NULL
&& (impl->load_state == LOAD_PRELOAD || impl->load_state == LOAD_LOADING || impl->load_state == LOAD_FINISHED)
&& impl->reload_state == RELOAD_WAS_UNMAPPED
&& (impl->load_state == LOAD_PRELOAD ? (impl->load_timeout_id != 0) : TRUE)
&& ((impl->load_state == LOAD_LOADING || impl->load_state == LOAD_FINISHED)
? (impl->load_timeout_id == 0 && impl->sort_model != NULL)