From 929c53ab323d17aebae6278228c7a31353a3589e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 28 Mar 2018 10:36:02 +0000 Subject: URL dispatcher on non-Ubuntu: Fake it as best as possible, so that the unit tests are happy and succeed. --- src/actions-live.cpp | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/actions-live.cpp b/src/actions-live.cpp index 9225d30..e2fbf94 100644 --- a/src/actions-live.cpp +++ b/src/actions-live.cpp @@ -51,13 +51,15 @@ 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()); +#ifdef HAS_URLDISPATCHER url_dispatch_send(url.c_str(), nullptr, nullptr); -} +#else + // FIXME: Deal with this, if we build without liburl-dispatcher... #endif +} /*** **** @@ -65,13 +67,11 @@ 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 -#endif if ((g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0)) { execute_command("unity-control-center datetime"); @@ -137,11 +137,7 @@ void LiveActions::desktop_open_calendar_app(const DateTime& dt) void LiveActions::phone_open_alarm_app() { -#ifdef HAS_URLDISPATCHER dispatch_url("appid://com.ubuntu.clock/clock/current-user-version"); -#else - // FIXME: Deal with this, if we build without liburl-dispatcher... -#endif } void LiveActions::phone_open_appointment(const Appointment& appt) @@ -149,11 +145,7 @@ void LiveActions::phone_open_appointment(const Appointment& appt) if (!appt.activation_url.empty()) { -#ifdef HAS_URLDISPATCHER dispatch_url(appt.activation_url); -#else - // FIXME: Deal with this, if we build without liburl-dispatcher... -#endif } else switch (appt.type) { @@ -168,21 +160,13 @@ void LiveActions::phone_open_appointment(const Appointment& appt) void LiveActions::phone_open_calendar_app(const DateTime&) { -#ifdef HAS_URLDISPATCHER // does calendar app have a mechanism for specifying dates? dispatch_url("appid://com.ubuntu.calendar/calendar/current-user-version"); -#else - // FIXME: Deal with this, if we build without liburl-dispatcher... -#endif } void LiveActions::phone_open_settings_app() { -#ifdef HAS_URLDISPATCHER dispatch_url("settings:///system/time-date"); -#else - // FIXME: Deal with this, if we build without liburl-dispatcher... -#endif } /*** -- cgit v1.2.3