diff options
author | Robert Tari <robert@tari.in> | 2021-12-16 13:16:20 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-02-17 16:49:35 +0100 |
commit | 61d803b7701f030f5f8e1bf1f0b183056ee4dfc4 (patch) | |
tree | 6960ca929e5db71b44256ae3901e5078b6125625 /src | |
parent | 111165eede28d96c9687c93999d528d39a5a2954 (diff) | |
download | ayatana-indicator-sound-61d803b7701f030f5f8e1bf1f0b183056ee4dfc4.tar.gz ayatana-indicator-sound-61d803b7701f030f5f8e1bf1f0b183056ee4dfc4.tar.bz2 ayatana-indicator-sound-61d803b7701f030f5f8e1bf1f0b183056ee4dfc4.zip |
Make Lomiri features configurable at build time
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/accounts-service-access.vala | 2 | ||||
-rw-r--r-- | src/accounts-service-user.vala | 12 | ||||
-rw-r--r-- | src/options-gsettings.vala | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6e24fb2..6cd24f9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,8 +6,8 @@ set(HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.h") set(SYMBOLS_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.def") set(VAPI_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.vapi") -if(LOMIRI_SCHEMAS_FOUND) - set (VALA_DEFINE_HAS_LOMIRI_SCHEMAS "--define=HAS_LOMIRI_SCHEMAS") +if(ENABLE_LOMIRI_FEATURES) + set (VALA_DEFINE_LOMIRI_FEATURES_ENABLED "--define=LOMIRI_FEATURES_ENABLED") set (VALA_FILE_ACCTSERVICE_PRIVACY_SETTINGS "accounts-service-privacy-settings") set (VALA_FILE_ACCTSERVICE_SYSTEMSOUND_SETTINGS "accounts-service-system-sound-settings") endif() @@ -41,7 +41,7 @@ vala_init(ayatana-indicator-sound-service --vapidir=${CMAKE_SOURCE_DIR}/vapi/ --vapidir=. --pkg=bus-watcher - ${VALA_DEFINE_HAS_LOMIRI_SCHEMAS} + ${VALA_DEFINE_LOMIRI_FEATURES_ENABLED} ) vala_add(ayatana-indicator-sound-service @@ -196,7 +196,7 @@ vala_add(ayatana-indicator-sound-service accounts-service-sound-settings.vala ) -if(LOMIRI_SCHEMAS_FOUND) +if(ENABLE_LOMIRI_FEATURES) vala_add(ayatana-indicator-sound-service accounts-service-privacy-settings.vala ) diff --git a/src/accounts-service-access.vala b/src/accounts-service-access.vala index 373e294..c6b53d7 100644 --- a/src/accounts-service-access.vala +++ b/src/accounts-service-access.vala @@ -143,7 +143,7 @@ public class AccountsServiceAccess : Object string user_path; if (user_path_variant.check_format_string ("(o)", true)) { user_path_variant.get ("(o)", out user_path); -#if HAS_LOMIRI_SCHEMAS +#if LOMIRI_FEATURES_ENABLED _user_proxy = yield new DBusProxy.for_bus (BusType.SYSTEM, DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, "org.freedesktop.Accounts", user_path, "com.lomiri.AccountsService.Sound"); #endif } else { diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala index 9580c25..106204a 100644 --- a/src/accounts-service-user.vala +++ b/src/accounts-service-user.vala @@ -23,7 +23,7 @@ public class AccountsServiceUser : Object { Act.UserManager accounts_manager = Act.UserManager.get_default(); Act.User? user = null; AccountsServiceSoundSettings? proxy = null; -#if HAS_LOMIRI_SCHEMAS +#if LOMIRI_FEATURES_ENABLED AccountsServicePrivacySettings? privacyproxy = null; AccountsServiceSystemSoundSettings? syssoundproxy = null; #endif @@ -40,7 +40,7 @@ public class AccountsServiceUser : Object { } set { _silentMode = value; -#if HAS_LOMIRI_SCHEMAS +#if LOMIRI_FEATURES_ENABLED if (syssoundproxy != null) syssoundproxy.silent_mode = value; #endif @@ -147,7 +147,7 @@ public class AccountsServiceUser : Object { DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, new_sound_proxy); -#if HAS_LOMIRI_SCHEMAS +#if LOMIRI_FEATURES_ENABLED Bus.get_proxy.begin<AccountsServicePrivacySettings> ( BusType.SYSTEM, "org.freedesktop.Accounts", @@ -157,7 +157,7 @@ public class AccountsServiceUser : Object { new_privacy_proxy); #endif -#if HAS_LOMIRI_SCHEMAS +#if LOMIRI_FEATURES_ENABLED Bus.get_proxy.begin<AccountsServiceSystemSoundSettings> ( BusType.SYSTEM, "org.freedesktop.Accounts", @@ -189,7 +189,7 @@ public class AccountsServiceUser : Object { } } -#if HAS_LOMIRI_SCHEMAS +#if LOMIRI_FEATURES_ENABLED void new_privacy_proxy (GLib.Object? obj, AsyncResult res) { try { this.privacyproxy = Bus.get_proxy.end (res); @@ -214,7 +214,7 @@ public class AccountsServiceUser : Object { } #endif -#if HAS_LOMIRI_SCHEMAS +#if LOMIRI_FEATURES_ENABLED void new_system_sound_proxy (GLib.Object? obj, AsyncResult res) { try { this.syssoundproxy = Bus.get_proxy.end (res); diff --git a/src/options-gsettings.vala b/src/options-gsettings.vala index 48df2fe..6230158 100644 --- a/src/options-gsettings.vala +++ b/src/options-gsettings.vala @@ -33,7 +33,7 @@ public class IndicatorSound.OptionsGSettings : Options } private Settings _settings = new Settings ("org.ayatana.indicator.sound"); -#if HAS_LOMIRI_SCHEMAS +#if LOMIRI_FEATURES_ENABLED private Settings _shared_settings = new Settings ("com.lomiri.sound"); #endif /** MAX VOLUME PROPERTY **/ @@ -45,7 +45,7 @@ public class IndicatorSound.OptionsGSettings : Options private void init_max_volume() { _settings.changed[NORMAL_dB_KEY].connect(() => update_max_volume()); _settings.changed[AMP_dB_KEY].connect(() => update_max_volume()); -#if HAS_LOMIRI_SCHEMAS +#if LOMIRI_FEATURES_ENABLED _shared_settings.changed[ALLOW_AMP_KEY].connect(() => update_max_volume()); #endif update_max_volume(); @@ -60,7 +60,7 @@ public class IndicatorSound.OptionsGSettings : Options } } private double calculate_max_volume () { -#if HAS_LOMIRI_SCHEMAS +#if LOMIRI_FEATURES_ENABLED unowned string decibel_key = _shared_settings.get_boolean(ALLOW_AMP_KEY) ? AMP_dB_KEY : NORMAL_dB_KEY; |