┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinviewcontainer.cpp
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2021-07-04 22:15:17 +0200
committerElvis Angelaccio <[email protected]>2021-07-04 22:15:17 +0200
commit8ef8e03e212ba4e51060a019ea0ac304c9a568a2 (patch)
tree608e1c5504269f5a9e3a09a93e4edfb34305950f /src/dolphinviewcontainer.cpp
parentfb210d6ec42f1a8fb301c187ca09c4e7647459ef (diff)
Fix regex porting regression
QAbstractItemModel::match() under the hood uses QRegExp::exactMatch(), so with QRegularExpression we need to use anchoredPattern() on the pattern. Regression spotted by a failing dolphinmainwindowtest.
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
-rw-r--r--src/dolphinviewcontainer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index b92e8b6ef..dc7cacff4 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -476,7 +476,8 @@ QString DolphinViewContainer::caption() const
}
KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel();
- const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, QUrl(url().adjusted(QUrl::StripTrailingSlash).toString(QUrl::FullyEncoded).append("/?")), 1, Qt::MatchRegularExpression);
+ const QString pattern = url().adjusted(QUrl::StripTrailingSlash).toString(QUrl::FullyEncoded).append("/?");
+ const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, QRegularExpression::anchoredPattern(pattern), 1, Qt::MatchRegularExpression);
if (!matchedPlaces.isEmpty()) {
return placesModel->text(matchedPlaces.first());