#30 enable startup sound
Merged 3 months ago by loise. Opened 3 months ago by loise.
Unknown source rawhide  into  rawhide

@@ -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

+ 

@@ -0,0 +1,25 @@

+ From 873c7e0f97fc811c10bf36494a6bd9f0d43fe1c4 Mon Sep 17 00:00:00 2001

+ From: Nicolas Fella <nicolas.fella@gmx.de>

+ Date: Fri, 15 Mar 2024 12:03:17 +0100

+ Subject: [PATCH] Add missing Qt::StringLiterals using

+ 

+ ---

+  startkde/startplasma.cpp | 2 ++

+  1 file changed, 2 insertions(+)

+ 

+ diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp

+ index e4e2246671..874e07da5b 100644

+ --- a/startkde/startplasma.cpp

+ +++ b/startkde/startplasma.cpp

+ @@ -38,6 +38,8 @@

+  #include "../kcms/lookandfeel/lookandfeelmanager.h"

+  #include "debug.h"

+  

+ +using namespace Qt::StringLiterals;

+ +

+  QTextStream out(stderr);

+  

+  void sigtermHandler(int signalNumber)

+ -- 

+ GitLab

+ 

file modified
+8 -1
@@ -4,7 +4,7 @@

  Name:    plasma-workspace

  Summary: Plasma workspace, applications and applets

  Version: 6.0.2

- Release: 1%{?dist}

+ Release: 2%{?dist}

  

  License: BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND LGPL-3.0-only AND LGPL-3.0-or-later AND (GPL-2.0-only OR GPL-3.0-only) AND (LGPL-2.1-only OR LGPL-3.0-only) AND MIT

  URL:     https://invent.kde.org/plasma/%{name}
@@ -32,6 +32,10 @@

  # backport rudimentary auto-launch apps on reboot from 6.1 (drop with 6.1)

  Patch101:       https://invent.kde.org/plasma/plasma-workspace/-/commit/660988b0e30ee8ccac98c0cf164b142d70709675.patch

  

+ # enable sound themes correctly

+ Patch102:       https://invent.kde.org/plasma/plasma-workspace/-/commit/873c7e0f97fc811c10bf36494a6bd9f0d43fe1c4.patch

+ Patch103:       https://invent.kde.org/plasma/plasma-workspace/-/commit/3ff5540efc259c9d428841d4038a54f2bf76df11.patch

+ 

  ## upstreamable Patches

  

  ## downstream Patches
@@ -744,6 +748,9 @@

  

  

  %changelog

+ * Fri Mar 15 2024 Marie Loise Nolden <loise@kde.org> - 6.0.2-2

+ - fix startup sound by adding upstream patches

+ 

  * Tue Mar 12 2024 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 6.0.2-1

  - 6.0.2

  

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/a655fe785a1a478f944f5efcf1f45bf0

Pull-Request has been merged by loise

3 months ago