diff options
| author | Elvis Angelaccio <[email protected]> | 2019-09-01 22:32:35 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2019-09-02 20:30:06 +0200 |
| commit | c5a713763daf113c78697341bfea7dc0860192a3 (patch) | |
| tree | 313633b3b156635aee3026b674d12f0692011f61 /src/dolphinviewcontainer.cpp | |
| parent | ada16756d69c012c089733f6ce4e9271f84ccca6 (diff) | |
Fix places text when the URL has a trailing slash
Summary: QUrl::fileName() returns an empty string if the URL ends with a slash.
Test Plan:
1. Run `dolphin /tmp` from command line
2. Right-click from viewport and click 'Add to Places'
Reviewers: ngraham
Subscribers: kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D23654
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 585610550..6a8ff914b 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -426,7 +426,7 @@ QString DolphinViewContainer::placesText() const if (isSearchModeEnabled()) { text = i18n("Search for %1 in %2", m_searchBox->text(), m_searchBox->searchPath().fileName()); } else { - text = url().fileName(); + text = url().adjusted(QUrl::StripTrailingSlash).fileName(); if (text.isEmpty()) { text = url().host(); } |
