← Back to team overview

elementaryart team mailing list archive

[Merge] lp:~tintou/granite/granite into lp:granite

 

Corentin Noël has proposed merging lp:~tintou/granite/granite into lp:granite.

Requested reviews:
  elementary Pantheon team (elementary-pantheon)
Related bugs:
  Bug #998483 in Granite: "Timepickers plus and minus buttons not working"
  https://bugs.launchpad.net/granite/+bug/998483

For more details, see:
https://code.launchpad.net/~tintou/granite/granite/+merge/113050

It contains a correction to make granite's settings safer and to be sure that settings is well stored.
-- 
https://code.launchpad.net/~tintou/granite/granite/+merge/113050
Your team elementaryart (old) is subscribed to branch lp:granite.
=== modified file 'lib/Services/Settings.vala'
--- lib/Services/Settings.vala	2012-06-16 10:44:28 +0000
+++ lib/Services/Settings.vala	2012-07-02 14:12:25 +0000
@@ -258,6 +258,7 @@
                 return;
         
             stop_monitor ();
+            notify.disconnect (handle_notify);
             
             var obj_class = (ObjectClass) get_type ().class_ref ();
             var prop = obj_class.find_property (key);
@@ -268,23 +269,29 @@
             this.get_property (prop.name, ref val);
             
             if(val.type() == prop.value_type) {
-                if(type == typeof (int))
-                    if (val.get_int () != schema.get_int (key))
+                if(type == typeof (int)) {
+                    if (val.get_int () != schema.get_int (key)) {
                         success = schema.set_int (key, val.get_int ());
-                else if(type == typeof (double))
-                    if (val.get_double () != schema.get_double (key))
+                    }
+                } else if(type == typeof (double)) {
+                    if (val.get_double () != schema.get_double (key)) {
                         success = schema.set_double (key, val.get_double ());
-                else if(type == typeof (string))
-                    if (val.get_string () != schema.get_string (key))
+                    }
+                } else if(type == typeof (string)) {
+                    if (val.get_string () != schema.get_string (key)) {
                         success = schema.set_string (key, val.get_string ());
-                else if(type == typeof (string[])) {
+                    }
+                } else if(type == typeof (string[])) {
                     string[] strings = null;
                     this.get(key, &strings);
-                    if (strings != schema.get_strv (key))
+                    if (strings != schema.get_strv (key)) {
                         success = schema.set_strv (key, strings);
-                } else if(type == typeof (bool))
-                    if (val.get_boolean () != schema.get_boolean (key))
+                    }
+                } else if(type == typeof (bool)) {
+                    if (val.get_boolean () != schema.get_boolean (key)) {
                         success = schema.set_boolean (key, val.get_boolean ());
+                    }
+                }
             }
             else if (type.is_a (typeof (SettingsSerializable)))
                 success = schema.set_string (key, (val.get_object () as SettingsSerializable).settings_serialize ());
@@ -294,6 +301,7 @@
             if (!success)
                 warning ("Key '%s' could not be written to.", key);
             
+            notify.connect (handle_notify);
             start_monitor ();
         }
         


Follow ups