From 1aa1b0de647a6c0eada08e690750144942bdfef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Sat, 29 Jan 2011 00:05:09 +0100 Subject: glib-2.0: Add parse and try_parse methods to boolean and numeric types This deprecates string.to_bool and string.to_int*. --- vala/valaattribute.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vala/valaattribute.vala') diff --git a/vala/valaattribute.vala b/vala/valaattribute.vala index 9fdc28a42..68d753910 100644 --- a/vala/valaattribute.vala +++ b/vala/valaattribute.vala @@ -99,7 +99,7 @@ public class Vala.Attribute : CodeNode { return 0; } - return value.to_int (); + return int.parse (value); } /** @@ -115,7 +115,7 @@ public class Vala.Attribute : CodeNode { return 0; } - return value.to_double (); + return double.parse (value); } /** @@ -125,6 +125,6 @@ public class Vala.Attribute : CodeNode { * @return boolean value */ public bool get_bool (string name) { - return (args.get (name) == "true"); + return bool.parse (args.get (name)); } } -- cgit v1.2.1