From: Luca Bacci Date: Sun, 1 May 2022 14:31:47 +0000 (+0200) Subject: GtkFileChooserWidget: check for empty instead of NULL GListModel X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bf8f20cfe24357b49ae5916b910411cd9e40a255;p=gtk4.git GtkFileChooserWidget: check for empty instead of NULL GListModel While porting GtkFileChooserWidget from GList to GListModel we did not change some checks for NULL to checks for empty list. Bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/4851 Bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/4858 Origin: upstream, 4.6.4, commit:6b740c86f907e171d5bec227677ccf81b0091d73 Gbp-Pq: Name GtkFileChooserWidget-check-for-empty-instead-of-NULL-GLis.patch --- diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index be084da421..4c34c49840 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -5448,7 +5448,7 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser) * So we want the selection to be "bar/foo.txt". Jump to the case for the * filename entry to see if that is the case. */ - if (info.result == NULL && impl->location_entry) + if (g_list_model_get_n_items (G_LIST_MODEL (info.result)) == 0 && impl->location_entry) goto file_entry; } else if (impl->location_entry && @@ -5497,7 +5497,7 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser) * then we fall back to the current directory */ if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER && - info.result == NULL) + g_list_model_get_n_items (G_LIST_MODEL (info.result)) == 0) { GFile *current_folder;