Commit ed30bc0c authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Federico Mena Quintero

Merged from gtk-2-6:

2005-01-24  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-6:

	Fix #147785 and clean up the loading code:

	* gtk/gtkfilechooserdefault.c (LoadState): Make the set of states
	be EMPTY, PRELOAD, LOADING, FINISHED.
	(gtk_file_chooser_default_init): Start in the LOAD_EMPTY state.
	(struct _GtkFileChooserDefault): Added a pending_select_paths
	field.
	(load_remove_timer): Add the new states.
	(load_setup_timer): Likewise.
	(load_timeout_cb): Likewise.  Switch to the LOAD_LOADING state.
	(browse_files_model_finished_loading_cb): Switch to the
	LOAD_FINISHED state.
	(enum PendingOp): Removed.
	(struct _GtkFileChooserDefault): Removed the pending_op and
	pending_select_path fields.
	(pending_select_paths_free): New utility function.
	(pending_select_paths_add): New utility function.
	(gtk_file_chooser_default_finalize): Call
	pending_select_paths_free().
	(pending_op_queue): Removed.
	(pending_op_process): Removed.
	(pending_select_paths_process): New function.
	(browse_files_model_finished_loading_cb): Call
	pending_select_paths_process().
	(center_selected_row_foreach_cb): Handle multiple selection by
	only centering the first row.
	(get_is_file_filtered): Constify.
	(gtk_file_chooser_default_select_path): Queue into a list of paths
	to select if we are not finished loading.
	(show_and_select_paths): New utility function.
	(up_folder_handler): Use pending_select_paths_add().
	(gtk_file_chooser_default_should_respond): Do not call
	pending_op_queue(); free the pending_selected_paths instead.
	(gtk_file_chooser_default_initial_focus): Don't queue a pending
	operation, and don't select the first row unconditionally --- this
	will happen when the folder is done loading.
	(shortcuts_row_activated_cb): Free the pending_select_paths.
	(pending_select_paths_store_selection): New utility function.
	(gtk_file_chooser_default_map): Call
	pending_select_paths_store_selection() to save the selection
	before reloading the folder.
	(select_func): Umm?  Call gtk_tree_selection_select_iter().  Don't
	move the cursor here; it will be done when processing the pending paths.

	* tests/testfilechooser.c (main): Add a button to the command
	window to unmap and remap the file chooser.
