summaryrefslogtreecommitdiffabout
path: root/korganizer/searchdialog.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/searchdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/searchdialog.cpp19
1 files changed, 19 insertions, 0 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,8 +552,9 @@ 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)
#else
if (re.match(journ->description()) != -1)
@@ -562,8 +566,23 @@ void SearchDialog::search(const QRegExp &re)
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 ) {
qDebug("count %d ", mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() );