aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-08-19 20:19:10 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-08-19 20:19:10 +0000
commit341cbc193c007e68f9d6591bad84ba0af70884ec (patch)
tree87031c44d7b8861055cb7c3cdb8df0a9b14aa10a /src/main.cpp
parent139454ce848864a96db9ff1acf0552060ca2bbd8 (diff)
parenta144696c42e5048083abbe6a08528ed57526fa07 (diff)
downloadayatana-indicator-datetime-341cbc193c007e68f9d6591bad84ba0af70884ec.tar.gz
ayatana-indicator-datetime-341cbc193c007e68f9d6591bad84ba0af70884ec.tar.bz2
ayatana-indicator-datetime-341cbc193c007e68f9d6591bad84ba0af70884ec.zip
Use powerd's hardware wakeup API instead of of using the u_hardware_alarm_*() API directly.
Approved by: Antti Kaijanmäki, PS Jenkins bot
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);
}
}