[gtk/gbsneto/filechooser-column-view: 151/161] filesystemmodel: Drop unused arguments
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gbsneto/filechooser-column-view: 151/161] filesystemmodel: Drop unused arguments
- Date: Thu, 20 Oct 2022 19:22:28 +0000 (UTC)
commit 123a379cd659fe883f63a59bddd622f548948b52
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Oct 12 07:54:00 2022 -0400
filesystemmodel: Drop unused arguments
Drop the unused get_func arguments in constructors.
Update all callers.
gtk/gtkfilechooserentry.c | 2 --
gtk/gtkfilechooserwidget.c | 10 ++--------
gtk/gtkfilesystemmodel.c | 22 ++++------------------
gtk/gtkfilesystemmodel.h | 13 +------------
4 files changed, 7 insertions(+), 40 deletions(-)
---
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 0a1b61c72c..463f4abb52 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -617,8 +617,6 @@ populate_completion_store (GtkFileChooserEntry *chooser_entry)
_gtk_file_system_model_new_for_directory (chooser_entry->current_folder_file,
"standard::name,standard::display-name,standard::type,"
"standard::content-type",
- NULL,
- NULL,
N_COLUMNS,
G_TYPE_FILE_INFO,
G_TYPE_STRING,
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index e4f10529d4..39ad6d576b 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -4063,8 +4063,6 @@ set_list_model (GtkFileChooserWidget *impl,
impl->browse_files_model =
_gtk_file_system_model_new_for_directory (impl->current_folder,
MODEL_ATTRIBUTES,
- NULL,
- NULL,
MODEL_COLUMN_TYPES);
_gtk_file_system_model_set_show_hidden (impl->browse_files_model, impl->show_hidden);
@@ -5934,9 +5932,7 @@ search_setup_model (GtkFileChooserWidget *impl)
{
g_assert (impl->search_model == NULL);
- impl->search_model = _gtk_file_system_model_new (NULL,
- NULL,
- MODEL_COLUMN_TYPES);
+ impl->search_model = _gtk_file_system_model_new (MODEL_COLUMN_TYPES);
set_current_model (impl, G_LIST_MODEL (impl->search_model));
update_columns (impl, TRUE, _("Modified"));
@@ -6100,9 +6096,7 @@ recent_start_loading (GtkFileChooserWidget *impl)
/* Setup recent model */
g_assert (impl->recent_model == NULL);
- impl->recent_model = _gtk_file_system_model_new (NULL,
- NULL,
- MODEL_COLUMN_TYPES);
+ impl->recent_model = _gtk_file_system_model_new (MODEL_COLUMN_TYPES);
_gtk_file_system_model_set_filter (impl->recent_model, impl->current_filter);
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index daf1b11060..520040aaa0 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -158,8 +158,6 @@ struct _GtkFileSystemModel
guint n_columns; /* number of columns */
GType * column_types; /* types of each column */
- GtkFileSystemModelGetValue get_func; /* function to call to fill in values in columns */
- gpointer get_data; /* data to pass to get_func */
GtkFileFilter * filter; /* filter to use for deciding which nodes are visible */
@@ -759,16 +757,12 @@ gtk_file_system_model_set_directory (GtkFileSystemModel *model,
}
static GtkFileSystemModel *
-_gtk_file_system_model_new_valist (GtkFileSystemModelGetValue get_func,
- gpointer get_data,
- guint n_columns,
+_gtk_file_system_model_new_valist (guint n_columns,
va_list args)
{
GtkFileSystemModel *model;
model = g_object_new (GTK_TYPE_FILE_SYSTEM_MODEL, NULL);
- model->get_func = get_func;
- model->get_data = get_data;
gtk_file_system_model_set_n_columns (model, n_columns, args);
@@ -777,8 +771,6 @@ _gtk_file_system_model_new_valist (GtkFileSystemModelGetValue get_func,
/**
* _gtk_file_system_model_new:
- * @get_func: function to call for getting a value
- * @get_data: user data argument passed to @get_func
* @n_columns: number of columns
* @...: @n_columns `GType` types for the columns
*
@@ -789,9 +781,7 @@ _gtk_file_system_model_new_valist (GtkFileSystemModelGetValue get_func,
* Returns: the newly created `GtkFileSystemModel`
**/
GtkFileSystemModel *
-_gtk_file_system_model_new (GtkFileSystemModelGetValue get_func,
- gpointer get_data,
- guint n_columns,
+_gtk_file_system_model_new (guint n_columns,
...)
{
GtkFileSystemModel *model;
@@ -800,7 +790,7 @@ _gtk_file_system_model_new (GtkFileSystemModelGetValue get_func,
g_return_val_if_fail (n_columns > 0, NULL);
va_start (args, n_columns);
- model = _gtk_file_system_model_new_valist (get_func, get_data, n_columns, args);
+ model = _gtk_file_system_model_new_valist (n_columns, args);
va_end (args);
return model;
@@ -810,8 +800,6 @@ _gtk_file_system_model_new (GtkFileSystemModelGetValue get_func,
* _gtk_file_system_model_new_for_directory:
* @directory: the directory to show.
* @attributes: (nullable): attributes to immediately load or %NULL for all
- * @get_func: function that the model should call to query data about a file
- * @get_data: user data to pass to the @get_func
* @n_columns: number of columns
* @...: @n_columns `GType` types for the columns
*
@@ -828,8 +816,6 @@ _gtk_file_system_model_new (GtkFileSystemModelGetValue get_func,
GtkFileSystemModel *
_gtk_file_system_model_new_for_directory (GFile * dir,
const char * attributes,
- GtkFileSystemModelGetValue get_func,
- gpointer get_data,
guint n_columns,
...)
{
@@ -840,7 +826,7 @@ _gtk_file_system_model_new_for_directory (GFile * dir,
g_return_val_if_fail (n_columns > 0, NULL);
va_start (args, n_columns);
- model = _gtk_file_system_model_new_valist (get_func, get_data, n_columns, args);
+ model = _gtk_file_system_model_new_valist (n_columns, args);
va_end (args);
gtk_file_system_model_set_directory (model, dir, attributes);
diff --git a/gtk/gtkfilesystemmodel.h b/gtk/gtkfilesystemmodel.h
index 280ca21c3b..e85cf641cd 100644
--- a/gtk/gtkfilesystemmodel.h
+++ b/gtk/gtkfilesystemmodel.h
@@ -32,21 +32,10 @@ typedef struct _GtkFileSystemModel GtkFileSystemModel;
GType _gtk_file_system_model_get_type (void) G_GNUC_CONST;
-typedef gboolean (*GtkFileSystemModelGetValue) (GtkFileSystemModel *model,
- GFile *file,
- GFileInfo *info,
- int column,
- GValue *value,
- gpointer user_data);
-
-GtkFileSystemModel *_gtk_file_system_model_new (GtkFileSystemModelGetValue get_func,
- gpointer get_data,
- guint n_columns,
+GtkFileSystemModel *_gtk_file_system_model_new (guint n_columns,
...);
GtkFileSystemModel *_gtk_file_system_model_new_for_directory(GFile * dir,
const char * attributes,
- GtkFileSystemModelGetValue get_func,
- gpointer get_data,
guint n_columns,
...);
GFile * _gtk_file_system_model_get_directory (GtkFileSystemModel *model);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]