Merge lp:~tintou/granite/fix-1014022 into lp:~elementary-pantheon/granite/granite

Proposed by Corentin Noël
Status: Merged
Merged at revision: 283
Proposed branch: lp:~tintou/granite/fix-1014022
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 43 lines (+11/-6)
2 files modified
lib/Services/Settings.vala (+10/-5)
lib/Widgets/DynamicNotebook.vala (+1/-1)
To merge this branch: bzr merge lp:~tintou/granite/fix-1014022
Reviewer Review Type Date Requested Status
Victor Martinez (community) Approve
Review via email: mp+110654@code.launchpad.net

Description of the change

Correct bug 1014022 (and then apps can start faster...)

To post a comment you must log in.
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

I though agent00tai did some work on refactoring Granite.Settings with similar tweaks to fix bug 969077. He also did some fixes to the entire thing AFAIR. I wonder what happened to that work...

Revision history for this message
Fabian Thoma (fabianthoma) wrote :

No shnatsel I fixed the whole thing with string arrays not working and
another one where Apps would crash, but I didn't look into this one ;)

Revision history for this message
Victor Martinez (victored) wrote :

The overhead generated by these checks is negligible compared to the performance benefits.

The change in DynamicNotebook.vala probably deserves its own revision, since it implies a behavioral API change.

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 2012-04-01 21:10:09 +0000
3+++ lib/Services/Settings.vala 2012-06-16 10:48:20 +0000
4@@ -269,17 +269,22 @@
5
6 if(val.type() == prop.value_type) {
7 if(type == typeof (int))
8- success = schema.set_int (key, val.get_int ());
9+ if (val.get_int () != schema.get_int (key))
10+ success = schema.set_int (key, val.get_int ());
11 else if(type == typeof (double))
12- success = schema.set_double (key, val.get_double ());
13+ if (val.get_double () != schema.get_double (key))
14+ success = schema.set_double (key, val.get_double ());
15 else if(type == typeof (string))
16- success = schema.set_string (key, val.get_string ());
17+ if (val.get_string () != schema.get_string (key))
18+ success = schema.set_string (key, val.get_string ());
19 else if(type == typeof (string[])) {
20 string[] strings = null;
21 this.get(key, &strings);
22- success = schema.set_strv (key, strings);
23+ if (strings != schema.get_strv (key))
24+ success = schema.set_strv (key, strings);
25 } else if(type == typeof (bool))
26- success = schema.set_boolean (key, val.get_boolean ());
27+ if (val.get_boolean () != schema.get_boolean (key))
28+ success = schema.set_boolean (key, val.get_boolean ());
29 }
30 else if (type.is_a (typeof (SettingsSerializable)))
31 success = schema.set_string (key, (val.get_object () as SettingsSerializable).settings_serialize ());
32
33=== modified file 'lib/Widgets/DynamicNotebook.vala'
34--- lib/Widgets/DynamicNotebook.vala 2012-04-06 09:49:00 +0000
35+++ lib/Widgets/DynamicNotebook.vala 2012-06-16 10:48:20 +0000
36@@ -895,7 +895,7 @@
37 if (page < tabs.tabs.size && page >= 0)
38 return tabs.tabs[page];
39 else
40- return null;
41+ return new Tab ("");;
42 }
43 }
44

Subscribers

People subscribed via source and target branches