diff options
| author | Matthias Clasen <mclasen@redhat.com> | 2022-10-12 07:44:45 -0400 |
|---|---|---|
| committer | Matthias Clasen <mclasen@redhat.com> | 2022-10-20 22:34:40 -0400 |
| commit | 278bcf2680d714be837c1e7c8d5ba37ee868149e (patch) | |
| tree | 9f2c1548afe83d31fcde520d0c06d90682605f9b | |
| parent | c19d0dc9ea3edab5373d48859b327cb05352cc02 (diff) | |
| download | gtk+-278bcf2680d714be837c1e7c8d5ba37ee868149e.tar.gz | |
filechooserentry: Simplify model construction
Don't pass a get_value callback when creating the
filesystem model. It isn't called anymore, and things
continue to work.
| -rw-r--r-- | gtk/gtkfilechooserentry.c | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index e70dbd26da..b17eb9fa9d 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -553,45 +553,6 @@ discard_completion_store (GtkFileChooserEntry *chooser_entry) g_clear_object (&chooser_entry->model); } -static gboolean -completion_store_set (GtkFileSystemModel *model, - GFile *file, - GFileInfo *info, - int column, - GValue *value, - gpointer data) -{ - GtkFileChooserEntry *chooser_entry = data; - - const char *prefix = ""; - const char *suffix = ""; - - switch (column) - { - case FILE_INFO_COLUMN: - g_value_set_object (value, info); - break; - case FULL_PATH_COLUMN: - prefix = chooser_entry->dir_part; - G_GNUC_FALLTHROUGH; - case DISPLAY_NAME_COLUMN: - if (_gtk_file_info_consider_as_directory (info)) - suffix = G_DIR_SEPARATOR_S; - - g_value_take_string (value, - g_strconcat (prefix, - g_file_info_get_display_name (info), - suffix, - NULL)); - break; - default: - g_assert_not_reached (); - break; - } - - return TRUE; -} - static void model_items_changed_cb (GListModel *model, guint position, @@ -656,8 +617,8 @@ 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", - completion_store_set, - chooser_entry, + NULL, + NULL, N_COLUMNS, G_TYPE_FILE_INFO, G_TYPE_STRING, |
