diff options
| author | Peter Penz <[email protected]> | 2010-01-26 09:01:38 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2010-01-26 09:01:38 +0000 |
| commit | 6c326f9962b9664ac601640bf8cc49b50c046c27 (patch) | |
| tree | 3db6d39eb20ff9aa343b523204a2a3f9282e8642 /src/search/dolphinsearchbox.cpp | |
| parent | e536466ac75e7fa3cfdc18728596beac36996128 (diff) | |
Don't show the search options again, if the user closed them and cleared the search box.
BUG: 218880
svn path=/trunk/KDE/kdebase/apps/; revision=1080372
Diffstat (limited to 'src/search/dolphinsearchbox.cpp')
| -rw-r--r-- | src/search/dolphinsearchbox.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 1dcb381dd..7eb7206ac 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -251,7 +251,9 @@ DolphinSearchBox::DolphinSearchBox(QWidget* parent) : connect(m_searchInput, SIGNAL(returnPressed()), this, SLOT(emitSearchSignal())); connect(m_searchInput, SIGNAL(textChanged(QString)), - this, SIGNAL(searchTextChanged(QString))); + this, SLOT(slotTextChanged(QString))); + connect(m_searchInput, SIGNAL(clearButtonClicked()), + this, SLOT(slotClearButtonClicked())); } DolphinSearchBox::~DolphinSearchBox() @@ -284,7 +286,9 @@ bool DolphinSearchBox::eventFilter(QObject* watched, QEvent* event) if (m_completer == 0) { m_completer = new DolphinSearchCompleter(m_searchInput); } - emit requestSearchOptions(); + if (m_searchInput->text().isEmpty()) { + emit requestSearchOptions(); + } } return QWidget::eventFilter(watched, event); @@ -296,4 +300,12 @@ void DolphinSearchBox::emitSearchSignal() emit search(m_searchInput->text()); } +void DolphinSearchBox::slotTextChanged(const QString& text) +{ + if (!text.isEmpty()) { + emit requestSearchOptions(); + } + emit searchTextChanged(text); +} + #include "dolphinsearchbox.moc" |
