[dconf-editor] Better API.



commit 0eae7b54fb02265b677a90f5446a39eaa0bcbb21
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Jun 28 11:49:15 2018 +0200

    Better API.

 editor/dconf-model.vala   | 8 ++++----
 editor/registry-view.vala | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index e868df3..f9c6845 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -514,20 +514,20 @@ public class SettingsModel : Object
         return settings.get_user_value (key.name) == null;
     }
 
-    public bool key_has_no_schema (string full_name)
+    public bool key_has_schema (string full_name)
     {
         if (!is_key_path (full_name))
             assert_not_reached ();
 
         Key? key = get_key (full_name, "");
-        return key == null || (!) key is DConfKey;
+        return key != null && (!) key is GSettingsKey;
     }
 
     public bool is_key_ghost (string full_name)
     {
         // we're "sure" the key is a DConfKey, but that might have changed since
-        if (!key_has_no_schema (full_name))
-            warning (@"Function is_key_ghost called for path:\n  $full_name\nbut key found is not a 
DConfKey.");
+        if (key_has_schema (full_name))
+            warning (@"Function is_key_ghost called for path:\n  $full_name\nbut key found there has a 
schema.");
 
         return get_dconf_key_value_or_null (full_name, client) == null;
     }
diff --git a/editor/registry-view.vala b/editor/registry-view.vala
index 4e9cbc5..1f1dc5c 100644
--- a/editor/registry-view.vala
+++ b/editor/registry-view.vala
@@ -119,7 +119,7 @@ private abstract class RegistryList : Grid, BrowsableView
         if (modifications_handler.key_has_planned_change (row.full_name))
         {
             context.add_class ("delayed");
-            if (model.key_has_no_schema (row.full_name))
+            if (!model.key_has_schema (row.full_name))
             {
                 if (modifications_handler.get_key_planned_value (row.full_name) == null)
                     context.add_class ("erase");
@@ -130,7 +130,7 @@ private abstract class RegistryList : Grid, BrowsableView
         else
         {
             context.remove_class ("delayed");
-            if (model.key_has_no_schema (row.full_name) && model.is_key_ghost (row.full_name))
+            if (!model.key_has_schema (row.full_name) && model.is_key_ghost (row.full_name))
                 context.add_class ("erase");
             else
                 context.remove_class ("erase");


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