https://bugs.kde.org/show_bug.cgi?id=337276

--- Comment #17 from Harald Sitter <sit...@kde.org> ---
Git commit 4832f7d9f2f3bd0fa8ab9b9162bf50e855efc448 by Harald Sitter.
Committed on 09/05/2016 at 07:27.
Pushed by sitter into branch 'master'.

use QUrl::fromUserInput to construct sound url

QUrl() would treats it as a parsable uri, but they aren't e.g. # in a uri
separates segments in a local file path it simply is a #.
This "accidentally" worked in Phonon < 4.9 as Phonon obtained string
representations in a way that would bypass internal QUrl checks for
fileyness and URI ambiguity. Since 4.9 Phonon expects scheme-less URLs to
be local files, but QUrl() would most of the time not do that since it
would honestly think the soundfilename is a random (i.e. not necessarily
local) uri.

To fix this use QUrl::fromUserInput which behaves exactly like what we
need to properly resolve relative names, urls, paths, full URIs.

This now works with input of the type:
- Oxygen-Sys-Special.ogg
- /usr/share/sounds/Oxygen-Sys-Special.ogg
- file:///usr/share/sounds/Oxygen-Sys-Special.ogg
- /usr/share/sounds/#KDE-Im-Cant-#Connect.ogg
- file:///usr/share/sounds/#KDE-Im-Cant-#Connect.ogg
- http://people.ubuntu.com/~apachelogger/sounds/sounds-3.5/KDE_Glass_Break.ogg
(yes, we can have http notifications!!!! https://xkcd.com/1172/)
REVIEW: 127829

M  +13   -8    src/knotifyconfigactionswidget.cpp

http://commits.kde.org/knotifyconfig/4832f7d9f2f3bd0fa8ab9b9162bf50e855efc448

--- Comment #18 from Harald Sitter <sit...@kde.org> ---
Git commit 9db06adc8114163f401417064b07772139bc36bc by Harald Sitter.
Committed on 09/05/2016 at 07:27.
Pushed by sitter into branch 'master'.

use QUrl::fromUserInput to construct sound url

QUrl() would treats it as a parsable uri, but they aren't e.g. # in a uri
separates segments in a local file path it simply is a #.
This "accidentally" worked in Phonon < 4.9 as Phonon obtained string
representations in a way that would bypass internal QUrl checks for
fileyness and URI ambiguity. Since 4.9 Phonon expects scheme-less URLs to
be local files, but QUrl() would most of the time not do that since it
would honestly think the soundfilename is a random (i.e. not necessarily
local) uri.

To fix this use QUrl::fromUserInput which behaves exactly like what we
need to properly resolve relative names, urls, paths, full URIs.

This now works with input of the type:
- Oxygen-Sys-Special.ogg
- /usr/share/sounds/Oxygen-Sys-Special.ogg
- file:///usr/share/sounds/Oxygen-Sys-Special.ogg
- /usr/share/sounds/#KDE-Im-Cant-#Connect.ogg
- file:///usr/share/sounds/#KDE-Im-Cant-#Connect.ogg
- http://people.ubuntu.com/~apachelogger/sounds/sounds-3.5/KDE_Glass_Break.ogg
(yes, we can have http notifications!!!! https://xkcd.com/1172/)
REVIEW: 127830

M  +16   -9    src/notifybyaudio.cpp

http://commits.kde.org/knotifications/9db06adc8114163f401417064b07772139bc36bc

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to