[dconf-editor] Remove external use of key metadata.



commit 779a6c7b444ec6038ab8c392dac642b1bb9a73bf
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu May 12 03:44:51 2016 +0200

    Remove external use of key metadata.

 editor/dconf-model.vala  |    6 ++++++
 editor/dconf-window.vala |   11 +++--------
 2 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index 6115257..3f4a085 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -311,6 +311,12 @@ public class GSettingsKey : Key
 
         this.type_string = type_string;
     }
+
+    public bool search_for (string text)
+    {
+        return summary.index_of (text) >= 0
+            || description.index_of (text) >= 0;  // TODO use the "in" keyword
+    }
 }
 
 public class SettingsModel : Object, Gtk.TreeModel
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index 69bcf64..5111a26 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -476,14 +476,9 @@ class DConfWindow : ApplicationWindow
 
     private bool key_matches (Key key, string text)
     {
-        /* Check key schema (description) */
-        if (key.has_schema)
-        {
-            if (((GSettingsKey) key).summary.index_of (text) >= 0)
-                return true;
-            if (((GSettingsKey) key).description.index_of (text) >= 0)
-                return true;
-        }
+        /* Check in key's metadata */
+        if (key.has_schema && ((GSettingsKey) key).search_for (text))
+            return true;
 
         /* Check key value */
         if (key.value.is_of_type (VariantType.STRING) && key.value.get_string ().index_of (text) >= 0)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]