aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodney Dawes <dobey.pwns@gmail.com>2018-10-31 21:56:05 -0400
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-29 14:38:27 +0200
commitf557230cf66dd2278729201140c2d6812d9e3c72 (patch)
tree93b350235b0e77c2daa93e6119ede11130fec4c0
parent376c1bb19d81382c20e9453e58a69a5aa93270d0 (diff)
downloadayatana-indicator-datetime-f557230cf66dd2278729201140c2d6812d9e3c72.tar.gz
ayatana-indicator-datetime-f557230cf66dd2278729201140c2d6812d9e3c72.tar.bz2
ayatana-indicator-datetime-f557230cf66dd2278729201140c2d6812d9e3c72.zip
Replace ual with url-dispatcher.
We don't really hneed ubuntu-app-launch here directly, as the API provided by url-dispatcher gives us a way to query what app handles the calendar URL, as the indicator is a trusted process. This removes the extra dependency and simplifies building slightly.
-rw-r--r--CMakeLists.txt13
-rw-r--r--src/notifications.cpp24
2 files changed, 19 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6b46ee2..ef09a60 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,16 +66,17 @@ pkg_check_modules (SERVICE_DEPS REQUIRED
gstreamer-1.0>=1.2
libnotify>=0.7.6
properties-cpp>=0.0.1
- libaccounts-glib>=1.18)
+ libaccounts-glib>=1.18
+ messaging-menu>=0.8.2)
include_directories (SYSTEM ${SERVICE_DEPS_INCLUDE_DIRS})
-# lomiri-app-launch
+# lomiri-url-dispatcher
-pkg_check_modules(LOMIRIAPPLAUNCH lomiri-app-launch>=0)
-include_directories(${LOMIRIAPPLAUNCH_INCLUDE_DIRS})
+pkg_check_modules(URLDISPATCHER lomiri-url-dispatcher>=0)
+include_directories(${URLDISPATCHER_INCLUDE_DIRS})
-if(LOMIRIAPPLAUNCH_FOUND)
- add_definitions( -DHAS_LOMIRIAPPLAUNCH )
+if(URLDISPATCHER_FOUND)
+ add_definitions( -DHAS_URLDISPATCHER )
endif()
if(EXISTS "/usr/share/accountsservice/interfaces/com.ubuntu.touch.AccountsService.Sound.xml")
diff --git a/src/notifications.cpp b/src/notifications.cpp
index 49300d8..7098cfc 100644
--- a/src/notifications.cpp
+++ b/src/notifications.cpp
@@ -24,9 +24,8 @@
#include <messaging-menu/messaging-menu-app.h>
#include <messaging-menu/messaging-menu-message.h>
-#ifdef HAS_LOMIRIAPPLAUNCH
-#include <liblomiri-app-launch/lomiri-app-launch/appid.h>
-#include <liblomiri-app-launch/lomiri-app-launch/registry.h>
+#ifdef HAS_URLDISPATCHER
+#include <lomiri-url-dispatcher.h>
#endif
#include <uuid/uuid.h>
@@ -463,16 +462,17 @@ private:
static std::string calendar_app_id()
{
- #ifdef HAS_LOMIRIAPPLAUNCH
- auto registry = std::make_shared<lomiri::app_launch::Registry>();
- auto app_id = lomiri::app_launch::AppID::discover(registry, "lomiri-calendar-app");
-
- if (!app_id.empty())
+ #ifdef HAS_URLDISPATCHER
+ auto urls = g_strsplit("calendar://", ",", 0);
+ auto appids = lomiri_url_dispatch_url_appid(const_cast<const gchar**>(urls));
+ g_strfreev(urls);
+ std::string result;
+ if (appids != nullptr) {
// Due the use of old API by messaging_menu we need append a extra ".desktop" to the app_id.
- return std::string(app_id) + ".desktop";
- else
- return std::string();
-
+ result = std::string(appids[0]) + ".desktop";
+ g_strfreev(appids);
+ }
+ return result;
#else
return std::string();
#endif