-rw-r--r-- | korganizer/searchdialog.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 3a95978..3fd9740 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp @@ -71,25 +71,25 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) QHBox *incidenceGroup = new QHBox( topFrame ); layout->addWidget(incidenceGroup); mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); mSearchEvent->setChecked(true); mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); QHBox *subjectGroup = new QHBox( topFrame ); layout->addWidget(subjectGroup); - mSummaryCheck = new QCheckBox(i18n("Summaries"),subjectGroup); + mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); mSummaryCheck->setChecked(true); mDescriptionCheck = new QCheckBox(i18n("Descriptions"),subjectGroup); mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); QHBox *attendeeGroup = new QHBox( topFrame ); layout->addWidget(attendeeGroup ); new QLabel( i18n("Attendee:"),attendeeGroup ); mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); // Date range // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), // topFrame); @@ -176,37 +176,32 @@ void SearchDialog::doSearch() "where needed.")); return; } search(re); listView->setStartDate( mStartDate->date() ); listView->showEvents(mMatchedEvents); listView->addTodos(mMatchedTodos); listView->addJournals(mMatchedJournals); if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { - KMessageBox::information(this, - i18n("No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.")); -#ifndef DESKTOP_VERSION - setCaption(i18n("Click OK to search ->")); -#else - setCaption(i18n("KO/Pi Find ")); -#endif + setCaption(i18n("No items found. Use '*' and '?' where needed.")); } else { QString mess; mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); setCaption( i18n("KO/Pi Find: ") + mess); } + searchEdit->setFocus(); } void SearchDialog::updateConfig() { listView->updateConfig(); } void SearchDialog::updateView() { QRegExp re; re.setWildcard(true); // most people understand these better. re.setCaseSensitive(false); re.setPattern(searchEdit->text()); @@ -234,24 +229,33 @@ void SearchDialog::search(const QRegExp &re) Event *ev; for(ev=events.first();ev;ev=events.next()) { if (mSummaryCheck->isChecked()) { #if QT_VERSION >= 0x030000 if (re.search(ev->summary()) != -1) #else if (re.match(ev->summary()) != -1) #endif { mMatchedEvents.append(ev); continue; } +#if QT_VERSION >= 0x030000 + if (re.search(ev->location()) != -1) +#else + if (re.match(ev->location()) != -1) +#endif + { + mMatchedEvents.append(ev); + continue; + } } if (mDescriptionCheck->isChecked()) { #if QT_VERSION >= 0x030000 if (re.search(ev->description()) != -1) #else if (re.match(ev->description()) != -1) #endif { mMatchedEvents.append(ev); continue; } } |