| |
@@ -0,0 +1,58 @@
|
| |
+ From 3ff5540efc259c9d428841d4038a54f2bf76df11 Mon Sep 17 00:00:00 2001
|
| |
+ From: Harald Sitter <sitter@kde.org>
|
| |
+ Date: Thu, 14 Mar 2024 01:08:30 +0100
|
| |
+ Subject: [PATCH] resolve startup sound against ocean theme
|
| |
+
|
| |
+ this is a fairly dirty hotfix for 6.0. longer term we should look at
|
| |
+ porting from phonon to libcanberra so we don't need to faff about with
|
| |
+ file name resolution
|
| |
+
|
| |
+ BUG: 482716
|
| |
+ (cherry picked from commit 1d36279bceb2135725db0130714b8980b68c50b3)
|
| |
+ ---
|
| |
+ startkde/startplasma.cpp | 28 ++++++++++++++++++----------
|
| |
+ 1 file changed, 18 insertions(+), 10 deletions(-)
|
| |
+
|
| |
+ diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp
|
| |
+ index 24d23c837f6..e4e2246671e 100644
|
| |
+ --- a/startkde/startplasma.cpp
|
| |
+ +++ b/startkde/startplasma.cpp
|
| |
+ @@ -773,17 +773,25 @@ void playStartupSound()
|
| |
+ return;
|
| |
+ }
|
| |
+
|
| |
+ - QUrl soundURL;
|
| |
+ - const auto dataLocations = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
|
| |
+ - for (const QString &dataLocation : dataLocations) {
|
| |
+ - soundURL = QUrl::fromUserInput(soundFilename, dataLocation + QStringLiteral("/sounds"), QUrl::AssumeLocalFile);
|
| |
+ - if (soundURL.isLocalFile() && QFile::exists(soundURL.toLocalFile())) {
|
| |
+ - break;
|
| |
+ - } else if (!soundURL.isLocalFile() && soundURL.isValid()) {
|
| |
+ - break;
|
| |
+ + const QUrl soundURL = [soundFilename]() -> QUrl {
|
| |
+ + const auto dataLocations = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
|
| |
+ + for (const QString &dataLocation : dataLocations) {
|
| |
+ + // Quick and dirty sound theme resolution for ocean
|
| |
+ + // https://bugs.kde.org/show_bug.cgi?id=482716
|
| |
+ + for (const auto &subdir : {u"/sounds/"_s, u"/sounds/ocean/stereo/"_s}) {
|
| |
+ + for (const auto &suffix : {QString(), u".oga"_s, u".ogg"_s, u".wav"_s}) {
|
| |
+ + const QUrl soundURL = QUrl::fromUserInput(soundFilename + suffix, dataLocation + subdir, QUrl::AssumeLocalFile);
|
| |
+ + if (soundURL.isLocalFile() && QFile::exists(soundURL.toLocalFile())) {
|
| |
+ + return soundURL;
|
| |
+ + }
|
| |
+ + if (!soundURL.isLocalFile() && soundURL.isValid()) {
|
| |
+ + return soundURL;
|
| |
+ + }
|
| |
+ + }
|
| |
+ + }
|
| |
+ }
|
| |
+ - soundURL.clear();
|
| |
+ - }
|
| |
+ + return {};
|
| |
+ + }();
|
| |
+ if (soundURL.isEmpty()) {
|
| |
+ qCWarning(PLASMA_STARTUP) << "Audio notification requested, but sound file from notifyrc file was not found, aborting audio notification";
|
| |
+ audioOutput->deleteLater();
|
| |
+ --
|
| |
+ GitLab
|
| |
+
|
| |
fixing the missing startup sound problem by two patches:
https://invent.kde.org/plasma/plasma-workspace/-/commit/873c7e0f97fc811c10bf36494a6bd9f0d43fe1c4
Patch 1: https://invent.kde.org/plasma/plasma-workspace/-/commit/873c7e0f97fc811c10bf36494a6bd9f0d43fe1c4.patch
https://invent.kde.org/plasma/plasma-workspace/-/commit/3ff5540efc259c9d428841d4038a54f2bf76df11
Patch 2: https://invent.kde.org/plasma/plasma-workspace/-/commit/3ff5540efc259c9d428841d4038a54f2bf76df11.patch
Thanks to Harald Sitter and Nicolas Fella @kde.org