-rw-r--r-- | korganizer/searchdialog.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index a8de297..0713980 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp @@ -540,49 +540,55 @@ void SearchDialog::search(const QRegExp &re) if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; mMatchedJournals.clear(); } if (mSearchJournal->isChecked() ) { Journal* journ; for(journ=journals.first();journ;journ=journals.next()) { if ( journ->dtStart().date() <= mEndDate->date() &&journ->dtStart().date() >= mStartDate->date()) { #if QT_VERSION >= 0x030000 if (re.search(journ->description()) != -1) #else if (re.match(journ->description()) != -1) #endif { if ( mSubItems->isChecked() ) mMatchedJournals.remove(journ); else if (!mMatchedJournals.contains( journ )) mMatchedJournals.append(journ); continue; } } } } - + if ( mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() < 1 ) { + qDebug("count %d ", mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() ); + if ( mRefineItems->isChecked() ) + mRefineItems->setChecked( false ); + else if ( mSubItems->isChecked() ) + mSubItems->setChecked( false ); + } } void SearchDialog::keyPressEvent ( QKeyEvent *e) { switch ( e->key() ) { case Qt::Key_Escape: close(); break; case Qt::Key_F: if ( e->state() == Qt::ControlButton ) { } break; case Qt::Key_Return: case Qt::Key_Enter: doSearch(); break; default: e->ignore(); } } //mMatchedJournals; |