-rw-r--r-- | korganizer/searchdialog.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index db60383..7a945e3 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -201,17 +201,20 @@ void SearchDialog::searchTextChanged( const QString &_text ) | |||
201 | } | 201 | } |
202 | 202 | ||
203 | void SearchDialog::doSearch() | 203 | void SearchDialog::doSearch() |
204 | { | 204 | { |
205 | QRegExp re; | 205 | QRegExp re; |
206 | 206 | ||
207 | re.setWildcard(true); // most people understand these better. | 207 | re.setWildcard(true); // most people understand these better. |
208 | re.setCaseSensitive(false); | 208 | re.setCaseSensitive(false); |
209 | re.setPattern(searchEdit->text()); | 209 | QString st = searchEdit->text(); |
210 | if ( st.right(1) != "*") | ||
211 | st += "*"; | ||
212 | re.setPattern(st); | ||
210 | if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) { | 213 | if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) { |
211 | KMessageBox::sorry(this, | 214 | KMessageBox::sorry(this, |
212 | i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals")); | 215 | i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals")); |
213 | return; | 216 | return; |
214 | } | 217 | } |
215 | if (!re.isValid() ) { | 218 | if (!re.isValid() ) { |
216 | KMessageBox::sorry(this, | 219 | KMessageBox::sorry(this, |
217 | i18n("Invalid search expression,\ncannot perform " | 220 | i18n("Invalid search expression,\ncannot perform " |
@@ -242,18 +245,21 @@ void SearchDialog::updateConfig() | |||
242 | { | 245 | { |
243 | listView->updateConfig(); | 246 | listView->updateConfig(); |
244 | } | 247 | } |
245 | void SearchDialog::updateView() | 248 | void SearchDialog::updateView() |
246 | { | 249 | { |
247 | //qDebug("SearchDialog::updateView() %d ", isVisible()); | 250 | //qDebug("SearchDialog::updateView() %d ", isVisible()); |
248 | QRegExp re; | 251 | QRegExp re; |
249 | re.setWildcard(true); // most people understand these better. | 252 | re.setWildcard(true); // most people understand these better. |
250 | re.setCaseSensitive(false); | 253 | re.setCaseSensitive(false); |
251 | re.setPattern(searchEdit->text()); | 254 | QString st = searchEdit->text(); |
255 | if ( st.right(1) != "*") | ||
256 | st += "*"; | ||
257 | re.setPattern(st); | ||
252 | if (re.isValid()) { | 258 | if (re.isValid()) { |
253 | search(re); | 259 | search(re); |
254 | } else { | 260 | } else { |
255 | mMatchedEvents.clear(); | 261 | mMatchedEvents.clear(); |
256 | mMatchedTodos.clear(); | 262 | mMatchedTodos.clear(); |
257 | mMatchedJournals.clear(); | 263 | mMatchedJournals.clear(); |
258 | } | 264 | } |
259 | listView->setStartDate( mStartDate->date() ); | 265 | listView->setStartDate( mStartDate->date() ); |