Merge lp:~tintou/granite/granite-u-int64 into lp:~elementary-pantheon/granite/granite

Proposed by Corentin Noël
Status: Merged
Approved by: Felipe Escoto
Approved revision: 867
Merged at revision: 867
Proposed branch: lp:~tintou/granite/granite-u-int64
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 29 lines (+12/-0)
1 file modified
lib/Services/Settings.vala (+12/-0)
To merge this branch: bzr merge lp:~tintou/granite/granite-u-int64
Reviewer Review Type Date Requested Status
Felipe Escoto (community) Approve
Review via email: mp+269271@code.launchpad.net

Commit message

Support for int64 and uint64 in Services.Settings

Description of the change

Support for int64 and uint64.

To post a comment you must log in.
Revision history for this message
Felipe Escoto (philip.scott) wrote :

Works for me!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/Services/Settings.vala'
2--- lib/Services/Settings.vala 2015-08-05 20:46:52 +0000
3+++ lib/Services/Settings.vala 2015-08-26 21:07:24 +0000
4@@ -249,6 +249,10 @@
5 set_property (prop.name, schema.get_strv (key));
6 else if(type == typeof (bool))
7 set_property (prop.name, schema.get_boolean (key));
8+ else if(type == typeof (int64))
9+ set_property (prop.name, schema.get_value (key).get_int64 ());
10+ else if(type == typeof (uint64))
11+ set_property (prop.name, schema.get_value (key).get_uint64 ());
12 else if(type.is_enum ())
13 set_property (prop.name, schema.get_enum (key));
14 } else if (type.is_a (typeof (SettingsSerializable))) {
15@@ -296,6 +300,14 @@
16 if (val.get_uint () != schema.get_uint (key)) {
17 success = schema.set_uint (key, val.get_uint ());
18 }
19+ } else if(type == typeof (int64)) {
20+ if (val.get_int64 () != schema.get_value (key).get_int64 ()) {
21+ success = schema.set_value (key, new Variant.int64 (val.get_int64 ()));
22+ }
23+ } else if(type == typeof (uint64)) {
24+ if (val.get_uint64 () != schema.get_value (key).get_uint64 ()) {
25+ success = schema.set_value (key, new Variant.uint64 (val.get_uint64 ()));
26+ }
27 } else if(type == typeof (double)) {
28 if (val.get_double () != schema.get_double (key)) {
29 success = schema.set_double (key, val.get_double ());

Subscribers

People subscribed via source and target branches