Merge lp:~sforshee/powerd/remove-gsettings into lp:powerd

Proposed by Seth Forshee
Status: Merged
Approved by: Oliver Grawert
Approved revision: 97
Merged at revision: 96
Proposed branch: lp:~sforshee/powerd/remove-gsettings
Merge into: lp:powerd
Diff against target: 63 lines (+2/-38)
1 file modified
src/powerd.cpp (+2/-38)
To merge this branch: bzr merge lp:~sforshee/powerd/remove-gsettings
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+188396@code.launchpad.net

Commit message

Remove use of gsettings and the associated settings for the activity and dim timeouts.

Description of the change

Remove use of gsettings and the associated settings for the activity and dim timeouts.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

that schemas is used in ubuntu-system-settings, dropping it is going to make some of the settings code hits abort(). Is there a replacement schemas or api we can port our code to?

Revision history for this message
Oliver Grawert (ogra) wrote :

so after discussion on IRC it seems like removing the schema file will trigger a crash in system-settings but leaving it in place, even non-functional, will not cause this.
so lets drop the code but keep the shcema file until unity can provide it i would say ...

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Seth Forshee (sforshee) wrote :

In that case is there even any point in making the change? After all, the original trigger for this was that the setting couldn't be written to /root because it was read-only. If we remove the use of the setting but keep the schema that really doesn't fix anything, does it?

lp:~sforshee/powerd/remove-gsettings updated
97. By Seth Forshee

Add back gsettings schema

This will allow users of the schema some time to transition.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/powerd.cpp'
2--- src/powerd.cpp 2013-09-25 17:44:55 +0000
3+++ src/powerd.cpp 2013-10-01 14:18:00 +0000
4@@ -72,9 +72,8 @@
5
6 /* The real default for this is set in the gschema file, but set 60 here
7 * as a sanity check */
8-static int activity_timeout = 60;
9-static int dim_timeout = 45;
10-static GSettings *powerd_settings = NULL;
11+static const int activity_timeout = 60;
12+static const int dim_timeout = 45;
13
14 static GMainLoop *main_loop = NULL;
15 static guint name_id;
16@@ -369,36 +368,6 @@
17 }
18 }
19
20-static int
21-get_activity_timeout_from_gsettings()
22-{
23- int ret;
24- GVariant *val = NULL;
25-
26- if (!powerd_settings)
27- powerd_settings = g_settings_new("com.canonical.powerd");
28-
29- val = g_settings_get_value(powerd_settings, "activity-timeout");
30- ret = g_variant_get_uint32(val);
31- g_variant_unref(val);
32- return ret;
33-}
34-
35-static int
36-get_dim_timeout_from_gsettings()
37-{
38- int ret;
39- GVariant *val = NULL;
40-
41- if (!powerd_settings)
42- powerd_settings = g_settings_new("com.canonical.powerd");
43-
44- val = g_settings_get_value(powerd_settings, "dim-timeout");
45- ret = (int)g_variant_get_uint32(val);
46- g_variant_unref(val);
47- return ret;
48-}
49-
50 /* Must be first to run on main loop */
51 static gboolean main_init(gpointer unused)
52 {
53@@ -467,11 +436,6 @@
54 (GAsyncReadyCallback)ofono_proxy_connect_cb,
55 NULL);
56
57- activity_timeout = get_activity_timeout_from_gsettings();
58- dim_timeout = get_dim_timeout_from_gsettings();
59- powerd_debug("Activity Timeout is %d seconds\n", activity_timeout);
60- powerd_debug("Auto-dim Timeout is %d seconds\n", dim_timeout);
61-
62 /* Init this first, data is used by other inits */
63 device_config_init();
64

Subscribers

People subscribed via source and target branches