Skip to content
Commit 79a537ee authored by rk flx's avatar rk flx
Browse files

Prevent duplicate slashes in Recent Folders

Summary:
Sometimes the {nav Recent Folders} tab on the {nav Start Page} would
show directory entries with multiple `/` at the end. Clicking on those
folders works fine, but as the same folder could also be added without
two slashes, in some cases there were multiple entries for the same
location.

The duplicate slash is caused by a porting mistake in d760ced7,
which added `/` unconditionally while `KUrl::AddTrailingSlash` only
added `/` if there was none at the end. Performing this check manually
fixes the bug.

Note that the fix for Bug #312060 (differentiate between home and root
folder for remote hosts) and what was added in 7eb5472f (no password
dialog right after startup) are still in effect as well, even after
porting away from `KUrl`.

As a side effect, visiting `/` does not result anymore in broken
{nav Recent Folder} entries (non-functional and showing an error icon).
KIO warnings are gone, too:
  kf5.kio.core: Invalid URL: QUrl("")

CCBUG: 383850

Test Plan:
Open folder, {nav Go > Up}, switch to {nav Start Page} and notice how
now the added recent folder only has a single slash at the end. In
particular, there is only a single entry for this location after
navigating back and forth again.

Start `sshd`, `sftp://localhost` still shows home folder,
`sftp://localhost/` shows root dir. Killing `kiod` and restarting
Gwenview does not show a password prompt on the {nav Start Page}.

Visit `/`, switch back to {nav Start Page} and observe that the newly
added entry shows and works correctly.

Reviewers: #gwenview, muhlenpfordt

Reviewed By: #gwenview, muhlenpfordt

Subscribers: muhlenpfordt

Differential Revision: https://phabricator.kde.org/D11492
parent d2afcfe2
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