[gtk+] bgo#625416 - Don't reload the filechooser's folder during a re-map event
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] bgo#625416 - Don't reload the filechooser's folder during a re-map event
- Date: Tue, 10 Aug 2010 16:39:18 +0000 (UTC)
commit 3a1ba3bd1ed261c8ea964f1dfcdfd29acbc477f8
Author: Federico Mena Quintero <federico novell com>
Date: Tue Aug 10 11:36:03 2010 -0500
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>
gtk/gtkfilechooserdefault.c | 13 -------------
gtk/gtkfilechooserprivate.h | 3 +--
gtk/tests/filechooser.c | 1 -
3 files changed, 1 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 9100ea6..a4fb204 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -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
diff --git a/gtk/gtkfilechooserprivate.h b/gtk/gtkfilechooserprivate.h
index 9f02b42..a3ccaae 100644
--- a/gtk/gtkfilechooserprivate.h
+++ b/gtk/gtkfilechooserprivate.h
@@ -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 {
diff --git a/gtk/tests/filechooser.c b/gtk/tests/filechooser.c
index 424436c..3d82eef 100644
--- a/gtk/tests/filechooser.c
+++ b/gtk/tests/filechooser.c
@@ -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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]