summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-10-28 14:38:13 +0100
committerBastien Nocera <hadess@hadess.net>2013-10-28 15:15:02 +0100
commitd1032c562a1c61d1478d3a000d9ddf3144472251 (patch)
tree70e3a1bc4d7e0e0bc38fc6edc1383d013e5cc6f9
parent988889121ec44674aadaf0a23e61630bf6105b16 (diff)
linux: Switch Unifying devices to use the new daemon poll
-rw-r--r--src/linux/up-device-unifying.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/linux/up-device-unifying.c b/src/linux/up-device-unifying.c
index 5639366..b3876e0 100644
--- a/src/linux/up-device-unifying.c
+++ b/src/linux/up-device-unifying.c
@@ -30,11 +30,8 @@
#include "up-device-unifying.h"
#include "up-types.h"
-#define UP_DEVICE_UNIFYING_REFRESH_TIMEOUT 60 /* seconds */
-
struct UpDeviceUnifyingPrivate
{
- guint poll_timer_id;
HidppDevice *hidpp_device;
};
@@ -289,10 +286,7 @@ up_device_unifying_coldplug (UpDevice *device)
/* set up a poll to send the magic packet */
up_device_unifying_refresh (device);
- unifying->priv->poll_timer_id = g_timeout_add_seconds (UP_DEVICE_UNIFYING_REFRESH_TIMEOUT,
- (GSourceFunc) up_device_unifying_refresh,
- device);
- g_source_set_name_by_id (unifying->priv->poll_timer_id, "[upower] up_device_unifying_refresh (linux)");
+ up_daemon_start_poll (G_OBJECT (device), (GSourceFunc) up_device_unifying_refresh);
ret = TRUE;
out:
g_list_foreach (hidraw_list, (GFunc) g_object_unref, NULL);
@@ -329,8 +323,7 @@ up_device_unifying_finalize (GObject *object)
unifying = UP_DEVICE_UNIFYING (object);
g_return_if_fail (unifying->priv != NULL);
- if (unifying->priv->poll_timer_id > 0)
- g_source_remove (unifying->priv->poll_timer_id);
+ up_daemon_stop_poll (object);
if (unifying->priv->hidpp_device != NULL)
g_object_unref (unifying->priv->hidpp_device);