diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-11-22 21:14:00 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-11-22 21:14:00 +0100 |
commit | ddd9347a0621de1c1dedb257701b1cd47bbcede9 (patch) | |
tree | 768b50372b142d99003ea2def968a43d405c4a76 | |
parent | f71a7c1a160361c21b88b6612e102c33f2f21792 (diff) | |
parent | c8591cc9f90c13a3d7638e611d3e53570ae9cc4d (diff) | |
download | ayatana-indicator-power-ddd9347a0621de1c1dedb257701b1cd47bbcede9.tar.gz ayatana-indicator-power-ddd9347a0621de1c1dedb257701b1cd47bbcede9.tar.bz2 ayatana-indicator-power-ddd9347a0621de1c1dedb257701b1cd47bbcede9.zip |
Merge branch 'tari01-pr/drop-sounds'
Attributes GH PR #51: https://github.com/AyatanaIndicators/ayatana-indicator-power/pull/51
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | data/CMakeLists.txt | 9 | ||||
-rw-r--r-- | data/sounds/Low battery.ogg | bin | 71140 -> 0 bytes | |||
-rw-r--r-- | src/notifier.c | 3 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tests/test-notify.cc | 4 |
6 files changed, 4 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 02383e0..4937ae4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ add_definitions( -DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}" -DG_LOG_DOMAIN="${GETTEXT_PACKAGE}" -DLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}" - -DLOW_BATTERY_SOUND="Low battery.ogg" + -DLOW_BATTERY_SOUND="LowBattery.ogg" ) ## diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 5cfbcc7..ec46edd 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -69,12 +69,3 @@ set (AYATANA_INDICATOR_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${AYATANA_INDICATOR_NAM install (FILES "${AYATANA_INDICATOR_FILE}" DESTINATION "${AYATANA_INDICATOR_DIR}") - -## -## Sounds -## - -# where to install -set (DATA_HOME "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}") -message (STATUS "${DATA_HOME} is the sounds/ install dir") -install (DIRECTORY sounds DESTINATION ${DATA_HOME}) diff --git a/data/sounds/Low battery.ogg b/data/sounds/Low battery.ogg Binary files differdeleted file mode 100644 index f6f9fb6..0000000 --- a/data/sounds/Low battery.ogg +++ /dev/null diff --git a/src/notifier.c b/src/notifier.c index c5b6eb1..3685a76 100644 --- a/src/notifier.c +++ b/src/notifier.c @@ -322,7 +322,8 @@ notification_show(IndicatorPowerNotifier * self) } else { - g_warning("Unable to find '%s' in XDG data dirs", LOW_BATTERY_SOUND); + g_message("Unable to find '%s' in XDG data dirs, falling back to /usr/share/sounds/lomiri/notifications/", LOW_BATTERY_SOUND); + notify_notification_set_hint(nn, "sound-file", g_variant_new_string("file:///usr/share/sounds/lomiri/notifications/" LOW_BATTERY_SOUND)); } } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 662c114..714e9a7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,11 +14,6 @@ set_directory_properties (PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES gschemas.compiled) set_source_files_properties (gschemas.compiled GENERATED) -# make a XDG_DATA_HOME for sounds/ -set(XDG_DATA_HOME "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}") -add_definitions(-DXDG_DATA_HOME="${XDG_DATA_HOME}") -file(COPY "${CMAKE_SOURCE_DIR}/data/sounds" DESTINATION "${XDG_DATA_HOME}/${CMAKE_PROJECT_NAME}") - # GSettings: # compile the ayatana-indicator-power schema into a gschemas.compiled file in this directory, # and help the tests to find that file by setting -DSCHEMA_DIR diff --git a/tests/test-notify.cc b/tests/test-notify.cc index eebd8c4..0732ece 100644 --- a/tests/test-notify.cc +++ b/tests/test-notify.cc @@ -77,8 +77,6 @@ protected: { super::SetUp(); - g_setenv ("XDG_DATA_HOME", XDG_DATA_HOME, TRUE); - // init DBusMock / dbus-test-runner service = dbus_test_service_new(nullptr); @@ -393,7 +391,7 @@ TEST_F(NotifyFixture, EventsThatChangeNotifications) TRUE); // the file we expect to play on a low battery notification... - const char* expected_file = XDG_DATA_HOME "/" GETTEXT_PACKAGE "/sounds/" LOW_BATTERY_SOUND; + const char* expected_file = "/usr/share/sounds/lomiri/notifications/" LOW_BATTERY_SOUND; char* tmp = g_filename_to_uri(expected_file, nullptr, nullptr); const std::string low_power_uri {tmp}; g_clear_pointer(&tmp, g_free); |