Skip to content
Commit 1d8a39a1 authored by Stefano Crocco's avatar Stefano Crocco
Browse files

Improve behavior when kfmclient openURL is launched with invalid URL

If kfmclient openURL is launched with an invalid URL, filteredURL will
return an empty URL which causes Konqueror to display an "Undocumented
error" error message.

To avoid this, when filteredUrl returns an empty URL, use the user's
home URL, as if no URL had been specified. In this case we also ignore
the mimetype requested by the user (if any) because in most cases it
won't be correct for the new URL.

This situation can be triggered if the user clicks on the
`kfmclient_html.desktop` file. In theory, this shouldn't happen; however,
currently it's happening quite often, as can be seen, for example,
from [this bug report](https://bugs.kde.org/show_bug.cgi?id=453822)).
As far as I could discover, this bug happens because the application launcher
puts `kfmclient_html.desktop` in the "Favorites" section instead of `konqbrowser.desktop`.
Clicking on it executes `kfmclient openURL %u text/html`, passing a literal `%u` as argument.
Since `%u` isn't a valid URL, the behavior described above occurs.

While the correct fix for the bug itself is to find out why the application launcher uses `kfmclient_html.desktop`,
I think that `kfmclient` should nonetheless have a more user-friendly behavior in case an invalid URL is given.
parent 5b096b35
Pipeline #264894 passed with stage
in 7 minutes and 58 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment