aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-08-18 23:03:38 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-08-18 23:03:38 -0500
commit2c77b7e18df874428b0ec9d65a6b3386915f60a3 (patch)
tree8a293c023474ef5628e9a7fb5ef1a2f0bae6f729 /src/main.cpp
parent139454ce848864a96db9ff1acf0552060ca2bbd8 (diff)
downloadayatana-indicator-datetime-2c77b7e18df874428b0ec9d65a6b3386915f60a3.tar.gz
ayatana-indicator-datetime-2c77b7e18df874428b0ec9d65a6b3386915f60a3.tar.bz2
ayatana-indicator-datetime-2c77b7e18df874428b0ec9d65a6b3386915f60a3.zip
use powerd for hw alarm wakeups
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/main.cpp b/src/main.cpp
index eb90020..48d3d20 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,13 +31,9 @@
#include <datetime/state.h>
#include <datetime/timezone-file.h>
#include <datetime/timezones-live.h>
-#include <datetime/wakeup-timer-mainloop.h>
+#include <datetime/wakeup-timer-powerd.h>
#include <notifications/notifications.h>
-#ifdef HAVE_UBUNTU_HW_ALARM_H
- #include <datetime/wakeup-timer-uha.h>
-#endif
-
#include <glib/gi18n.h> // bindtextdomain()
#include <gio/gio.h>
@@ -66,20 +62,6 @@ namespace
return engine;
}
- std::shared_ptr<WakeupTimer> create_wakeup_timer(const std::shared_ptr<Clock>& clock)
- {
- std::shared_ptr<WakeupTimer> wakeup_timer;
-
-#ifdef HAVE_UBUNTU_HW_ALARM_H
- if (UhaWakeupTimer::is_supported()) // prefer to use the platform API
- wakeup_timer = std::make_shared<UhaWakeupTimer>(clock);
- else
-#endif
- wakeup_timer = std::make_shared<MainloopWakeupTimer>(clock);
-
- return wakeup_timer;
- }
-
std::shared_ptr<State> create_state(const std::shared_ptr<Engine>& engine,
const std::shared_ptr<Timezone>& tz)
{
@@ -120,7 +102,7 @@ namespace
upcoming_planner->date().set(now);
});
- auto wakeup_timer = create_wakeup_timer(clock);
+ auto wakeup_timer = std::make_shared<PowerdWakeupTimer>(clock);
return std::make_shared<SimpleAlarmQueue>(clock, upcoming_planner, wakeup_timer);
}
}