From f54505942ce2dcc73fcbad79d4f5cdce991bf8cb Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 8 Dec 2017 10:40:44 +0000 Subject: Make the datetime indicator build on non-Ubuntu systems (which mostly lack url-dispatcher and Ubuntu Touch sound schema files. --- src/actions-live.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/actions-live.cpp') diff --git a/src/actions-live.cpp b/src/actions-live.cpp index 5f98dfd..994fc3c 100644 --- a/src/actions-live.cpp +++ b/src/actions-live.cpp @@ -19,7 +19,9 @@ #include +#ifdef HAS_URLDISPATCHER #include +#endif #include @@ -49,11 +51,13 @@ void LiveActions::execute_command(const std::string& cmdstr) } } +#ifdef HAS_URLDISPATCHER void LiveActions::dispatch_url(const std::string& url) { g_debug("Dispatching url '%s'", url.c_str()); url_dispatch_send(url.c_str(), nullptr, nullptr); } +#endif /*** **** @@ -61,11 +65,14 @@ void LiveActions::dispatch_url(const std::string& url) void LiveActions::desktop_open_settings_app() { +#ifdef HAS_URLDISPATCHER if (g_getenv ("MIR_SOCKET") != nullptr) { dispatch_url("settings:///system/time-date"); } - else if ((g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0)) + else +#endif + if ((g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0)) { execute_command("unity-control-center datetime"); } @@ -128,6 +135,7 @@ void LiveActions::desktop_open_calendar_app(const DateTime& dt) **** ***/ +#ifdef HAS_URLDISPATCHER void LiveActions::phone_open_alarm_app() { dispatch_url("appid://com.ubuntu.clock/clock/current-user-version"); @@ -135,6 +143,7 @@ void LiveActions::phone_open_alarm_app() void LiveActions::phone_open_appointment(const Appointment& appt) { + if (!appt.activation_url.empty()) { dispatch_url(appt.activation_url); @@ -160,6 +169,7 @@ void LiveActions::phone_open_settings_app() { dispatch_url("settings:///system/time-date"); } +#endif /*** **** -- cgit v1.2.3