Use QUrl::fromUserInput to construct sound url
ClosedPublic

Authored by wbauer on Apr 29 2018, 9:06 PM.

Details

Summary

Since Phonon 4.9, this code fails to play a login sound if the sound file is specified as absolute file path (without "file://"). The reason is that QUrl() treats the parameter as Url (not as file path), and this only accidentally worked with earlier Phonon versions but not any more.
This patch uses QUrl::fromUserInput() instead to create a QUrl from the string in the settings file, which fixes the problem.

This is the same change as https://phabricator.kde.org/R289:9db06adc8114163f401417064b07772139bc36bc in knotifications.
A more detailed explanation of the problem can be found in https://bugs.kde.org/show_bug.cgi?id=337276#c12 .

BUG: 392725
FIXED-IN: 5.12.5

Test Plan

Enabled the login sound and logged in with these lines in ~/.config/plasma_workspace.notifyrc:

  • Sound=/usr/share/sounds/Oxygen-Sys-Log-In-Long.ogg
  • Sound=Oxygen-Sys-Log-In-Long.ogg
  • Sound=file:///usr/share/sounds/Oxygen-Sys-Log-In-Long.ogg
  • and with no Sound= at all (which means it uses the one from the system-wide plasma_workspace.notifyrc, which happens to be Sound=Oxygen-Sys-Log-In-Short.ogg)

The login sound was played in every case now.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
wbauer created this revision.Apr 29 2018, 9:06 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 29 2018, 9:06 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
wbauer requested review of this revision.Apr 29 2018, 9:06 PM
wbauer edited the summary of this revision. (Show Details)Apr 29 2018, 9:32 PM
wbauer edited the summary of this revision. (Show Details)Apr 29 2018, 10:29 PM
davidedmundson accepted this revision.Apr 30 2018, 6:05 AM
This revision is now accepted and ready to land.Apr 30 2018, 6:05 AM
This revision was automatically updated to reflect the committed changes.

Forgot to ask: should I cherry-pick this to the 5.8 branch too?
Or is that completely dead already anyway?

It is not "dead" however it is now restricted to fixes for major bugs such as security and data loss.

It is not "dead" however it is now restricted to fixes for major bugs such as security and data loss.

Ok, I don't think this qualifies then...