applets/kicker: fix filenames containing # in history

Reason for the change

Kicker takes the resource name as provided by PlasmaActivities.Stats and interprets it as an URL, setting the 'file' url scheme if necessary. This fails when the filenames contain a '#' character, as QUrl will interpret them as url fragments if not percent-encoded (which they are not for local files, but are for remote urls). This makes display and opening of such files fail in both Kicker and Kickoff.

Instead, we test whether it's an absolute path (the local history entries are) and if so, use QUrl.fromLocalFile to get the correct url. This is also what PlasmaActivities.Stats does in ResultSet (which is what the Task Manager uses, so everything works there already, but we want a real model here).

Test plan

  1. Create a text file "demo#test.txt"
  2. Open it in Kate
  3. Look for it in kickoff History / kicker Recent Files

Screenshots or screen recordings

N/A

Bugs fixed

BUG: 419449 BUG: 437960

FIXED-IN: 6.4.0

Edited by Christoph Wolk

Merge request reports

Loading