summaryrefslogtreecommitdiffabout
path: root/korganizer/searchdialog.cpp
authorzautrix <zautrix>2005-06-29 12:29:53 (UTC)
committer zautrix <zautrix>2005-06-29 12:29:53 (UTC)
commit0d4d5898a32f162dca010db329e02310a14629d5 (patch) (unidiff)
tree2d6e758a8a5ec64995de79a4cd1c02c89f509190 /korganizer/searchdialog.cpp
parent435e68d6ace30fb2121b718226e00be44971c617 (diff)
downloadkdepimpi-0d4d5898a32f162dca010db329e02310a14629d5.zip
kdepimpi-0d4d5898a32f162dca010db329e02310a14629d5.tar.gz
kdepimpi-0d4d5898a32f162dca010db329e02310a14629d5.tar.bz2
j fixes
Diffstat (limited to 'korganizer/searchdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/searchdialog.cpp37
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
@@ -215,12 +215,15 @@ void SearchDialog::raiseAndSelect()
215 if ( newState != currentState ) { 215 if ( newState != currentState ) {
216 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { 216 if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
217 if ( ! mSearchJournal->isChecked() ) { 217 if ( ! mSearchJournal->isChecked() ) {
218 mSearchJournal->setChecked( true ); 218 mSearchJournal->setChecked( true );
219 mSearchTodo->setChecked( false ); 219 mSearchTodo->setChecked( false );
220 mSearchEvent->setChecked( false ); 220 mSearchEvent->setChecked( false );
221 mSummaryCheck->setChecked( true );
222 mDescriptionCheck->setChecked( true );
223
221 } 224 }
222 } 225 }
223 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { 226 else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
224 if ( ! mSearchTodo->isChecked() ) { 227 if ( ! mSearchTodo->isChecked() ) {
225 mSearchTodo->setChecked( true ); 228 mSearchTodo->setChecked( true );
226 mSearchJournal->setChecked( false ); 229 mSearchJournal->setChecked( false );
@@ -547,24 +550,40 @@ void SearchDialog::search(const QRegExp &re)
547 if ( ! mRefineItems->isChecked() ) journals = mCalendar->journals(); 550 if ( ! mRefineItems->isChecked() ) journals = mCalendar->journals();
548 Journal* journ; 551 Journal* journ;
549 552
550 for(journ=journals.first();journ;journ=journals.next()) { 553 for(journ=journals.first();journ;journ=journals.next()) {
551 if ( journ->dtStart().date() <= mEndDate->date() 554 if ( journ->dtStart().date() <= mEndDate->date()
552 &&journ->dtStart().date() >= mStartDate->date()) { 555 &&journ->dtStart().date() >= mStartDate->date()) {
556 if (mDescriptionCheck->isChecked()) {
553#if QT_VERSION >= 0x030000 557#if QT_VERSION >= 0x030000
554 if (re.search(journ->description()) != -1) 558 if (re.search(journ->description()) != -1)
555#else 559#else
556 if (re.match(journ->description()) != -1) 560 if (re.match(journ->description()) != -1)
557#endif 561#endif
558 { 562 {
559 if ( mSubItems->isChecked() ) 563 if ( mSubItems->isChecked() )
560 mMatchedJournals.remove(journ); 564 mMatchedJournals.remove(journ);
561 else if (!mMatchedJournals.contains( journ )) 565 else if (!mMatchedJournals.contains( journ ))
562 mMatchedJournals.append(journ); 566 mMatchedJournals.append(journ);
563 continue; 567 continue;
564 } 568 }
569 }
570 if (mSummaryCheck->isChecked()) {
571#if QT_VERSION >= 0x030000
572 if (re.search(journ->summary()) != -1)
573#else
574 if (re.match(journ->summary()) != -1)
575#endif
576 {
577 if ( mSubItems->isChecked() )
578 mMatchedJournals.remove(journ);
579 else if (!mMatchedJournals.contains( journ ))
580 mMatchedJournals.append(journ);
581 continue;
582 }
583 }
565 } 584 }
566 } 585 }
567 } 586 }
568 if ( mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() < 1 ) { 587 if ( mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() < 1 ) {
569 qDebug("count %d ", mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() ); 588 qDebug("count %d ", mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() );
570 if ( mRefineItems->isChecked() ) 589 if ( mRefineItems->isChecked() )