mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
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
This commit is contained in:
parent
ada16756d6
commit
c5a713763d
1 changed files with 1 additions and 1 deletions
|
@ -426,7 +426,7 @@ QString DolphinViewContainer::placesText() const
|
||||||
if (isSearchModeEnabled()) {
|
if (isSearchModeEnabled()) {
|
||||||
text = i18n("Search for %1 in %2", m_searchBox->text(), m_searchBox->searchPath().fileName());
|
text = i18n("Search for %1 in %2", m_searchBox->text(), m_searchBox->searchPath().fileName());
|
||||||
} else {
|
} else {
|
||||||
text = url().fileName();
|
text = url().adjusted(QUrl::StripTrailingSlash).fileName();
|
||||||
if (text.isEmpty()) {
|
if (text.isEmpty()) {
|
||||||
text = url().host();
|
text = url().host();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue