[gtk/gbsneto/filechooser-column-view: 62/74] filechooserentry: Simplify model construction




commit 278bcf2680d714be837c1e7c8d5ba37ee868149e
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Oct 12 07:44:45 2022 -0400

    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.

 gtk/gtkfilechooserentry.c | 43 ++-----------------------------------------
 1 file 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]