parent a57035d9
2005-01-24 Federico Mena Quintero <federico@ximian.com>
Merged from gtk-2-6:
Fix #147785 and clean up the loading code:
* gtk/gtkfilechooserdefault.c (LoadState): Make the set of states
be EMPTY, PRELOAD, LOADING, FINISHED.
(gtk_file_chooser_default_init): Start in the LOAD_EMPTY state.
(struct _GtkFileChooserDefault): Added a pending_select_paths
field.
(load_remove_timer): Add the new states.
(load_setup_timer): Likewise.
(load_timeout_cb): Likewise. Switch to the LOAD_LOADING state.
(browse_files_model_finished_loading_cb): Switch to the
LOAD_FINISHED state.
(enum PendingOp): Removed.
(struct _GtkFileChooserDefault): Removed the pending_op and
pending_select_path fields.
(pending_select_paths_free): New utility function.
(pending_select_paths_add): New utility function.
(gtk_file_chooser_default_finalize): Call
pending_select_paths_free().
(pending_op_queue): Removed.
(pending_op_process): Removed.
(pending_select_paths_process): New function.
(browse_files_model_finished_loading_cb): Call
pending_select_paths_process().
(center_selected_row_foreach_cb): Handle multiple selection by
only centering the first row.
(get_is_file_filtered): Constify.
(gtk_file_chooser_default_select_path): Queue into a list of paths
to select if we are not finished loading.
(show_and_select_paths): New utility function.
(up_folder_handler): Use pending_select_paths_add().
(gtk_file_chooser_default_should_respond): Do not call
pending_op_queue(); free the pending_selected_paths instead.
(gtk_file_chooser_default_initial_focus): Don't queue a pending
operation, and don't select the first row unconditionally --- this
will happen when the folder is done loading.
(shortcuts_row_activated_cb): Free the pending_select_paths.
(pending_select_paths_store_selection): New utility function.
(gtk_file_chooser_default_map): Call
pending_select_paths_store_selection() to save the selection
before reloading the folder.
(select_func): Umm? Call gtk_tree_selection_select_iter(). Don't
move the cursor here; it will be done when processing the pending paths.
* tests/testfilechooser.c (main): Add a button to the command
window to unmap and remap the file chooser.
2005-01-24 Matthias Clasen <mclasen@redhat.com> 2005-01-24 Matthias Clasen <mclasen@redhat.com>
* docs/tutorial/gtk-tut.sgml: * docs/tutorial/gtk-tut.sgml:
......
2005-01-24 Federico Mena Quintero <federico@ximian.com>
Merged from gtk-2-6:
Fix #147785 and clean up the loading code:
* gtk/gtkfilechooserdefault.c (LoadState): Make the set of states
be EMPTY, PRELOAD, LOADING, FINISHED.
(gtk_file_chooser_default_init): Start in the LOAD_EMPTY state.
(struct _GtkFileChooserDefault): Added a pending_select_paths
field.
(load_remove_timer): Add the new states.
(load_setup_timer): Likewise.
(load_timeout_cb): Likewise. Switch to the LOAD_LOADING state.
(browse_files_model_finished_loading_cb): Switch to the
LOAD_FINISHED state.
(enum PendingOp): Removed.
(struct _GtkFileChooserDefault): Removed the pending_op and
pending_select_path fields.
(pending_select_paths_free): New utility function.
(pending_select_paths_add): New utility function.
(gtk_file_chooser_default_finalize): Call
pending_select_paths_free().
(pending_op_queue): Removed.
(pending_op_process): Removed.
(pending_select_paths_process): New function.
(browse_files_model_finished_loading_cb): Call
pending_select_paths_process().
(center_selected_row_foreach_cb): Handle multiple selection by
only centering the first row.
(get_is_file_filtered): Constify.
(gtk_file_chooser_default_select_path): Queue into a list of paths
to select if we are not finished loading.
(show_and_select_paths): New utility function.
(up_folder_handler): Use pending_select_paths_add().
(gtk_file_chooser_default_should_respond): Do not call
pending_op_queue(); free the pending_selected_paths instead.
(gtk_file_chooser_default_initial_focus): Don't queue a pending
operation, and don't select the first row unconditionally --- this
will happen when the folder is done loading.
(shortcuts_row_activated_cb): Free the pending_select_paths.
(pending_select_paths_store_selection): New utility function.
(gtk_file_chooser_default_map): Call
pending_select_paths_store_selection() to save the selection
before reloading the folder.
(select_func): Umm? Call gtk_tree_selection_select_iter(). Don't
move the cursor here; it will be done when processing the pending paths.
* tests/testfilechooser.c (main): Add a button to the command
window to unmap and remap the file chooser.
2005-01-24 Matthias Clasen <mclasen@redhat.com> 2005-01-24 Matthias Clasen <mclasen@redhat.com>
* docs/tutorial/gtk-tut.sgml: * docs/tutorial/gtk-tut.sgml:
......
2005-01-24 Federico Mena Quintero <federico@ximian.com>
Merged from gtk-2-6:
Fix #147785 and clean up the loading code:
* gtk/gtkfilechooserdefault.c (LoadState): Make the set of states
be EMPTY, PRELOAD, LOADING, FINISHED.
(gtk_file_chooser_default_init): Start in the LOAD_EMPTY state.
(struct _GtkFileChooserDefault): Added a pending_select_paths
field.
(load_remove_timer): Add the new states.
(load_setup_timer): Likewise.
(load_timeout_cb): Likewise. Switch to the LOAD_LOADING state.
(browse_files_model_finished_loading_cb): Switch to the
LOAD_FINISHED state.
(enum PendingOp): Removed.
(struct _GtkFileChooserDefault): Removed the pending_op and
pending_select_path fields.
(pending_select_paths_free): New utility function.
(pending_select_paths_add): New utility function.
(gtk_file_chooser_default_finalize): Call
pending_select_paths_free().
(pending_op_queue): Removed.
(pending_op_process): Removed.
(pending_select_paths_process): New function.
(browse_files_model_finished_loading_cb): Call
pending_select_paths_process().
(center_selected_row_foreach_cb): Handle multiple selection by
only centering the first row.
(get_is_file_filtered): Constify.
(gtk_file_chooser_default_select_path): Queue into a list of paths
to select if we are not finished loading.
(show_and_select_paths): New utility function.
(up_folder_handler): Use pending_select_paths_add().
(gtk_file_chooser_default_should_respond): Do not call
pending_op_queue(); free the pending_selected_paths instead.
(gtk_file_chooser_default_initial_focus): Don't queue a pending
operation, and don't select the first row unconditionally --- this
will happen when the folder is done loading.
(shortcuts_row_activated_cb): Free the pending_select_paths.
(pending_select_paths_store_selection): New utility function.
(gtk_file_chooser_default_map): Call
pending_select_paths_store_selection() to save the selection
before reloading the folder.
(select_func): Umm? Call gtk_tree_selection_select_iter(). Don't
move the cursor here; it will be done when processing the pending paths.
* tests/testfilechooser.c (main): Add a button to the command
window to unmap and remap the file chooser.
2005-01-24 Matthias Clasen <mclasen@redhat.com> 2005-01-24 Matthias Clasen <mclasen@redhat.com>
* docs/tutorial/gtk-tut.sgml: * docs/tutorial/gtk-tut.sgml:
......
...@@ -85,8 +85,10 @@ typedef struct _GtkFileChooserDefaultClass GtkFileChooserDefaultClass; ...@@ -85,8 +85,10 @@ typedef struct _GtkFileChooserDefaultClass GtkFileChooserDefaultClass;
#define GTK_FILE_CHOOSER_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FILE_CHOOSER_DEFAULT, GtkFileChooserDefaultClass)) #define GTK_FILE_CHOOSER_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FILE_CHOOSER_DEFAULT, GtkFileChooserDefaultClass))
typedef enum { typedef enum {
LOAD_LOADING, LOAD_EMPTY, /* There is no model */
LOAD_FINISHED LOAD_PRELOAD, /* Model is loading and a timer is running; model isn't inserted into the tree yet */
LOAD_LOADING, /* Timeout expired, model is inserted into the tree, but not fully loaded yet */
LOAD_FINISHED /* Model is fully loaded and inserted into the tree */
} LoadState; } LoadState;
#define MAX_LOADING_TIME 500 #define MAX_LOADING_TIME 500
...@@ -96,12 +98,6 @@ struct _GtkFileChooserDefaultClass ...@@ -96,12 +98,6 @@ struct _GtkFileChooserDefaultClass
GtkVBoxClass parent_class; GtkVBoxClass parent_class;
}; };
typedef enum {
PENDING_OP_NONE,
PENDING_OP_SELECT_PATH,
PENDING_OP_SELECT_FIRST
} PendingOp;
struct _GtkFileChooserDefault struct _GtkFileChooserDefault
{ {
GtkVBox parent_instance; GtkVBox parent_instance;
...@@ -148,8 +144,7 @@ struct _GtkFileChooserDefault ...@@ -148,8 +144,7 @@ struct _GtkFileChooserDefault
LoadState load_state; LoadState load_state;
guint load_timeout_id; guint load_timeout_id;
PendingOp pending_op; GSList *pending_select_paths;
GtkFilePath *pending_select_path;
GtkFileFilter *current_filter; GtkFileFilter *current_filter;
GSList *filters; GSList *filters;
...@@ -668,9 +663,8 @@ gtk_file_chooser_default_init (GtkFileChooserDefault *impl) ...@@ -668,9 +663,8 @@ gtk_file_chooser_default_init (GtkFileChooserDefault *impl)
impl->select_multiple = FALSE; impl->select_multiple = FALSE;
impl->show_hidden = FALSE; impl->show_hidden = FALSE;
impl->icon_size = FALLBACK_ICON_SIZE; impl->icon_size = FALLBACK_ICON_SIZE;
impl->load_state = LOAD_FINISHED; impl->load_state = LOAD_EMPTY;
impl->pending_op = PENDING_OP_NONE; impl->pending_select_paths = NULL;
impl->pending_select_path = NULL;
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (impl), TRUE); gtk_widget_set_redraw_on_allocate (GTK_WIDGET (impl), TRUE);
gtk_box_set_spacing (GTK_BOX (impl), 12); gtk_box_set_spacing (GTK_BOX (impl), 12);
...@@ -731,6 +725,61 @@ shortcuts_free (GtkFileChooserDefault *impl) ...@@ -731,6 +725,61 @@ shortcuts_free (GtkFileChooserDefault *impl)
impl->shortcuts_model = NULL; impl->shortcuts_model = NULL;
} }
static void
pending_select_paths_free (GtkFileChooserDefault *impl)
{
GSList *l;
for (l = impl->pending_select_paths; l; l = l->next)
{
GtkFilePath *path;
path = l->data;
gtk_file_path_free (path);
}
g_slist_free (impl->pending_select_paths);
impl->pending_select_paths = NULL;
}
static void
pending_select_paths_add (GtkFileChooserDefault *impl,
const GtkFilePath *path)
{
impl->pending_select_paths = g_slist_prepend (impl->pending_select_paths, gtk_file_path_copy (path));
}
/* Used from gtk_tree_selection_selected_foreach() */
static void
store_selection_foreach (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
{
GtkFileChooserDefault *impl;
GtkTreeIter child_iter;
const GtkFilePath *file_path;
impl = GTK_FILE_CHOOSER_DEFAULT (data);
gtk_tree_model_sort_convert_iter_to_child_iter (impl->sort_model, &child_iter, iter);
file_path = _gtk_file_system_model_get_path (impl->browse_files_model, &child_iter);
pending_select_paths_add (impl, file_path);
}
/* Stores the current selection in the list of paths to select; this is used to
* preserve the selection when reloading the current folder.
*/
static void
pending_select_paths_store_selection (GtkFileChooserDefault *impl)
{
GtkTreeSelection *selection;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_files_tree_view));
gtk_tree_selection_selected_foreach (selection, store_selection_foreach, impl);
}
static void static void
gtk_file_chooser_default_finalize (GObject *object) gtk_file_chooser_default_finalize (GObject *object)
{ {
...@@ -769,11 +818,7 @@ gtk_file_chooser_default_finalize (GObject *object) ...@@ -769,11 +818,7 @@ gtk_file_chooser_default_finalize (GObject *object)
if (impl->preview_path) if (impl->preview_path)
gtk_file_path_free (impl->preview_path); gtk_file_path_free (impl->preview_path);
if (impl->pending_op == PENDING_OP_SELECT_PATH) pending_select_paths_free (impl);
{
g_assert (impl->pending_select_path != NULL);
gtk_file_path_free (impl->pending_select_path);
}
load_remove_timer (impl); load_remove_timer (impl);
...@@ -4097,7 +4142,7 @@ gtk_file_chooser_default_screen_changed (GtkWidget *widget, ...@@ -4097,7 +4142,7 @@ gtk_file_chooser_default_screen_changed (GtkWidget *widget,
static gboolean static gboolean
get_is_file_filtered (GtkFileChooserDefault *impl, get_is_file_filtered (GtkFileChooserDefault *impl,
GtkFilePath *path, const GtkFilePath *path,
GtkFileInfo *file_info) GtkFileInfo *file_info)
{ {
GtkFileFilterInfo filter_info; GtkFileFilterInfo filter_info;
...@@ -4153,7 +4198,10 @@ gtk_file_chooser_default_map (GtkWidget *widget) ...@@ -4153,7 +4198,10 @@ gtk_file_chooser_default_map (GtkWidget *widget)
GTK_WIDGET_CLASS (parent_class)->map (widget); GTK_WIDGET_CLASS (parent_class)->map (widget);
if (impl->current_folder) if (impl->current_folder)
change_folder_and_display_error (impl, impl->current_folder); {
pending_select_paths_store_selection (impl);
change_folder_and_display_error (impl, impl->current_folder);
}
bookmarks_changed_cb (impl->file_system, impl); bookmarks_changed_cb (impl->file_system, impl);
} }
...@@ -4337,12 +4385,12 @@ load_timeout_cb (gpointer data) ...@@ -4337,12 +4385,12 @@ load_timeout_cb (gpointer data)
GDK_THREADS_ENTER (); GDK_THREADS_ENTER ();
impl = GTK_FILE_CHOOSER_DEFAULT (data); impl = GTK_FILE_CHOOSER_DEFAULT (data);
g_assert (impl->load_state == LOAD_LOADING); g_assert (impl->load_state == LOAD_PRELOAD);
g_assert (impl->load_timeout_id != 0); g_assert (impl->load_timeout_id != 0);
g_assert (impl->browse_files_model != NULL); g_assert (impl->browse_files_model != NULL);
impl->load_timeout_id = 0; impl->load_timeout_id = 0;
impl->load_state = LOAD_FINISHED; impl->load_state = LOAD_LOADING;
load_set_model (impl); load_set_model (impl);
...@@ -4356,10 +4404,10 @@ static void ...@@ -4356,10 +4404,10 @@ static void
load_setup_timer (GtkFileChooserDefault *impl) load_setup_timer (GtkFileChooserDefault *impl)
{ {
g_assert (impl->load_timeout_id == 0); g_assert (impl->load_timeout_id == 0);
g_assert (impl->load_state == LOAD_FINISHED); g_assert (impl->load_state != LOAD_PRELOAD);
impl->load_timeout_id = g_timeout_add (MAX_LOADING_TIME, load_timeout_cb, impl); impl->load_timeout_id = g_timeout_add (MAX_LOADING_TIME, load_timeout_cb, impl);
impl->load_state = LOAD_LOADING; impl->load_state = LOAD_PRELOAD;
} }
/* Removes the load timeout and switches to the LOAD_FINISHED state */ /* Removes the load timeout and switches to the LOAD_FINISHED state */
...@@ -4368,44 +4416,16 @@ load_remove_timer (GtkFileChooserDefault *impl) ...@@ -4368,44 +4416,16 @@ load_remove_timer (GtkFileChooserDefault *impl)
{ {
if (impl->load_timeout_id != 0) if (impl->load_timeout_id != 0)
{ {
g_assert (impl->load_state == LOAD_LOADING); g_assert (impl->load_state == LOAD_PRELOAD);
g_source_remove (impl->load_timeout_id); g_source_remove (impl->load_timeout_id);
impl->load_timeout_id = 0; impl->load_timeout_id = 0;
impl->load_state = LOAD_FINISHED; impl->load_state = LOAD_EMPTY;
} }
else else
g_assert (impl->load_state == LOAD_FINISHED); g_assert (impl->load_state == LOAD_EMPTY ||
} impl->load_state == LOAD_LOADING ||
impl->load_state == LOAD_FINISHED);
/* Queues a pending operation relative to selecting a file when the current
* folder finishes loading.
*/
static void
pending_op_queue (GtkFileChooserDefault *impl, PendingOp op, const GtkFilePath *path)
{
if (impl->pending_op == PENDING_OP_SELECT_PATH)
{
g_assert (impl->pending_select_path != NULL);
gtk_file_path_free (impl->pending_select_path);
impl->pending_select_path = NULL;
}
if (op == PENDING_OP_SELECT_FIRST &&
(impl->action == GTK_FILE_CHOOSER_ACTION_SAVE || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
{
impl->pending_op = PENDING_OP_NONE;
return;
}
impl->pending_op = op;
if (impl->pending_op == PENDING_OP_SELECT_PATH)
{
g_assert (path != NULL);
impl->pending_select_path = gtk_file_path_copy (path);
}
} }
/* Selects the first row in the file list */ /* Selects the first row in the file list */
...@@ -4422,6 +4442,11 @@ browse_files_select_first_row (GtkFileChooserDefault *impl) ...@@ -4422,6 +4442,11 @@ browse_files_select_first_row (GtkFileChooserDefault *impl)
gtk_tree_path_free (path); gtk_tree_path_free (path);
} }
struct center_selected_row_closure {
GtkFileChooserDefault *impl;
gboolean already_centered;
};
/* Callback used from gtk_tree_selection_selected_foreach(); centers the /* Callback used from gtk_tree_selection_selected_foreach(); centers the
* selected row in the tree view. * selected row in the tree view.
*/ */
...@@ -4431,52 +4456,145 @@ center_selected_row_foreach_cb (GtkTreeModel *model, ...@@ -4431,52 +4456,145 @@ center_selected_row_foreach_cb (GtkTreeModel *model,
GtkTreeIter *iter, GtkTreeIter *iter,
gpointer data) gpointer data)
{ {
GtkFileChooserDefault *impl; struct center_selected_row_closure *closure;
impl = GTK_FILE_CHOOSER_DEFAULT (data); closure = data;
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (impl->browse_files_tree_view), path, NULL, TRUE, 0.5, 0.0); if (closure->already_centered)
return;
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (closure->impl->browse_files_tree_view), path, NULL, TRUE, 0.5, 0.0);
closure->already_centered = TRUE;
} }
/* Centers the selected row in the tree view */ /* Centers the selected row in the tree view */
static void static void
browse_files_center_selected_row (GtkFileChooserDefault *impl) browse_files_center_selected_row (GtkFileChooserDefault *impl)
{ {
struct center_selected_row_closure closure;
GtkTreeSelection *selection; GtkTreeSelection *selection;
closure.impl = impl;
closure.already_centered = FALSE;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_files_tree_view)); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_files_tree_view));
gtk_tree_selection_selected_foreach (selection, center_selected_row_foreach_cb, impl); gtk_tree_selection_selected_foreach (selection, center_selected_row_foreach_cb, &closure);
} }
/* Processes the pending operation when a folder is finished loading */ static gboolean
static void show_and_select_paths (GtkFileChooserDefault *impl,
pending_op_process (GtkFileChooserDefault *impl) const GtkFilePath *parent_path,
const GtkFilePath *only_one_path,
GSList *paths,
GError **error)
{ {
switch (impl->pending_op) GtkFileFolder *folder;
gboolean success;
gboolean have_hidden;
gboolean have_filtered;
if (!only_one_path && !paths)
return TRUE;
folder = gtk_file_system_get_folder (impl->file_system, parent_path, GTK_FILE_INFO_IS_HIDDEN, error);
if (!folder)
return FALSE;
success = FALSE;
have_hidden = FALSE;
have_filtered = FALSE;
if (only_one_path)
{ {
case PENDING_OP_NONE: GtkFileInfo *info;
break;
case PENDING_OP_SELECT_PATH: info = gtk_file_folder_get_info (folder, only_one_path, error);
g_assert (impl->pending_select_path != NULL); if (info)
{
success = TRUE;
have_hidden = gtk_file_info_get_is_hidden (info);
have_filtered = get_is_file_filtered (impl, only_one_path, info);
gtk_file_info_free (info);
}
}
else
{
GSList *l;
_gtk_file_system_model_path_do (impl->browse_files_model, impl->pending_select_path, select_func, impl); for (l = paths; l; l = l->next)
gtk_file_path_free (impl->pending_select_path); {
impl->pending_select_path = NULL; const GtkFilePath *path;
impl->pending_op = PENDING_OP_NONE; GtkFileInfo *info;
browse_files_center_selected_row (impl);
break;
case PENDING_OP_SELECT_FIRST: path = l->data;
browse_files_select_first_row (impl);
impl->pending_op = PENDING_OP_NONE;
break;
default: /* NULL GError */
g_assert_not_reached (); info = gtk_file_folder_get_info (folder, path, NULL);
if (info)
{
if (!have_hidden)
have_hidden = gtk_file_info_get_is_hidden (info);
if (!have_filtered)
have_filtered = get_is_file_filtered (impl, path, info);
gtk_file_info_free (info);
if (have_hidden && have_filtered)
break; /* we now have all the information we need */
}
}
success = TRUE;
} }
g_assert (impl->pending_op == PENDING_OP_NONE); g_object_unref (folder);
g_assert (impl->pending_select_path == NULL);
if (!success)
return FALSE;
if (have_hidden)
g_object_set (impl, "show-hidden", TRUE, NULL);
if (have_filtered)
set_current_filter (impl, NULL);
if (only_one_path)
_gtk_file_system_model_path_do (impl->browse_files_model, only_one_path, select_func, impl);
else
{
GSList *l;
for (l = paths; l; l = l->next)
{
const GtkFilePath *path;
path = l->data;
_gtk_file_system_model_path_do (impl->browse_files_model, path, select_func, impl);
}
}
return TRUE;
}
/* Processes the pending operation when a folder is finished loading */
static void
pending_select_paths_process (GtkFileChooserDefault *impl)
{
g_assert (impl->load_state == LOAD_FINISHED);
g_assert (impl->browse_files_model != NULL);
g_assert (impl->sort_model != NULL);