aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-12-08 10:40:44 +0000
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-12-08 10:40:44 +0000
commitf54505942ce2dcc73fcbad79d4f5cdce991bf8cb (patch)
tree9aab8e9b612adfff946a93365cd0d2fea9aeb74c /src/main.cpp
parent4a6ec712275b179decd1844232dce44bc9f9dc19 (diff)
downloadayatana-indicator-datetime-f54505942ce2dcc73fcbad79d4f5cdce991bf8cb.tar.gz
ayatana-indicator-datetime-f54505942ce2dcc73fcbad79d4f5cdce991bf8cb.tar.bz2
ayatana-indicator-datetime-f54505942ce2dcc73fcbad79d4f5cdce991bf8cb.zip
Make the datetime indicator build on non-Ubuntu systems (which mostly lack url-dispatcher and Ubuntu Touch sound schema files.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 31654c9..fdd84b5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -29,7 +29,9 @@
#include <datetime/planner-snooze.h>
#include <datetime/planner-range.h>
#include <datetime/settings-live.h>
+#ifdef HAVE_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS
#include <datetime/snap.h>
+#endif
#include <datetime/state.h>
#include <datetime/timezones-live.h>
#include <datetime/timezone-timedated.h>
@@ -90,6 +92,7 @@ namespace
return state;
}
+#ifdef HAVE_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS
std::shared_ptr<AlarmQueue> create_simple_alarm_queue(const std::shared_ptr<Clock>& clock,
const std::shared_ptr<Planner>& snooze_planner,
const std::shared_ptr<Engine>& engine,
@@ -113,6 +116,7 @@ namespace
auto wakeup_timer = std::make_shared<PowerdWakeupTimer>(clock);
return std::make_shared<SimpleAlarmQueue>(clock, planner, wakeup_timer);
}
+#endif
}
int
@@ -133,9 +137,10 @@ main(int /*argc*/, char** /*argv*/)
auto actions = std::make_shared<LiveActions>(state);
MenuFactory factory(actions, state);
+#ifdef HAVE_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS
// set up the snap decisions
auto snooze_planner = std::make_shared<SnoozePlanner>(state->settings, state->clock);
- auto notification_engine = std::make_shared<uin::Engine>("indicator-datetime-service");
+ auto notification_engine = std::make_shared<ain::Engine>("ayatana-indicator-datetime-service");
std::unique_ptr<Snap> snap (new Snap(notification_engine, state->settings));
auto alarm_queue = create_simple_alarm_queue(state->clock, snooze_planner, engine, timezone_);
auto on_snooze = [snooze_planner](const Appointment& appointment, const Alarm& alarm) {
@@ -147,6 +152,7 @@ main(int /*argc*/, char** /*argv*/)
engine->disable_ubuntu_alarm(appointment);
};
alarm_queue->alarm_reached().connect(on_alarm_reached);
+#endif
// create the menus
std::vector<std::shared_ptr<Menu>> menus;