┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-02-04 20:55:52 +0100
committerPeter Penz <[email protected]>2011-02-04 20:55:52 +0100
commit236eac2ffa671fe9cd56c233925a19d8c89f1141 (patch)
tree2b8e5bd85d96caddcd32154e16eed1177ef2571b
parentfd74aa8e2057158d2eadb835eb61564854c81020 (diff)
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.
-rw-r--r--src/dolphinviewcontainer.cpp2
-rw-r--r--src/search/dolphinsearchbox.cpp11
-rw-r--r--src/search/dolphinsearchbox.h3
3 files changed, 9 insertions, 7 deletions
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;