[Bug 62530] Should enable power saving even on desktop

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Mar 19 16:58:18 CET 2013


https://bugs.freedesktop.org/show_bug.cgi?id=62530

--- Comment #1 from Simon McVittie <simon.mcvittie at collabora.co.uk> ---
The copyright doesn't look right.

+ self->priv->is_inactive = (g_variant_get_uint32 (prop) == STATUS_IDLE);

This is going to critical and blow up if prop is not a uint32. Defensive
programming please.

+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, NULL,
+ SERVICE_NAME, SERVICE_OBJECT_PATH, SERVICE_INTERFACE,
+ NULL,
+ proxy_new_cb, g_object_ref (self));

If it doesn't emit PropertiesChanged you should use
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES.

+ def Get(self, e):
+ prop = e.args[0] + '.' + e.args[1]
+ self.q.dbus_return(e.message, self.status, signature='v')

I'd prefer this to do *something* sensible (return an error?) if prop is not
the expected thing.

- for enabled in [False, True, False]:
- mce.InactivityChanged(enabled)
+ for enabled in [STATUS_AVAILABLE, STATUS_IDLE, STATUS_BUSY]:
+ service.StatusChanged(enabled)
q.expect('dbus-method-call', method='SetPowerSaving',
args=[enabled], interface=cs.CONN_IFACE_POWER_SAVING,

Er, this used to expect SetPowerSaving to be called with a boolean value, and
now expects it to be called with an integer value. That can't be right?

(I would expect args=[enabled == STATUS_IDLE] or something.)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list