]> cloud.milkyroute.net Git - dolphin.git/commitdiff
[dolphin/search] Avoid unnecesary reloads on setSearchPath
authorIsmael Asensio <isma.af@mgmail.com>
Mon, 7 Oct 2019 19:50:59 +0000 (21:50 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Mon, 7 Oct 2019 19:50:59 +0000 (21:50 +0200)
Summary:
Check in `setSearchPath()` if the `url` passed is already the `searchPath`
This was causing an effect where reloading the same search URL results on buttons `From Here/Everywhere` toggling.
See D24422

Test Plan:
On your home folder press `Ctrl-F` several times
Buttons `From Here/Everywhere` should now not toggle each time

Reviewers: #dolphin, elvisangelaccio, meven, ngraham

Reviewed By: #dolphin, ngraham

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D24449

src/search/dolphinsearchbox.cpp

index f3dd204626a77cd54f99ca34a2e41b3a19f7e0aa..6a87edc9e05b43c7c1bc27839c7bbb22e2b5f0c3 100644 (file)
@@ -81,6 +81,10 @@ QString DolphinSearchBox::text() const
 
 void DolphinSearchBox::setSearchPath(const QUrl& url)
 {
+    if (url == m_searchPath) {
+        return;
+    }
+
     m_searchPath = url;
 
     QFontMetrics metrics(m_fromHereButton->font());