-rw-r--r-- | korganizer/searchdialog.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index de65b53..007d1f3 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -202,56 +202,53 @@ void SearchDialog::searchTextChanged( const QString &_text ) | |||
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 | QString st = searchEdit->text(); | 209 | QString st = searchEdit->text(); |
210 | if ( st.right(1) != "*") | 210 | if ( st.right(1) != "*") |
211 | st += "*"; | 211 | st += "*"; |
212 | re.setPattern(st); | 212 | re.setPattern(st); |
213 | if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) { | 213 | if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) { |
214 | KMessageBox::sorry(this, | 214 | KMessageBox::sorry(this, |
215 | 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")); |
216 | return; | 216 | return; |
217 | } | 217 | } |
218 | if (!re.isValid() ) { | 218 | if (!re.isValid() ) { |
219 | KMessageBox::sorry(this, | 219 | KMessageBox::sorry(this, |
220 | i18n("Invalid search expression,\ncannot perform " | 220 | i18n("Invalid search expression,\ncannot perform " |
221 | "the search.\nPlease enter a search expression\n" | 221 | "the search.\nPlease enter a search expression\n" |
222 | "using the wildcard characters\n '*' and '?'" | 222 | "using the wildcard characters\n '*' and '?'" |
223 | "where needed.")); | 223 | "where needed.")); |
224 | return; | 224 | return; |
225 | } | 225 | } |
226 | |||
227 | search(re); | 226 | search(re); |
228 | |||
229 | listView->setStartDate( mStartDate->date() ); | 227 | listView->setStartDate( mStartDate->date() ); |
230 | listView->showEvents(mMatchedEvents); | 228 | listView->showEvents(mMatchedEvents); |
231 | listView->addTodos(mMatchedTodos); | 229 | listView->addTodos(mMatchedTodos); |
232 | listView->addJournals(mMatchedJournals); | 230 | listView->addJournals(mMatchedJournals); |
233 | |||
234 | if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { | 231 | if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { |
235 | setCaption(i18n("No items found. Use '*' and '?' where needed.")); | 232 | setCaption(i18n("No items found. Use '*' and '?' where needed.")); |
236 | } else { | 233 | } else { |
237 | QString mess; | 234 | QString mess; |
238 | mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); | 235 | mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); |
239 | setCaption( i18n("KO/Pi Find: ") + mess); | 236 | setCaption( i18n("KO/Pi Find: ") + mess); |
240 | 237 | ||
241 | } | 238 | } |
242 | searchEdit->setFocus(); | 239 | searchEdit->setFocus(); |
243 | } | 240 | } |
244 | void SearchDialog::updateConfig() | 241 | void SearchDialog::updateConfig() |
245 | { | 242 | { |
246 | listView->updateConfig(); | 243 | listView->updateConfig(); |
247 | } | 244 | } |
248 | void SearchDialog::updateView() | 245 | void SearchDialog::updateView() |
249 | { | 246 | { |
250 | //qDebug("SearchDialog::updateView() %d ", isVisible()); | 247 | //qDebug("SearchDialog::updateView() %d ", isVisible()); |
251 | QRegExp re; | 248 | QRegExp re; |
252 | re.setWildcard(true); // most people understand these better. | 249 | re.setWildcard(true); // most people understand these better. |
253 | re.setCaseSensitive(false); | 250 | re.setCaseSensitive(false); |
254 | QString st = searchEdit->text(); | 251 | QString st = searchEdit->text(); |
255 | if ( st.right(1) != "*") | 252 | if ( st.right(1) != "*") |
256 | st += "*"; | 253 | st += "*"; |
257 | re.setPattern(st); | 254 | re.setPattern(st); |