aboutsummaryrefslogtreecommitdiff
path: root/src/actions-live.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/actions-live.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/actions-live.cpp')
-rw-r--r--src/actions-live.cpp12
1 files changed, 11 insertions, 1 deletions
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 <datetime/actions-live.h>
+#ifdef HAS_URLDISPATCHER
#include <url-dispatcher.h>
+#endif
#include <glib.h>
@@ -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
/***
****