- pull in phonon-related path fixes (reviewboard#127830)
- update %check deps
epel8
Rex Dieter 9 years ago
parent af259d5579
commit f03b3f5c33

@ -9,7 +9,7 @@
Name: kf5-%{framework}
Version: 5.21.0
Release: 2%{?dist}
Release: 3%{?dist}
Summary: KDE Frameworks 5 Tier 2 solution with abstraction for system notifications
License: LGPLv2+
@ -24,6 +24,11 @@ URL: https://quickgit.kde.org/?p=%{framework}.git
%endif
Source0: http://download.kde.org/%{stable}/frameworks/%{versiondir}/%{framework}-%{version}.tar.xz
## upstream patches
# https://git.reviewboard.kde.org/r/127830
Patch100: knotifications-review127830.patch
BuildRequires: dbusmenu-qt5-devel
BuildRequires: extra-cmake-modules >= %{version}
BuildRequires: kf5-kcodecs-devel >= %{version}
@ -36,7 +41,9 @@ BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qttools-devel
BuildRequires: qt5-qtx11extras-devel
%if 0%{?tests}
BuildRequires: xorg-x11-server-Xvfb dbus-x11
BuildRequires: dbus-x11
BuildRequires: time
BuildRequires: xorg-x11-server-Xvfb
%endif
Requires: kf5-filesystem >= %{version}
@ -104,6 +111,10 @@ time make test -C %{_target_platform} ARGS="--output-on-failure --timeout 300" |
%changelog
* Thu May 05 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.21.0-3
- pull in phonon-related path fixes (reviewboard#127830)
- update %%check deps
* Thu Apr 28 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.21.0-2
- support bootstrap, %%check: enable tests (advisory)

@ -0,0 +1,37 @@
diff --git a/src/notifybyaudio.cpp b/src/notifybyaudio.cpp
index 6ae63b8df8e7aa692e88b03ca7b7538c78101917..903e9969895af543c9ef56b39c88b3072c1a099b 100644
--- a/src/notifybyaudio.cpp
+++ b/src/notifybyaudio.cpp
@@ -60,16 +60,23 @@ void NotifyByAudio::notify(KNotification *notification, KNotifyConfig *config)
return;
}
- QUrl soundURL = QUrl(soundFilename); // this CTOR accepts both absolute paths (/usr/share/sounds/blabla.ogg and blabla.ogg) w/o screwing the scheme
- if (soundURL.isRelative() && !soundURL.toString().startsWith('/')) { // QUrl considers url.scheme.isEmpty() == url.isRelative()
- soundURL = QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("sounds/") + soundFilename));
-
- if (soundURL.isEmpty()) {
- qCWarning(LOG_KNOTIFICATIONS) << "Audio notification requested, but sound file from notifyrc file was not found, aborting audio notification";
-
- finish(notification);
- return;
+ QUrl soundURL;
+ const auto dataLocations = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
+ foreach (const QString &dataLocation, dataLocations) {
+ soundURL = QUrl::fromUserInput(soundFilename,
+ dataLocation + "/sounds",
+ QUrl::AssumeLocalFile);
+ if (soundURL.isLocalFile() && QFile::exists(soundURL.toLocalFile())) {
+ break;
+ } else if (!soundURL.isLocalFile() && soundURL.isValid()) {
+ break;
}
+ soundURL.clear();
+ }
+ if (soundURL.isEmpty()) {
+ qCWarning(LOG_KNOTIFICATIONS) << "Audio notification requested, but sound file from notifyrc file was not found, aborting audio notification";
+ finish(notification);
+ return;
}
Phonon::MediaObject *m;
Loading…
Cancel
Save