diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2018-06-20 17:04:22 +1200 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2018-06-20 17:07:08 +1200 |
commit | 67d39e497a4090d2a06935c2b1a1b9c286115429 (patch) | |
tree | 66b2ed1d87e9ebbc9e7b75651a9c6d5f86cc56be | |
parent | 9ae5f9a667f8bc27a1c20338792fc4dfee9c7dbe (diff) | |
download | gnome-control-center-67d39e497a4090d2a06935c2b1a1b9c286115429.tar.gz |
region: Fix language search crash due to g_auto changes in 79e00c3
-rw-r--r-- | panels/region/cc-input-chooser.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/panels/region/cc-input-chooser.c b/panels/region/cc-input-chooser.c index 562f28859..d6ae8fe24 100644 --- a/panels/region/cc-input-chooser.c +++ b/panels/region/cc-input-chooser.c @@ -570,29 +570,23 @@ static gboolean do_filter (GtkWidget *chooser) { CcInputChooserPrivate *priv = GET_PRIVATE (chooser); + g_auto(GStrv) previous_words = NULL; g_autofree gchar *filter_contents = NULL; - gboolean words_changed; priv->filter_timeout_id = 0; filter_contents = cc_util_normalize_casefold_and_unaccent (gtk_entry_get_text (GTK_ENTRY (priv->filter_entry))); - words_changed = !priv->filter_words; - if (filter_contents) - { - g_auto(GStrv) previous_words = priv->filter_words; - priv->filter_words = g_strsplit_set (g_strstrip (filter_contents), " ", 0); - if (strvs_differ (priv->filter_words, previous_words)) - words_changed = TRUE; - } + previous_words = priv->filter_words; + priv->filter_words = g_strsplit_set (g_strstrip (filter_contents), " ", 0); - if (!priv->filter_words || !priv->filter_words[0]) + if (!priv->filter_words[0]) { gtk_list_box_invalidate_filter (GTK_LIST_BOX (priv->list)); gtk_list_box_set_placeholder (GTK_LIST_BOX (priv->list), NULL); } - else if (words_changed) + else if (previous_words == NULL || strvs_differ (priv->filter_words, previous_words)) { gtk_list_box_invalidate_filter (GTK_LIST_BOX (priv->list)); gtk_list_box_set_placeholder (GTK_LIST_BOX (priv->list), priv->no_results); |