┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinviewcontainer.cpp
diff options
context:
space:
mode:
authorNazar Kalinowski <[email protected]>2019-09-15 20:36:05 +0200
committerElvis Angelaccio <[email protected]>2019-09-15 20:38:52 +0200
commit681d8bb6cd13005236c2f389a09e428204b4dd76 (patch)
treebd45302135f412dc6e1917a92f36c4dcfdf7e106 /src/dolphinviewcontainer.cpp
parent79bbadb2631966059ad0951adc4fd32c38cc5274 (diff)
Fix wrong window titles
Summary: BUG: 389135 FIXED-IN: 19.11.80 Currently dolphin shows a folder's name instead of a "place" name if the current path has trailing slash and place's name doesn't, or vice versa. This patch fixes this behavior, so that dolphin always shows a "place" name. The QUrl::FullyEncoded string conversion is required because that's how the places model stores the places URLs in the XML bookmarks file. Test Plan: Test configuration: https://imgur.com/a/U4zBp8c Before (wrong window titles are in red): https://imgur.com/a/dB4xRwo After (all window titles are correct): https://imgur.com/a/W7virBn Reviewers: #dolphin, elvisangelaccio Subscribers: elvisangelaccio, ngraham, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D23706
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
-rw-r--r--src/dolphinviewcontainer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index 9af1bc926..dcec1db09 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -456,7 +456,7 @@ QString DolphinViewContainer::caption() const
}
KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel();
- const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, url(), 1, Qt::MatchExactly);
+ const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, QUrl(url().adjusted(QUrl::StripTrailingSlash).toString(QUrl::FullyEncoded).append("/?")), 1, Qt::MatchRegExp);
if (!matchedPlaces.isEmpty()) {
return placesModel->text(matchedPlaces.first());