[gconf] gsettings-schema-convert: Don't fail to convert lists without default element



commit 02f12f41b031a1c2672e7cf1cb8ebde58288c547
Author: Guido GÃnther <agx sigxcpu org>
Date:   Thu Feb 23 21:14:18 2012 +0100

    gsettings-schema-convert: Don't fail to convert lists without default element

 gsettings/gsettings-schema-convert |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/gsettings/gsettings-schema-convert b/gsettings/gsettings-schema-convert
index a60dc35..913cc83 100755
--- a/gsettings/gsettings-schema-convert
+++ b/gsettings/gsettings-schema-convert
@@ -854,11 +854,10 @@ class GConfSchema:
         # Fix the default value to be parsable by GVariant
         if self.type == 'list':
             l = self.default.strip()
-            if not (l[0] == '[' and l[-1] == ']'):
-                if not l:
-                    l = '[]'
-                else:
-                    raise GSettingsSchemaConvertException('Cannot parse default list value \'%s\' for key \'%s\'.' % (self.default, self.applyto or self.key))
+            if not l:
+                l = '[]'
+            elif not (l[0] == '[' and l[-1] == ']'):
+                raise GSettingsSchemaConvertException('Cannot parse default list value \'%s\' for key \'%s\'.' % (self.default, self.applyto or self.key))
             values = l[1:-1].strip()
             if not values:
                 self.default = '[]'



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