aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-11-24 10:11:34 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-12-15 14:34:47 +0100
commit14726b036bd6d87a1aa601c6de34584ee8412788 (patch)
treeae0f03d5fcd5634fc54e2721e57aefc1c1135952
parent01b36c885849a0af262a381469a394f4c9979cda (diff)
downloadayatana-indicator-power-14726b036bd6d87a1aa601c6de34584ee8412788.tar.gz
ayatana-indicator-power-14726b036bd6d87a1aa601c6de34584ee8412788.tar.bz2
ayatana-indicator-power-14726b036bd6d87a1aa601c6de34584ee8412788.zip
Check for lomiri-schemas package instead of individual files
-rw-r--r--CMakeLists.txt9
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/notifier.c12
3 files changed, 11 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4937ae4..1de415a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,11 +68,10 @@ pkg_check_modules(SERVICE_DEPS REQUIRED
include_directories (SYSTEM ${SERVICE_DEPS_INCLUDE_DIRS})
-if(EXISTS "/usr/share/accountsservice/interfaces/com.lomiri.touch.AccountsService.Sound.xml")
- set (HAS_LOMIRI_ACCTSERVICE_SOUND ON)
- add_definitions ( -DHAS_LOMIRI_ACCTSERVICE_SOUND )
-else()
- set (HAS_LOMIRI_ACCTSERVICE_SOUND OFF)
+pkg_check_modules(LOMIRI_SCHEMAS lomiri-schemas)
+
+if(LOMIRI_SCHEMAS_FOUND)
+ add_definitions ( -DHAS_LOMIRI_SCHEMAS )
endif()
##
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d50d065..38d3308 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -28,7 +28,7 @@ add_gdbus_codegen_with_namespace(SERVICE_GENERATED_SOURCES dbus-testing
Dbus
${CMAKE_SOURCE_DIR}/data/org.ayatana.indicator.power.Testing.xml)
-if (HAS_LOMIRI_ACCTSERVICE_SOUND)
+if (LOMIRI_SCHEMAS_FOUND)
add_gdbus_codegen_with_namespace(SERVICE_GENERATED_SOURCES dbus-accounts-sound
com.lomiri.touch
Dbus
diff --git a/src/notifier.c b/src/notifier.c
index 3685a76..f8eda71 100644
--- a/src/notifier.c
+++ b/src/notifier.c
@@ -21,7 +21,7 @@
#include "datafiles.h"
-#ifdef HAS_LOMIRI_ACCTSERVICE_SOUND
+#ifdef HAS_LOMIRI_SCHEMAS
#include "dbus-accounts-sound.h"
#endif
@@ -86,7 +86,7 @@ typedef struct
gboolean actions_supported;
GCancellable * cancellable;
- #ifdef HAS_LOMIRI_ACCTSERVICE_SOUND
+ #ifdef HAS_LOMIRI_SCHEMAS
DbusAccountsServiceSound * accounts_service_sound_proxy;
gboolean accounts_service_sound_proxy_pending;
#endif
@@ -147,7 +147,7 @@ get_battery_power_level (IndicatorPowerDevice * battery)
**** Sounds
***/
-#ifdef HAS_LOMIRI_ACCTSERVICE_SOUND
+#ifdef HAS_LOMIRI_SCHEMAS
static void
on_sound_proxy_ready (GObject * source_object G_GNUC_UNUSED,
GAsyncResult * res,
@@ -309,7 +309,7 @@ notification_show(IndicatorPowerNotifier * self)
if (are_actions_supported(self))
{
- #ifdef HAS_LOMIRI_ACCTSERVICE_SOUND
+ #ifdef HAS_LOMIRI_SCHEMAS
if (!silent_mode(self))
#endif
{
@@ -454,7 +454,7 @@ my_dispose (GObject * o)
indicator_power_notifier_set_battery (self, NULL);
g_clear_object (&p->dbus_battery);
- #ifdef HAS_LOMIRI_ACCTSERVICE_SOUND
+ #ifdef HAS_LOMIRI_SCHEMAS
g_clear_object (&p->accounts_service_sound_proxy);
#endif
@@ -491,7 +491,7 @@ indicator_power_notifier_init (IndicatorPowerNotifier * self)
if (!instance_count++ && !notify_init(SERVICE_EXEC))
g_critical("Unable to initialize libnotify! Notifications might not be shown.");
- #ifdef HAS_LOMIRI_ACCTSERVICE_SOUND
+ #ifdef HAS_LOMIRI_SCHEMAS
p->accounts_service_sound_proxy_pending = TRUE;
gchar* object_path = g_strdup_printf("/org/freedesktop/Accounts/User%lu", (gulong)getuid());
dbus_accounts_service_sound_proxy_new_for_bus(