From: Peter Penz Date: Fri, 4 Feb 2011 19:55:52 +0000 (+0100) Subject: Don't clear the search-text when switching between tabs X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/236eac2ffa671fe9cd56c233925a19d8c89f1141 Don't clear the search-text when switching between tabs The clearing of the search-text should only be done when opening the search-box. --- diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index c46615bcc..1b921e678 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -212,6 +212,8 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled) m_urlNavigator->setVisible(!enabled); if (enabled) { + m_searchBox->clearText(); + // Remember the most recent non-search URL as search path // of the search-box, so that it can be restored // when switching back to the URL navigator. diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 68dc9da3c..f4588f67f 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -56,7 +56,6 @@ DolphinSearchBox::DolphinSearchBox(QWidget* parent) : QWidget(parent), m_startedSearching(false), - m_nepomukActivated(false), m_topLayout(0), m_searchInput(0), m_fileNameButton(0), @@ -142,6 +141,11 @@ void DolphinSearchBox::selectAll() m_searchInput->selectAll(); } +void DolphinSearchBox::clearText() +{ + m_searchInput->clear(); +} + bool DolphinSearchBox::event(QEvent* event) { if (event->type() == QEvent::Polish) { @@ -153,11 +157,6 @@ bool DolphinSearchBox::event(QEvent* event) void DolphinSearchBox::showEvent(QShowEvent* event) { if (!event->spontaneous()) { -#ifdef HAVE_NEPOMUK - m_nepomukActivated = (Nepomuk::ResourceManager::instance()->init() == 0); -#endif - - m_searchInput->clear(); m_searchInput->setFocus(); m_startedSearching = false; } diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h index 09d223355..3e4648048 100644 --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -69,6 +69,8 @@ public: */ void selectAll(); + void clearText(); + protected: virtual bool event(QEvent* event); virtual void showEvent(QShowEvent* event); @@ -114,7 +116,6 @@ private: private: bool m_startedSearching; - bool m_nepomukActivated; QVBoxLayout* m_topLayout;