static void recent_clear_model (GtkFileChooserWidget *impl,
gboolean remove_from_treeview);
static gboolean recent_should_respond (GtkFileChooserWidget *impl);
-static void clear_model_cache (GtkFileChooserWidget *impl,
- int column);
static void set_model_filter (GtkFileChooserWidget *impl,
GtkFileFilter *filter);
static void switch_to_home_dir (GtkFileChooserWidget *impl);
impl->sort_order);
}
-static void
-clear_model_cache (GtkFileChooserWidget *impl,
- int column)
-{
- if (impl->browse_files_model)
- _gtk_file_system_model_clear_cache (impl->browse_files_model, column);
-
- if (impl->search_model)
- _gtk_file_system_model_clear_cache (impl->search_model, column);
-
- if (impl->recent_model)
- _gtk_file_system_model_clear_cache (impl->recent_model, column);
-}
-
static void
set_model_filter (GtkFileChooserWidget *impl,
GtkFileFilter *filter)
gtk_drop_down_set_selected (GTK_DROP_DOWN (impl->filter_combo), filter_index);
- clear_model_cache (impl, MODEL_COL_IS_SENSITIVE);
set_model_filter (impl, impl->current_filter);
g_object_notify (G_OBJECT (impl), "filter");
}
}
}
-/**
- * _gtk_file_system_model_clear_cache:
- * @model: a `GtkFileSystemModel`
- * @column: the column to clear or -1 for all columns
- *
- * Clears the cached values in the model for the given @column. Use
- * this function whenever your get_value function would return different
- * values for a column.
- * The file chooser uses this for example when the icon theme changes to
- * invalidate the cached pixbufs.
- **/
-void
-_gtk_file_system_model_clear_cache (GtkFileSystemModel *model,
- int column)
-{
- guint i;
- int start, end;
- gboolean changed;
-
- g_return_if_fail (GTK_IS_FILE_SYSTEM_MODEL (model));
- g_return_if_fail (column >= -1 && (guint) column < model->n_columns);
-
- if (column > -1)
- {
- start = column;
- end = column + 1;
- }
- else
- {
- start = 0;
- end = model->n_columns;
- }
-
- for (i = 0; i < model->files->len; i++)
- {
- FileModelNode *node = get_node (model, i);
- changed = FALSE;
- for (column = start; column < end; column++)
- {
- if (!G_VALUE_TYPE (&node->values[column]))
- continue;
-
- g_value_unset (&node->values[column]);
- changed = TRUE;
- }
-
- if (changed && node->visible)
- emit_row_changed_for_node (model, i);
- }
-
- /* FIXME: resort? */
-}
-
/**
* _gtk_file_system_model_add_and_query_file:
* @model: a `GtkFileSystemModel`
gboolean show_files);
void _gtk_file_system_model_set_filter_folders (GtkFileSystemModel *model,
gboolean show_folders);
-void _gtk_file_system_model_clear_cache (GtkFileSystemModel *model,
- int column);
void _gtk_file_system_model_set_filter (GtkFileSystemModel *model,
GtkFileFilter *filter);