[dconf] editor: Trivial fix for 'flags'



commit 9b0ee770b1ad9eb9bc26d9aa11e4c0366fe8703e
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Mar 22 11:43:21 2011 -0400

    editor: Trivial fix for 'flags'
    
    The code will fail badly if it encounters a 'flags' key in a schema, so
    add a very minimal workaround to deal with that.

 editor/dconf-schema.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/editor/dconf-schema.vala b/editor/dconf-schema.vala
index b074223..2b34e28 100644
--- a/editor/dconf-schema.vala
+++ b/editor/dconf-schema.vala
@@ -28,6 +28,9 @@ public class SchemaKey
                 type = "s";
                 enum_name = prop->children->content;
             }
+			else if (prop->name == "flags")
+				/* TODO: support this properly */
+				type = "as";
             else
                 warning ("Unknown property on <key>, %s", prop->name);
         }
@@ -84,7 +87,7 @@ public class SchemaKey
                     Variant v;
                     try
                     {
-                        v = new Variant(type, value);
+                        v = new Variant.string (value);
                         choices.append (new SchemaChoice(value, v));
                     }
                     catch (VariantParseError e)
@@ -130,7 +133,7 @@ public class SchemaKey
                     Variant v;
                     try
                     {
-                        v = new Variant(type, target);
+                        v = new Variant.string (target);
                         choices.append (new SchemaChoice(value, v));
                     }
                     catch (VariantParseError e)



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