[gtk/wip/otte/for-master] filechooserwidget: Use gtk_drop_down_get_selected_item
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/for-master] filechooserwidget: Use gtk_drop_down_get_selected_item
- Date: Sun, 21 Jun 2020 05:21:58 +0000 (UTC)
commit 62b214ffdfdf864fcc60e686689637d871eb89d6
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jun 21 01:20:05 2020 -0400
filechooserwidget: Use gtk_drop_down_get_selected_item
This showed up as a test failure when we get NULL as
selected item and then try to unref it. Luckily
get_selected_item is transfer none, so we don't have
to worry about it.
gtk/gtkfilechooserwidget.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 064846c955..94eb40c05d 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -6929,17 +6929,13 @@ filter_combo_changed (GtkDropDown *dropdown,
GParamSpec *pspec,
GtkFileChooserWidget *impl)
{
- gint new_index;
GtkFileFilter *new_filter;
- new_index = gtk_drop_down_get_selected (dropdown);
- new_filter = g_list_model_get_item (G_LIST_MODEL (impl->filters), new_index);
- set_current_filter (impl, new_filter);
+ new_filter = gtk_drop_down_get_selected_item (dropdown);
if (impl->location_entry != NULL)
_gtk_file_chooser_entry_set_file_filter (GTK_FILE_CHOOSER_ENTRY (impl->location_entry),
new_filter);
- g_object_unref (new_filter);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]