aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.build.yml15
-rw-r--r--data/CMakeLists.txt4
-rw-r--r--data/org.ayatana.sound.gschema.xml9
-rw-r--r--debian/copyright1
-rw-r--r--src/options-gsettings.vala10
-rw-r--r--tests/CMakeLists.txt5
-rw-r--r--tests/integration/indicator-sound-test-base.cpp10
7 files changed, 30 insertions, 24 deletions
diff --git a/.build.yml b/.build.yml
index 69181d5..63b9ae3 100644
--- a/.build.yml
+++ b/.build.yml
@@ -46,6 +46,7 @@ requires:
- libaccountsservice-dev
# - libayatana-common-dev
# - libgmenuharness-dev
+# - lomiri-schemas
- gobject-introspection
- libgirepository1.0-dev
- liblomiri-url-dispatcher-dev
@@ -85,6 +86,7 @@ requires:
- libaccountsservice-dev
# - libayatana-common-dev
# - libgmenuharness-dev
+# - lomiri-schemas
- gobject-introspection
- libgirepository1.0-dev
- liblomiri-url-dispatcher-dev
@@ -122,6 +124,7 @@ requires:
- valac
- libaccountsservice-dev
# - libayatana-common-dev
+# - lomiri-schemas
- libgmenuharness-dev
- gobject-introspection
- libgirepository1.0-dev
@@ -161,6 +164,7 @@ requires:
- libaccountsservice-dev
# - libayatana-common-dev
# - libgmenuharness-dev
+# - lomiri-schemas
- gobject-introspection
- libgirepository1.0-dev
# - liblomiri-url-dispatcher-dev
@@ -214,6 +218,17 @@ before_scripts:
- cd -
- rm -Rf libayatana-common-build/
-
+ - cd ${START_DIR}
+ - if [ ! -d lomiri-schemas-build ]; then
+ - git clone --depth 1 https://gitlab.com/ubports/core/lomiri-schemas.git lomiri-schemas-build
+ - fi
+ - cd lomiri-schemas-build
+ - cmake . -DCMAKE_INSTALL_PREFIX=/usr
+ - make
+ - make install
+ - cd -
+ - rm -Rf lomiri-schemas-build/
+ -
- # Ubuntu focal needs lomiri-api, all others have it
- if [ ${DISTRO_NAME} == "ubuntu" ] && [ ${DISTRO_VERSION} == "focal" ]; then
- cd ${START_DIR}
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index c7634b8..f2873d9 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -66,10 +66,6 @@ install(
add_schema ("org.ayatana.indicator.sound.gschema.xml")
-if(NOT EXISTS /usr/share/glib-2.0/schemas/com.lomiri.sound.gschema.xml)
- add_schema ("org.ayatana.sound.gschema.xml")
-endif()
-
#########################################
# Accounts Service Iface: Sound Indicator
#########################################
diff --git a/data/org.ayatana.sound.gschema.xml b/data/org.ayatana.sound.gschema.xml
deleted file mode 100644
index 8c3bd73..0000000
--- a/data/org.ayatana.sound.gschema.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schemalist gettext-domain="ayatana-indicator-sound">
- <schema path="/org/ayatana/sound/" id="org.ayatana.sound">
- <key type="b" name="allow-amplified-volume">
- <default>false</default>
- <summary>Whether the volume slider allows setting the volume above 100%</summary>
- </key>
- </schema>
-</schemalist>
diff --git a/debian/copyright b/debian/copyright
index 4a38479..360c069 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -133,7 +133,6 @@ Files: AUTHORS
data/org.ayatana.indicator.sound.AccountsService.policy
data/org.ayatana.indicator.sound.AccountsService.xml
data/org.ayatana.indicator.sound.gschema.xml
- data/org.ayatana.sound.gschema.xml
include/CMakeLists.txt
include/lomiri/CMakeLists.txt
po/CMakeLists.txt
diff --git a/src/options-gsettings.vala b/src/options-gsettings.vala
index 5691a17..17e07c6 100644
--- a/src/options-gsettings.vala
+++ b/src/options-gsettings.vala
@@ -1,6 +1,7 @@
/*
* -*- Mode:Vala; indent-tabs-mode:t; tab-width:4; encoding:utf8 -*-
* Copyright 2015 Canonical Ltd.
+ * Copyright 2021 Robert Tari
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,6 +17,7 @@
*
* Authors:
* Charles Kerr <charles.kerr@canonical.com>
+ * Robert Tari <robert@tari.in>
*/
using PulseAudio;
@@ -33,8 +35,6 @@ public class IndicatorSound.OptionsGSettings : Options
private Settings _settings = new Settings ("org.ayatana.indicator.sound");
#if HAS_LOMIRI_SOUND_SCHEMA
private Settings _shared_settings = new Settings ("com.lomiri.sound");
-#else
- private Settings _shared_settings = new Settings ("org.ayatana.sound");
#endif
/** MAX VOLUME PROPERTY **/
@@ -45,7 +45,9 @@ 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_SOUND_SCHEMA
_shared_settings.changed[ALLOW_AMP_KEY].connect(() => update_max_volume());
+#endif
update_max_volume();
}
private void update_max_volume () {
@@ -58,9 +60,13 @@ public class IndicatorSound.OptionsGSettings : Options
}
}
private double calculate_max_volume () {
+#if HAS_LOMIRI_SOUND_SCHEMA
unowned string decibel_key = _shared_settings.get_boolean(ALLOW_AMP_KEY)
? AMP_dB_KEY
: NORMAL_dB_KEY;
+#else
+ unowned string decibel_key = NORMAL_dB_KEY;
+#endif
var volume_dB = _settings.get_double(decibel_key);
var volume_sw = PulseAudio.Volume.sw_from_dB (volume_dB);
return VolumeControlPulse.volume_to_double (volume_sw);
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 75dab34..30b0e13 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -34,10 +34,7 @@ add_custom_target (
set (XDG_DATA_DIRS "${CMAKE_CURRENT_BINARY_DIR}/gsettings-schemas")
set (SCHEMA_DIR "${XDG_DATA_DIRS}/glib-2.0/schemas")
if (EXISTS /usr/share/glib-2.0/schemas/com.lomiri.sound.gschema.xml)
- set (SOUND_SCHEMA /usr/share/glib-2.0/schemas/com.lomiri.sound.gschema.xml)
add_definitions ( -DHAS_LOMIRI_SOUND_SCHEMA )
-else()
- set (SOUND_SCHEMA ${CMAKE_SOURCE_DIR}/data/org.ayatana.sound.gschema.xml)
endif()
add_definitions(-DSCHEMA_DIR="${SCHEMA_DIR}")
execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas
@@ -47,7 +44,7 @@ add_custom_command (OUTPUT gschemas.compiled
DEPENDS ${CMAKE_SOURCE_DIR}/data/org.ayatana.indicator.sound.gschema.xml
COMMAND mkdir -p ${SCHEMA_DIR}
COMMAND cp -f ${CMAKE_SOURCE_DIR}/data/org.ayatana.indicator.sound.gschema.xml ${SCHEMA_DIR}
- COMMAND cp -f ${SOUND_SCHEMA} ${SCHEMA_DIR}
+ COMMAND test -e /usr/share/glib-2.0/schemas/com.lomiri.sound.gschema.xml && cp -f /usr/share/glib-2.0/schemas/com.lomiri.sound.gschema.xml ${SCHEMA_DIR} || echo "File does not exist" >&2
COMMAND ${COMPILE_SCHEMA_EXECUTABLE} ${SCHEMA_DIR})
add_custom_target (
diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp
index 45e8acc..3217764 100644
--- a/tests/integration/indicator-sound-test-base.cpp
+++ b/tests/integration/indicator-sound-test-base.cpp
@@ -179,18 +179,20 @@ bool IndicatorSoundTestBase::clearGSettingsPlayers()
bool IndicatorSoundTestBase::resetAllowAmplifiedVolume()
{
+#if HAS_LOMIRI_SOUND_SCHEMA
QProcess proc;
proc.start("gsettings", QStringList()
<< "reset"
-#ifdef HAS_LOMIRI_SOUND_SCHEMA
+
<< "com.lomiri.sound"
-#else
- << "org.ayatana.sound"
-#endif
+
<< "allow-amplified-volume");
return runProcess(proc);
+#else
+ return TRUE;
+#endif
}
bool IndicatorSoundTestBase::runProcess(QProcess& proc)