[Task Manager] Remove strict URL handling
ClosedPublic

Authored by broulik on Jan 27 2020, 2:14 PM.

Details

Summary

The code tried hard to ignore garbage URLs, as Qt is quite lenient, e.g. QUrl("Garbage Url") is still valid.
There is no way to change the strictness of a QUrl after creation, so the code would enforce it by doing QUrl strictUrl(inputUrl.toString(), QUrl::StrictMode).
However, toString() defaults to PrettyDecoded which avoids percent-encoding and keeps spaces in tact which is not a valid thing to have in a strict URL.
Effectively, we want to ensure a URL is either a valid path to a local file, or one of the special applications (for menu ids), or preferred for preferred applications, like web browser,

BUG: 385727
FIXED-IN: 5.18.0

Test Plan

Is this still good for 5.18?

  • Unit tests still pass
  • Comes with a new one to verify adding desktop entries with spaces works
  • Pinned an application which had spaces in its desktop file to the task bar:
    • Was successfully added with the menu
    • Was successfully merged with the window, if open
    • Was successfully restored/loaded on plasmashell restart
    • Was successfully removed with the context menu
  • Created a new activity, pinned an application which had spaces in its desktop file to only one activity:
    • Was successfully restored/hidden when switching activities
    • all of the above

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.
broulik created this revision.Jan 27 2020, 2:14 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 27 2020, 2:14 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Jan 27 2020, 2:14 PM

Works for me with all my use cases. I think this makes sense to go into 5.18.0 with enough testing (so thanks for the new unit test!).

ngraham accepted this revision.Jan 31 2020, 1:22 PM
This revision is now accepted and ready to land.Jan 31 2020, 1:22 PM
This revision was automatically updated to reflect the committed changes.