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
=== modified file 'debian/rules'
--- debian/rules 2012-11-16 20:43:36 +0000
+++ debian/rules 2013-03-19 12:09:22 +0000
@@ -9,7 +9,7 @@
9 NOCONFIGURE=1 dh_autoreconf ./autogen.sh9 NOCONFIGURE=1 dh_autoreconf ./autogen.sh
1010
11override_dh_auto_configure:11override_dh_auto_configure:
12 dh_auto_configure -- --disable-static12 dh_auto_configure -- --disable-static --disable-silent-rules
1313
14override_dh_install:14override_dh_install:
15 find debian/indicator-datetime -name \*.la -delete15 find debian/indicator-datetime -name \*.la -delete
1616
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c 2013-02-04 15:13:42 +0000
+++ src/datetime-service.c 2013-03-19 12:09:22 +0000
@@ -1154,11 +1154,12 @@
1154session_active_change_cb (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name,1154session_active_change_cb (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name,
1155 GVariant * parameters, gpointer user_data)1155 GVariant * parameters, gpointer user_data)
1156{1156{
1157 // Just returned from suspend1157 // Suspending / returning from suspend (true / false)
1158 if (g_strcmp0(signal_name, "SystemIdleHintChanged") == 0) {1158 if (g_strcmp0(signal_name, "PrepareForSleep") == 0) {
1159 gboolean idle = FALSE;1159 gboolean sleeping = FALSE;
1160 g_variant_get(parameters, "(b)", &idle);1160 g_variant_get (parameters, "(b)", &sleeping);
1161 if (!idle) {1161 if (!sleeping) {
1162 g_debug ("System has been resumed; adjusting clock");
1162 on_clock_skew ();1163 on_clock_skew ();
1163 }1164 }
1164 }1165 }
@@ -1174,7 +1175,7 @@
1174 GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error);1175 GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error);
11751176
1176 if (error != NULL) {1177 if (error != NULL) {
1177 g_warning("Could not grab DBus proxy for ConsoleKit: %s", error->message);1178 g_warning("Could not grab DBus proxy for logind: %s", error->message);
1178 g_clear_error (&error);1179 g_clear_error (&error);
1179 return;1180 return;
1180 }1181 }
@@ -1482,9 +1483,9 @@
1482 g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,1483 g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
1483 G_DBUS_PROXY_FLAGS_NONE,1484 G_DBUS_PROXY_FLAGS_NONE,
1484 NULL,1485 NULL,
1485 "org.freedesktop.ConsoleKit",1486 "org.freedesktop.login1",
1486 "/org/freedesktop/ConsoleKit/Manager",1487 "/org/freedesktop/login1",
1487 "org.freedesktop.ConsoleKit.Manager",1488 "org.freedesktop.login1.Manager",
1488 NULL, system_proxy_cb, dbus);1489 NULL, system_proxy_cb, dbus);
14891490
1490 mainloop = g_main_loop_new(NULL, FALSE);1491 mainloop = g_main_loop_new(NULL, FALSE);

Subscribers

People subscribed via source and target branches