diff options
| author | Amol Godbole <[email protected]> | 2023-10-03 21:38:47 -0500 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2023-10-05 09:43:23 +0000 |
| commit | 4d018e1c3cd5211c82cfe42a250956adfb47747b (patch) | |
| tree | 382be0878cd858d0ee6f16c6d73d7a5d72b5cefd /src/dolphinviewcontainer.cpp | |
| parent | ab92bc40492e8945af644704c783d1ef1a594cd4 (diff) | |
DolphinViewContainer: Keep search box open when URL is changed
The search box was being automatically closed whenever the URL is changed.
Keep the search box open if no search text had been entered when the URL
was changed.
BUG: 474951
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 66a9a116a..5b2a318d6 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -818,11 +818,13 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl &url) } if (KProtocolManager::supportsListing(url)) { - setSearchModeEnabled(isSearchUrl(url)); + const bool searchBoxInitialized = isSearchModeEnabled() && m_searchBox->text().isEmpty(); + setSearchModeEnabled(isSearchUrl(url) || searchBoxInitialized); + m_view->setUrl(url); tryRestoreViewState(); - if (m_autoGrabFocus && isActive() && !isSearchUrl(url)) { + if (m_autoGrabFocus && isActive() && !isSearchModeEnabled()) { // When an URL has been entered, the view should get the focus. // The focus must be requested asynchronously, as changing the URL might create // a new view widget. |
