projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b740c8
)
GtkFileChooserWidget: return empty GListModel in get_files () instead of NULL
author
Luca Bacci
<luca.bacci982@gmail.com>
Sun, 1 May 2022 14:41:10 +0000
(16:41 +0200)
committer
Luca Bacci
<luca.bacci982@gmail.com>
Tue, 3 May 2022 10:38:22 +0000
(12:38 +0200)
gtk/gtkfilechooserwidget.c
patch
|
blob
|
history
diff --git
a/gtk/gtkfilechooserwidget.c
b/gtk/gtkfilechooserwidget.c
index 4c34c498408fa99fa1f89df59e7bf7ce97a142b0..34e34734d3900fd9bad2b97b8be57d74b137383f 100644
(file)
--- a/
gtk/gtkfilechooserwidget.c
+++ b/
gtk/gtkfilechooserwidget.c
@@
-5466,7
+5466,7
@@
gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
goto out;
if (!is_well_formed)
-
return NULL
;
+
goto empty
;
if (info.file_from_entry)
{
@@
-5476,7
+5476,7
@@
gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
else if (!file_list_seen)
goto file_list;
else
-
return NULL
;
+
goto empty
;
}
else if (impl->toplevel_last_focus_widget == impl->browse_files_tree_view)
goto file_list;
@@
-5508,6
+5508,11
@@
gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
}
return G_LIST_MODEL (info.result);
+
+empty:
+
+ g_list_store_remove_all (info.result);
+ return G_LIST_MODEL (info.result);
}
/* Shows or hides the filter widgets */