-rw-r--r-- | korganizer/searchdialog.cpp | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 0e9f64c..72359df 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp @@ -217,8 +217,11 @@ void SearchDialog::raiseAndSelect() if ( ! mSearchJournal->isChecked() ) { mSearchJournal->setChecked( true ); mSearchTodo->setChecked( false ); mSearchEvent->setChecked( false ); + mSummaryCheck->setChecked( true ); + mDescriptionCheck->setChecked( true ); + } } else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { if ( ! mSearchTodo->isChecked() ) { @@ -549,20 +552,36 @@ void SearchDialog::search(const QRegExp &re) for(journ=journals.first();journ;journ=journals.next()) { if ( journ->dtStart().date() <= mEndDate->date() &&journ->dtStart().date() >= mStartDate->date()) { + if (mDescriptionCheck->isChecked()) { #if QT_VERSION >= 0x030000 - if (re.search(journ->description()) != -1) + if (re.search(journ->description()) != -1) #else - if (re.match(journ->description()) != -1) + if (re.match(journ->description()) != -1) #endif - { - if ( mSubItems->isChecked() ) - mMatchedJournals.remove(journ); - else if (!mMatchedJournals.contains( journ )) - mMatchedJournals.append(journ); - continue; - } + { + if ( mSubItems->isChecked() ) + mMatchedJournals.remove(journ); + else if (!mMatchedJournals.contains( journ )) + mMatchedJournals.append(journ); + continue; + } + } + if (mSummaryCheck->isChecked()) { +#if QT_VERSION >= 0x030000 + if (re.search(journ->summary()) != -1) +#else + if (re.match(journ->summary()) != -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 ) { |