Bug 445071

Summary: Fails to load images that contain a ` character.
Product: [Plasma] kdeplasma-addons Reporter: northon_patrick3
Component: Media FrameAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: nate
Priority: NOR    
Version: 5.23.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.23.4

Description northon_patrick3 2021-11-06 12:25:36 UTC
qml: Error while getting next image Error loading image: Malformed URL /home/elrick/Pictures/test%60test.webp.

The image contain a ` character and it fails to load.

SOFTWARE/OS VERSIONS
OS: Arch Linux
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 
Qt Version: 5.15.2
Comment 1 northon_patrick3 2021-11-08 01:23:30 UTC
More info:

```
QUrl url1{"/tmp/test`test.txt"};
std::cout << url1.toString(QUrl::PreferLocalFile).toStdString() << '\n';
QUrl url2{"file:///tmp/test`test.txt"};
std::cout << url2.toString(QUrl::PreferLocalFile).toStdString() << '\n';
```

will output:
```
/tmp/test%60test.txt
/tmp/test`test.txt
```
Comment 2 Bug Janitor Service 2021-11-08 16:40:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/95
Comment 3 Bug Janitor Service 2021-11-08 16:40:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/95
Comment 4 northon_patrick3 2021-11-10 21:23:01 UTC
Git commit 181cc49c4d44a4ac926051ebf9a53d0a8fc6b253 by Patrick Northon.
Committed on 08/11/2021 at 16:34.
Pushed by ngraham into branch 'master'.

[mediaframe] Make files added from paths into URLs.

This make it consistent with individual files added and fix a problem where the url isn't converted to a path properly in some conditions when the url doesn't contain the schema (file://).

M  +1    -1    applets/mediaframe/plugin/mediaframe.cpp

https://invent.kde.org/plasma/kdeplasma-addons/commit/181cc49c4d44a4ac926051ebf9a53d0a8fc6b253
Comment 5 Nate Graham 2021-11-10 21:23:37 UTC
Git commit 5e16b5ab644748fbf38c2b7fa7113d8dc99bcc28 by Nate Graham, on behalf of Patrick Northon.
Committed on 10/11/2021 at 21:23.
Pushed by ngraham into branch 'Plasma/5.23'.

[mediaframe] Make files added from paths into URLs.

This make it consistent with individual files added and fix a problem where the url isn't converted to a path properly in some conditions when the url doesn't contain the schema (file://).


(cherry picked from commit 181cc49c4d44a4ac926051ebf9a53d0a8fc6b253)

M  +1    -1    applets/mediaframe/plugin/mediaframe.cpp

https://invent.kde.org/plasma/kdeplasma-addons/commit/5e16b5ab644748fbf38c2b7fa7113d8dc99bcc28