[dconf-editor] Add get_key_properties.



commit 88aa2a93b6fdb28f7596fc6927ed3bfa53240ca7
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Jan 27 12:20:42 2018 +0100

    Add get_key_properties.

 editor/browser-view.vala  |    4 ++--
 editor/dconf-model.vala   |    9 +++++++++
 editor/registry-info.vala |    4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index 2f4275d..7eeb01a 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -304,8 +304,8 @@ class BrowserView : Grid
         }
         else if (current_view_is_properties_view ())
         {
-            Key? fresh_key = model.get_key (path, "");
-            if (fresh_key != null && !properties_view.check_reload ((!) fresh_key, model.get_key_value ((!) 
fresh_key)))
+            Variant? properties = model.get_key_properties (path, last_context);
+            if (properties != null && !properties_view.check_reload ((!) properties))
                 return false;
         }
 
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index 81ab096..70ea58c 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -379,6 +379,15 @@ public class SettingsModel : Object
     * * Key value methods
     \*/
 
+    public Variant? get_key_properties (string full_name, string context)
+    {
+        Key? key = get_key (full_name, context);
+        if (key == null)
+            return null;
+
+        return ((!) key).properties;
+    }
+
     public string get_key_copy_text (string full_name, string context)
     {
         Key? key = get_key (full_name, context);
diff --git a/editor/registry-info.vala b/editor/registry-info.vala
index 9633343..6f9a4fc 100644
--- a/editor/registry-info.vala
+++ b/editor/registry-info.vala
@@ -397,11 +397,11 @@ class RegistryInfo : Grid, BrowsableView
         return (Widget) label;
     }
 
-    public bool check_reload (Key fresh_key, Variant fresh_value)
+    public bool check_reload (Variant properties)
     {
         if (current_key_info == null) // should not happen?
             return true;
-        return !((!) current_key_info).equal (fresh_key.properties); // TODO compare fresh_value with editor 
value?
+        return !((!) current_key_info).equal (properties); // TODO compare key value with editor value?
     }
 }
 


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