diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2011-03-10 16:32:19 +1100 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2011-03-10 16:32:27 +1100 |
commit | 9d24a54cb775837cd78d13ebf5c2758292a61448 (patch) | |
tree | 6510df4af53c64d1f61693319fbb72be0a7a5808 | |
parent | a48204f8582e0d039c68ea2fdeb65f56660530a8 (diff) | |
download | dconf-9d24a54cb775837cd78d13ebf5c2758292a61448.tar.gz |
editor: Use int.parse() and double.parse() instead of to_int() and to_double()
-rw-r--r-- | editor/dconf-schema.vala | 2 | ||||
-rw-r--r-- | editor/dconf-view.vala | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/editor/dconf-schema.vala b/editor/dconf-schema.vala index 3520d60..8f3a70d 100644 --- a/editor/dconf-schema.vala +++ b/editor/dconf-schema.vala @@ -222,7 +222,7 @@ public class SchemaEnum for (var prop = child->properties; prop != null; prop = prop->next) { if (prop->name == "value") - value = prop->children->content.to_int(); + value = int.parse(prop->children->content); else if (prop->name == "nick") nick = prop->children->content; else diff --git a/editor/dconf-view.vala b/editor/dconf-view.vala index a71f129..184f9bb 100644 --- a/editor/dconf-view.vala +++ b/editor/dconf-view.vala @@ -238,28 +238,28 @@ private class KeyValueRenderer: Gtk.CellRenderer switch (key.type_string) { case "y": - key.value = new Variant.byte((uchar)text.to_int()); + key.value = new Variant.byte((uchar)int.parse(text)); break; case "n": - key.value = new Variant.int16((int16)text.to_int()); + key.value = new Variant.int16((int16)int.parse(text)); break; case "q": - key.value = new Variant.uint16((uint16)text.to_int()); + key.value = new Variant.uint16((uint16)int.parse(text)); break; case "i": - key.value = new Variant.int32(text.to_int()); + key.value = new Variant.int32(int.parse(text)); break; case "u": - key.value = new Variant.uint32(text.to_int()); + key.value = new Variant.uint32(int.parse(text)); break; case "x": - key.value = new Variant.int64(text.to_int()); + key.value = new Variant.int64(int.parse(text)); break; case "t": - key.value = new Variant.uint64(text.to_int()); + key.value = new Variant.uint64(int.parse(text)); break; case "d": - key.value = new Variant.double(text.to_double()); + key.value = new Variant.double(double.parse(text)); break; } } |