From c4bb3db0229bef8adee1daa183892cebba5efe72 Mon Sep 17 00:00:00 2001 From: Amol Godbole Date: Mon, 4 Sep 2023 07:39:13 +0000 Subject: Restore the URL when DolphinSearchBox is cleared Currently, the URL navigator is not updated when the search box is cleared. This MR restores the URL, by closing and reopening the box. The call for emitting closeRequest() on pressing Esc has been replaced with emitCloseRequest(). The wait duration before starting a search has been reduced to 500ms to increase responsiveness. Also, the bugfix for BUG: 423328 is slightly incorrect and causes the search term to not be displayed when opening a saved search for the first time. As a better solution for this bug, DolphinSearchBox::setText() now updates the text only if the text has changed. BUG: 473775 --- src/dolphinviewcontainer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/dolphinviewcontainer.cpp') diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 63d5bd27b..66a9a116a 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -84,6 +84,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl &url, QWidget *parent) m_searchBox = new DolphinSearchBox(this); m_searchBox->hide(); connect(m_searchBox, &DolphinSearchBox::activated, this, &DolphinViewContainer::activate); + connect(m_searchBox, &DolphinSearchBox::openRequest, this, &DolphinViewContainer::openSearchBox); connect(m_searchBox, &DolphinSearchBox::closeRequest, this, &DolphinViewContainer::closeSearchBox); connect(m_searchBox, &DolphinSearchBox::searchRequest, this, &DolphinViewContainer::startSearching); connect(m_searchBox, &DolphinSearchBox::focusViewRequest, this, &DolphinViewContainer::requestFocus); @@ -891,6 +892,11 @@ void DolphinViewContainer::startSearching() } } +void DolphinViewContainer::openSearchBox() +{ + setSearchModeEnabled(true); +} + void DolphinViewContainer::closeSearchBox() { setSearchModeEnabled(false); -- cgit v1.3