diff options
author | Rodney Dawes <dobey.pwns@gmail.com> | 2018-10-31 21:56:05 -0400 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2021-07-09 03:36:53 +0200 |
commit | bdf012f78b2ffd7356adcaa707b977889671c190 (patch) | |
tree | f7bebb907ff1b6a5bcb17388b28c5c77e0d50779 /src | |
parent | d2fc9c2d86789797c93811ad4665bdd67adf9661 (diff) | |
download | ayatana-indicator-datetime-bdf012f78b2ffd7356adcaa707b977889671c190.tar.gz ayatana-indicator-datetime-bdf012f78b2ffd7356adcaa707b977889671c190.tar.bz2 ayatana-indicator-datetime-bdf012f78b2ffd7356adcaa707b977889671c190.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.
Diffstat (limited to 'src')
-rw-r--r-- | src/notifications.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
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 |