Merge lp:~laney/indicator-datetime/use-upower into lp:~indicator-applet-developers/indicator-datetime/trunk.13.10

Proposed by Iain Lane
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: 215
Merged at revision: 215
Proposed branch: lp:~laney/indicator-datetime/use-upower
Merge into: lp:~indicator-applet-developers/indicator-datetime/trunk.13.10
Diff against target: 56 lines (+11/-10)
2 files modified
debian/rules (+1/-1)
src/datetime-service.c (+10/-9)
To merge this branch: bzr merge lp:~laney/indicator-datetime/use-upower
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Mathieu Trudel-Lapierre Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+153809@code.launchpad.net

Commit message

Use logind instead of ConsoleKit to adjust the clock upon return from sleep.

Description of the change

We want to remove ConsoleKit dependencies from Ubuntu. indicator-datetime uses CK to be notified of system resume events in order to fix up the clock. You can do this with UPower, though. So no CK dep required.

It WFM - running under G_MESSAGES_DEBUG=all:

  (process:15395): Indicator-Datetime-DEBUG: System has been resumed; adjusting clock
  (process:15395): Indicator-Datetime-DEBUG: Updating Date/Time

Tested on both a pure CK and a CK/logind system. Not a pure logind one - I don't have one of those.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Please note that AFAIK this is going away in upower 1.0, as this functionality moved into logind. So perhaps this should be adjusted right away?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Iain Lane (laney) wrote :

Hmm, OK. I see http://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html now.

Slight shame as this API is nicer than the logind one, but oh well.

Revision history for this message
Iain Lane (laney) wrote :

So here's another version which uses logind directly. It relies on the fix for bug #1157122. I'm also not sure what we should do with this branch now that the FFe has been declined.

Revision history for this message
Martin Pitt (pitti) wrote :

As this drops support for CK, I guess we need to keep this on the shelf until we switch to logind then?

Thanks!

Revision history for this message
Ted Gould (ted) wrote :

On Tue, 2013-03-19 at 12:01 +0000, Iain Lane wrote:

> So here's another version which uses logind directly. It relies on the
> fix for bug #1157122. I'm also not sure what we should do with this
> branch now that the FFe has been declined.

We've branched all the indicators for 13.10. It can land just fine in
the 13.10 branch.

Revision history for this message
Iain Lane (laney) wrote :

> On Tue, 2013-03-19 at 12:01 +0000, Iain Lane wrote:
>
> > So here's another version which uses logind directly. It relies on the
> > fix for bug #1157122. I'm also not sure what we should do with this
> > branch now that the FFe has been declined.
>
>
> We've branched all the indicators for 13.10. It can land just fine in
> the 13.10 branch.

Great - can this be reviewed for the 13.10 branch then please?

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

Looks fine to me, esp. if we're switching to logind in a very short timeframe. This is in trunk and not for raring anyway.

review: Approve
Revision history for this message
Martin Pitt (pitti) wrote :

This looks fine for raring+1, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/rules'
2--- debian/rules 2012-11-16 20:43:36 +0000
3+++ debian/rules 2013-03-19 12:09:22 +0000
4@@ -9,7 +9,7 @@
5 NOCONFIGURE=1 dh_autoreconf ./autogen.sh
6
7 override_dh_auto_configure:
8- dh_auto_configure -- --disable-static
9+ dh_auto_configure -- --disable-static --disable-silent-rules
10
11 override_dh_install:
12 find debian/indicator-datetime -name \*.la -delete
13
14=== modified file 'src/datetime-service.c'
15--- src/datetime-service.c 2013-02-04 15:13:42 +0000
16+++ src/datetime-service.c 2013-03-19 12:09:22 +0000
17@@ -1154,11 +1154,12 @@
18 session_active_change_cb (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name,
19 GVariant * parameters, gpointer user_data)
20 {
21- // Just returned from suspend
22- if (g_strcmp0(signal_name, "SystemIdleHintChanged") == 0) {
23- gboolean idle = FALSE;
24- g_variant_get(parameters, "(b)", &idle);
25- if (!idle) {
26+ // Suspending / returning from suspend (true / false)
27+ if (g_strcmp0(signal_name, "PrepareForSleep") == 0) {
28+ gboolean sleeping = FALSE;
29+ g_variant_get (parameters, "(b)", &sleeping);
30+ if (!sleeping) {
31+ g_debug ("System has been resumed; adjusting clock");
32 on_clock_skew ();
33 }
34 }
35@@ -1174,7 +1175,7 @@
36 GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error);
37
38 if (error != NULL) {
39- g_warning("Could not grab DBus proxy for ConsoleKit: %s", error->message);
40+ g_warning("Could not grab DBus proxy for logind: %s", error->message);
41 g_clear_error (&error);
42 return;
43 }
44@@ -1482,9 +1483,9 @@
45 g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
46 G_DBUS_PROXY_FLAGS_NONE,
47 NULL,
48- "org.freedesktop.ConsoleKit",
49- "/org/freedesktop/ConsoleKit/Manager",
50- "org.freedesktop.ConsoleKit.Manager",
51+ "org.freedesktop.login1",
52+ "/org/freedesktop/login1",
53+ "org.freedesktop.login1.Manager",
54 NULL, system_proxy_cb, dbus);
55
56 mainloop = g_main_loop_new(NULL, FALSE);

Subscribers

People subscribed via source and target branches