-rw-r--r-- | korganizer/searchdialog.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 0713980..2390520 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp @@ -334,7 +334,5 @@ void SearchDialog::updateView() void SearchDialog::search(const QRegExp &re) { - QPtrList<Event> events = mCalendar->events( mStartDate->date(), - mEndDate->date(), - false /*mInclusiveCheck->isChecked()*/ ); + QPtrList<Event> events; if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { if ( mRefineItems->isChecked() ) events = mMatchedEvents; @@ -342,4 +340,10 @@ void SearchDialog::search(const QRegExp &re) } if ( mSearchEvent->isChecked() ) { + if ( !mRefineItems->isChecked() ) + events = mCalendar->events( mStartDate->date(), + mEndDate->date(), + false /*mInclusiveCheck->isChecked()*/ ); + + Event *ev; for(ev=events.first();ev;ev=events.next()) { @@ -447,5 +451,5 @@ void SearchDialog::search(const QRegExp &re) } } - QPtrList<Todo> todos = mCalendar->todos( ); + QPtrList<Todo> todos; if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { @@ -455,4 +459,5 @@ void SearchDialog::search(const QRegExp &re) if ( mSearchTodo->isChecked() ) { + if ( !mRefineItems->isChecked() ) todos = mCalendar->todos( ); Todo *tod; for(tod=todos.first();tod;tod=todos.next()) { @@ -536,5 +541,5 @@ void SearchDialog::search(const QRegExp &re) } - QPtrList<Journal> journals = mCalendar->journals( ); + QPtrList<Journal> journals; if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; @@ -542,4 +547,5 @@ void SearchDialog::search(const QRegExp &re) } if (mSearchJournal->isChecked() ) { + if ( ! mRefineItems->isChecked() ) journals = mCalendar->journals(); Journal* journ; |