summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserwidget.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2005-09-27 23:57:09 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2005-09-27 23:57:09 +0000
commit72851a22cd6f85f2215f2ed80c83463af593bf17 (patch)
tree26ed729239d5458a04ee02c556e5eea0675b586a /gtk/gtkfilechooserwidget.c
parent58a2a796823a5e54cbf89762a603cdf12d7a5eed (diff)
downloadgtk+-72851a22cd6f85f2215f2ed80c83463af593bf17.tar.gz
Don't reload the current folder unnecessarily on ::map().
2005-09-27 Federico Mena Quintero <federico@ximian.com> Don't reload the current folder unnecessarily on ::map(). * gtk/gtkfilechooserprivate.h (ReloadState): New enum to represent the reloading state. (struct _GtkFileChooserDefault): Added a "reload_state" field. * gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_init): Initialize impl->reload_state. (gtk_file_chooser_default_map): Check the impl->reload_state; load a default folder if no folder has been set, or reload the current one only if we had been unmapped first. (gtk_file_chooser_default_update_current_folder): Set the reload_state to RELOAD_HAS_FOLDER. (gtk_file_chooser_default_unmap): Implement, and set the reload_state to RELOAD_WAS_UNMAPPED. (shortcuts_model_create): Don't call shortcuts_add_bookmarks() here; they'll get (re)loaded on ::map() anyway. * gtk/gtkfilechooserwidget.c (gtk_file_chooser_widget_constructor): Don't set a default folder here. * tests/autotestfilechooser.c (test_action_widgets): Don't take in a dialog; build it ourselves. (test_reload): New test to ensure that we don't load the default folder more than once, and that we reload it when unmapping/remapping. (get_impl_from_dialog): New utility function. (test_widgets_for_current_action): Use get_impl_from_dialog().
Diffstat (limited to 'gtk/gtkfilechooserwidget.c')
-rw-r--r--gtk/gtkfilechooserwidget.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index c065f67f65..fa4e3f2d71 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -139,7 +139,6 @@ gtk_file_chooser_widget_constructor (GType type,
{
GtkFileChooserWidgetPrivate *priv;
GObject *object;
- gchar *current_folder;
object = parent_class->constructor (type,
n_construct_properties,
@@ -153,10 +152,6 @@ gtk_file_chooser_widget_constructor (GType type,
gtk_box_pack_start (GTK_BOX (object), priv->impl, TRUE, TRUE, 0);
gtk_widget_show (priv->impl);
- current_folder = g_get_current_dir ();
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (priv->impl), current_folder);
- g_free (current_folder);
-
_gtk_file_chooser_set_delegate (GTK_FILE_CHOOSER (object),
GTK_FILE_CHOOSER (priv->impl));