summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/searchdialog.cpp16
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
@@ -332,16 +332,20 @@ void SearchDialog::updateView()
332} 332}
333 333
334void SearchDialog::search(const QRegExp &re) 334void SearchDialog::search(const QRegExp &re)
335{ 335{
336 QPtrList<Event> events = mCalendar->events( mStartDate->date(), 336 QPtrList<Event> events;
337 mEndDate->date(),
338 false /*mInclusiveCheck->isChecked()*/ );
339 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { 337 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) {
340 if ( mRefineItems->isChecked() ) events = mMatchedEvents; 338 if ( mRefineItems->isChecked() ) events = mMatchedEvents;
341 mMatchedEvents.clear(); 339 mMatchedEvents.clear();
342 } 340 }
343 if ( mSearchEvent->isChecked() ) { 341 if ( mSearchEvent->isChecked() ) {
342 if ( !mRefineItems->isChecked() )
343 events = mCalendar->events( mStartDate->date(),
344 mEndDate->date(),
345 false /*mInclusiveCheck->isChecked()*/ );
346
347
344 Event *ev; 348 Event *ev;
345 for(ev=events.first();ev;ev=events.next()) { 349 for(ev=events.first();ev;ev=events.next()) {
346 if (mSummaryCheck->isChecked()) { 350 if (mSummaryCheck->isChecked()) {
347#if QT_VERSION >= 0x030000 351#if QT_VERSION >= 0x030000
@@ -445,16 +449,17 @@ void SearchDialog::search(const QRegExp &re)
445 } 449 }
446 } 450 }
447 } 451 }
448 } 452 }
449 QPtrList<Todo> todos = mCalendar->todos( ); 453 QPtrList<Todo> todos;
450 454
451 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { 455 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) {
452 if ( mRefineItems->isChecked() ) todos = mMatchedTodos ; 456 if ( mRefineItems->isChecked() ) todos = mMatchedTodos ;
453 mMatchedTodos.clear(); 457 mMatchedTodos.clear();
454 } 458 }
455 459
456 if ( mSearchTodo->isChecked() ) { 460 if ( mSearchTodo->isChecked() ) {
461 if ( !mRefineItems->isChecked() ) todos = mCalendar->todos( );
457 Todo *tod; 462 Todo *tod;
458 for(tod=todos.first();tod;tod=todos.next()) { 463 for(tod=todos.first();tod;tod=todos.next()) {
459 if (mSummaryCheck->isChecked()) { 464 if (mSummaryCheck->isChecked()) {
460#if QT_VERSION >= 0x030000 465#if QT_VERSION >= 0x030000
@@ -534,14 +539,15 @@ void SearchDialog::search(const QRegExp &re)
534 } 539 }
535 } 540 }
536 } 541 }
537 542
538 QPtrList<Journal> journals = mCalendar->journals( ); 543 QPtrList<Journal> journals;
539 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { 544 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) {
540 if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; 545 if ( mRefineItems->isChecked() ) journals = mMatchedJournals ;
541 mMatchedJournals.clear(); 546 mMatchedJournals.clear();
542 } 547 }
543 if (mSearchJournal->isChecked() ) { 548 if (mSearchJournal->isChecked() ) {
549 if ( ! mRefineItems->isChecked() ) journals = mCalendar->journals();
544 Journal* journ; 550 Journal* journ;
545 551
546 for(journ=journals.first();journ;journ=journals.next()) { 552 for(journ=journals.first();journ;journ=journals.next()) {
547 if ( journ->dtStart().date() <= mEndDate->date() 553 if ( journ->dtStart().date() <= mEndDate->date()