Don't reload the current folder unnecessarily on ::map().
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().

Unity-Technologies/gtk,Sidnioulz/SandboxGtk,davidt/gtk,Adamovskiy/gtk,davidgumberg/gtk,grubersjoe/adwaita,grubersjoe/adwaita,alexlarsson/gtk,jadahl/gtk,jessevdk/gtk,jigpu/gtk,jessevdk/gtk,simokivimaki/gtk,msteinert/gtk,Unity-Technologies/gtk,johne53/MB3Gtk-2,bratsche/gtk-,Distrotech/gtk2,bratsche/gtk-,Distrotech/gtk2,jadahl/gtk,davidgumberg/gtk,jigpu/gtk,johne53/MB3Gtk-2,chergert/gtk,chipx86/gtk,zsx/gtk,davidgumberg/gtk,chipx86/gtk,simokivimaki/gtk,ahodesuka/gtk,ahodesuka/gtk,ebassi/gtk,alexlarsson/gtk,msteinert/gtk,ahodesuka/gtk,simokivimaki/gtk,msteinert/gtk,Lyude/gtk-,jigpu/gtk,zsx/gtk,Distrotech/gtk,Lyude/gtk-,Lyude/gtk-,zsx/gtk,Lyude/gtk-,ahodesuka/gtk,ebassi/gtk,chergert/gtk,chergert/gtk,grubersjoe/adwaita,jigpu/gtk,Adamovskiy/gtk,zsx/gtk,Unity-Technologies/gtk,ebassi/gtk,simokivimaki/gtk,Distrotech/gtk2,nacho/gtk-,johne53/MB3Gtk-2,alexlarsson/gtk,Sidnioulz/SandboxGtk,msteinert/gtk,jessevdk/gtk,chergert/gtk,alexlarsson/gtk,davidgumberg/gtk,Distrotech/gtk,Sidnioulz/SandboxGtk,jadahl/gtk,chergert/gtk,simokivimaki/gtk,Distrotech/gtk,jigpu/gtk,chipx86/gtk,Sidnioulz/SandboxGtk,grubersjoe/adwaita,alexlarsson/gtk,johne53/MB3Gtk-2,davidt/gtk,davidgumberg/gtk,chipx86/gtk,Adamovskiy/gtk,Sidnioulz/SandboxGtk,Adamovskiy/gtk,Adamovskiy/gtk,Adamovskiy/gtk,Lyude/gtk-,Adamovskiy/gtk,jessevdk/gtk,jigpu/gtk,johne53/MB3Gtk-2,Distrotech/gtk,ahodesuka/gtk,nacho/gtk-,jadahl/gtk,jigpu/gtk,msteinert/gtk,jessevdk/gtk,davidt/gtk,Distrotech/gtk,alexlarsson/gtk,bratsche/gtk-,chipx86/gtk,jessevdk/gtk,ebassi/gtk,Distrotech/gtk2,chergert/gtk,Lyude/gtk-,davidt/gtk,alexlarsson/gtk,jadahl/gtk,ahodesuka/gtk,grubersjoe/adwaita,Unity-Technologies/gtk,Lyude/gtk-,davidgumberg/gtk,grubersjoe/adwaita,bratsche/gtk-,bratsche/gtk-,nacho/gtk-,jessevdk/gtk,Sidnioulz/SandboxGtk,grubersjoe/adwaita,msteinert/gtk,Adamovskiy/gtk,Distrotech/gtk2,Lyude/gtk-,nacho/gtk-,ahodesuka/gtk,jadahl/gtk,davidt/gtk,grubersjoe/adwaita,davidgumberg/gtk,ebassi/gtk,chergert/gtk,simokivimaki/gtk,alexlarsson/gtk,davidt/gtk,davidgumberg/gtk,ahodesuka/gtk,zsx/gtk,ebassi/gtk,bratsche/gtk-,jadahl/gtk,nacho/gtk-,jigpu/gtk,Unity-Technologies/gtk,chergert/gtk,jadahl/gtk,Distrotech/gtk2