[gtk/wip/baedert/for-master: 447/447] filechooserwidget: Avoid an uninitialised value
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 447/447] filechooserwidget: Avoid an uninitialised value
- Date: Fri, 5 Jun 2020 04:28:42 +0000 (UTC)
commit f15614d4064805c614347567d4d637d0c5a1d1be
Author: Timm Bäder <mail baedert org>
Date: Fri Jun 5 06:26:56 2020 +0200
filechooserwidget: Avoid an uninitialised value
For NULL filters, we were never calling g_list_store_find, so leaving
filter_index undefined.
gtk/gtkfilechooserwidget.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index a6b9729ef2..1f153896d0 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -6900,8 +6900,15 @@ set_current_filter (GtkFileChooserWidget *impl,
guint filter_index;
/* NULL filters are allowed to reset to non-filtered status */
- if (filter && !g_list_store_find (impl->filters, filter, &filter_index))
- return;
+ if (filter)
+ {
+ if (!g_list_store_find (impl->filters, filter, &filter_index))
+ return;
+ }
+ else
+ {
+ filter_index = -1;
+ }
if (impl->current_filter)
g_object_unref (impl->current_filter);
@@ -6911,7 +6918,6 @@ set_current_filter (GtkFileChooserWidget *impl,
gtk_drop_down_set_selected (GTK_DROP_DOWN (impl->filter_combo), filter_index);
-g_print ("set current filter %u\n", filter_index);
clear_model_cache (impl, MODEL_COL_IS_SENSITIVE);
set_model_filter (impl, impl->current_filter);
g_object_notify (G_OBJECT (impl), "filter");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]