summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-25 01:34:43 (UTC)
committer zautrix <zautrix>2005-06-25 01:34:43 (UTC)
commitab93fa0a7cd97beada9475f6099bf6083547f0d6 (patch) (unidiff)
treec983cb818528cac200a98585b3451c0371389e52
parentce9c31a057f12a8d6a126a7312e4ecaf3270da50 (diff)
downloadkdepimpi-ab93fa0a7cd97beada9475f6099bf6083547f0d6.zip
kdepimpi-ab93fa0a7cd97beada9475f6099bf6083547f0d6.tar.gz
kdepimpi-ab93fa0a7cd97beada9475f6099bf6083547f0d6.tar.bz2
fixxx
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
@@ -330,20 +330,24 @@ void SearchDialog::updateView()
330 listView->addTodos(mMatchedTodos); 330 listView->addTodos(mMatchedTodos);
331 listView->addJournals(mMatchedJournals); 331 listView->addJournals(mMatchedJournals);
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
348 if (re.search(ev->summary()) != -1) 352 if (re.search(ev->summary()) != -1)
349#else 353#else
@@ -443,20 +447,21 @@ void SearchDialog::search(const QRegExp &re)
443 } 447 }
444 } 448 }
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
461 if (re.search(tod->summary()) != -1) 466 if (re.search(tod->summary()) != -1)
462#else 467#else
@@ -532,18 +537,19 @@ void SearchDialog::search(const QRegExp &re)
532 } 537 }
533 } 538 }
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()
548 &&journ->dtStart().date() >= mStartDate->date()) { 554 &&journ->dtStart().date() >= mStartDate->date()) {
549#if QT_VERSION >= 0x030000 555#if QT_VERSION >= 0x030000