diff options
author | Wolfgang Müller | 2024-09-20 13:25:04 +0200 |
---|---|---|
committer | Wolfgang Müller | 2024-09-20 13:25:04 +0200 |
commit | f3ddcefff67f889ddc43c5d5c85f5966730ac07d (patch) | |
tree | 599d86b3e4332f70d8e1a8f4625e171d90eb6b69 /desktop-plasma/patches | |
parent | 97eb77b642ae1a6afe0e220527fb21f9821119ec (diff) | |
download | portage-roles-f3ddcefff67f889ddc43c5d5c85f5966730ac07d.tar.gz |
desktop-plasma: Update patch for place URLs
This is the patch that landed upstream and will be backported to 24.08.
Diffstat (limited to 'desktop-plasma/patches')
-rw-r--r-- | desktop-plasma/patches/kde-apps/dolphin/0001-Ignore-trailing-slashes-when-comparing-place-URLs.patch | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/desktop-plasma/patches/kde-apps/dolphin/0001-Ignore-trailing-slashes-when-comparing-place-URLs.patch b/desktop-plasma/patches/kde-apps/dolphin/0001-Ignore-trailing-slashes-when-comparing-place-URLs.patch index f950cc0..385da80 100644 --- a/desktop-plasma/patches/kde-apps/dolphin/0001-Ignore-trailing-slashes-when-comparing-place-URLs.patch +++ b/desktop-plasma/patches/kde-apps/dolphin/0001-Ignore-trailing-slashes-when-comparing-place-URLs.patch @@ -1,6 +1,6 @@ -From 4ff2cd4d5860b8db8c2cf4f054124d1bdc24f412 Mon Sep 17 00:00:00 2001 +From 046ddcf5607e597cd6290147bf7ee10c08e526dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20M=C3=BCller?= <wolf@oriole.systems> -Date: Wed, 18 Sep 2024 18:06:06 +0200 +Date: Thu, 19 Sep 2024 11:46:09 +0200 Subject: [PATCH] Ignore trailing slashes when comparing place URLs There's two locations where place URLs are compared in Dolphin. One @@ -27,32 +27,31 @@ use KFilePlacesModel's closestItem() function to find the closest matching URL and then finally check whether the normalized URLs match exactly. --- - src/dolphincontextmenu.cpp | 5 +++-- - src/dolphinviewcontainer.cpp | 10 +++++----- - 2 files changed, 8 insertions(+), 7 deletions(-) + src/dolphincontextmenu.cpp | 5 ++--- + src/dolphinviewcontainer.cpp | 9 ++++----- + 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp -index 68f6dbd21..8f418aed5 100644 +index 68f6dbd21..3ce1d1d51 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp -@@ -381,9 +381,10 @@ bool DolphinContextMenu::placeExists(const QUrl &url) const +@@ -381,9 +381,8 @@ bool DolphinContextMenu::placeExists(const QUrl &url) const { const KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel(); - const auto &matchedPlaces = placesModel->match(placesModel->index(0, 0), KFilePlacesModel::UrlRole, url, 1, Qt::MatchExactly); -+ QUrl stripped_url = url.adjusted(QUrl::StripTrailingSlash); -+ QModelIndex url_index = placesModel->closestItem(stripped_url); - +- - return !matchedPlaces.isEmpty(); -+ return url_index.isValid() && placesModel->url(url_index).adjusted(QUrl::StripTrailingSlash) == stripped_url; ++ QModelIndex url_index = placesModel->closestItem(url); ++ return url_index.isValid() && placesModel->url(url_index).matches(url, QUrl::StripTrailingSlash); } QAction *DolphinContextMenu::createPasteAction() diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp -index ef76042b8..a74770fb5 100644 +index ef76042b8..e55519d04 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp -@@ -552,12 +552,12 @@ QString DolphinViewContainer::caption() const +@@ -552,12 +552,11 @@ QString DolphinViewContainer::caption() const } KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel(); @@ -62,10 +61,9 @@ index ef76042b8..a74770fb5 100644 - if (!matchedPlaces.isEmpty()) { - return placesModel->text(matchedPlaces.first()); -+ QUrl stripped_url = url().adjusted(QUrl::StripTrailingSlash); -+ QModelIndex url_index = placesModel->closestItem(stripped_url); ++ QModelIndex url_index = placesModel->closestItem(url()); + -+ if (url_index.isValid() && placesModel->url(url_index).adjusted(QUrl::StripTrailingSlash) == stripped_url) { ++ if (url_index.isValid() && placesModel->url(url_index).matches(url(), QUrl::StripTrailingSlash)) { + return placesModel->text(url_index); } |