summaryrefslogtreecommitdiffabout
path: root/korganizer/searchdialog.cpp
Unidiff
Diffstat (limited to 'korganizer/searchdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/searchdialog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 39966b5..3a95978 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -157,65 +157,65 @@ void SearchDialog::updateList()
157 } 157 }
158} 158}
159void SearchDialog::searchTextChanged( const QString &_text ) 159void SearchDialog::searchTextChanged( const QString &_text )
160{ 160{
161 enableButton( KDialogBase::User1, !_text.isEmpty() ); 161 enableButton( KDialogBase::User1, !_text.isEmpty() );
162} 162}
163 163
164void SearchDialog::doSearch() 164void SearchDialog::doSearch()
165{ 165{
166 QRegExp re; 166 QRegExp re;
167 167
168 re.setWildcard(true); // most people understand these better. 168 re.setWildcard(true); // most people understand these better.
169 re.setCaseSensitive(false); 169 re.setCaseSensitive(false);
170 re.setPattern(searchEdit->text()); 170 re.setPattern(searchEdit->text());
171 if (!re.isValid() ) { 171 if (!re.isValid() ) {
172 KMessageBox::sorry(this, 172 KMessageBox::sorry(this,
173 i18n("Invalid search expression,\ncannot perform " 173 i18n("Invalid search expression,\ncannot perform "
174 "the search.\nPlease enter a search expression\n" 174 "the search.\nPlease enter a search expression\n"
175 "using the wildcard characters\n '*' and '?'" 175 "using the wildcard characters\n '*' and '?'"
176 "where needed.")); 176 "where needed."));
177 return; 177 return;
178 } 178 }
179 179
180 search(re); 180 search(re);
181 181
182 listView->setStartDate( mStartDate->date() ); 182 listView->setStartDate( mStartDate->date() );
183 listView->showEvents(mMatchedEvents); 183 listView->showEvents(mMatchedEvents);
184 listView->addTodos(mMatchedTodos); 184 listView->addTodos(mMatchedTodos);
185 listView->addJournals(mMatchedJournals); 185 listView->addJournals(mMatchedJournals);
186 186
187 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) { 187 if (mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() == 0) {
188 KMessageBox::information(this, 188 KMessageBox::information(this,
189 i18n("No event/todo were found matching\nyour search expression.\nUse the wildcard characters\n ' * ' and ' ? ' where needed.")); 189 i18n("No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed."));
190#ifndef DESKTOP_VERSION 190#ifndef DESKTOP_VERSION
191 setCaption(i18n("Click OK to search ->")); 191 setCaption(i18n("Click OK to search ->"));
192#else 192#else
193 setCaption(i18n("KO/Pi Find ")); 193 setCaption(i18n("KO/Pi Find "));
194#endif 194#endif
195 } else { 195 } else {
196 QString mess; 196 QString mess;
197 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() ); 197 mess = mess.sprintf( i18n("%d item(s) found."), mMatchedEvents.count()+ mMatchedJournals.count() + mMatchedTodos.count() );
198 setCaption( i18n("KO/Pi Find: ") + mess); 198 setCaption( i18n("KO/Pi Find: ") + mess);
199 199
200 } 200 }
201} 201}
202void SearchDialog::updateConfig() 202void SearchDialog::updateConfig()
203{ 203{
204 listView->updateConfig(); 204 listView->updateConfig();
205} 205}
206void SearchDialog::updateView() 206void SearchDialog::updateView()
207{ 207{
208 208
209 QRegExp re; 209 QRegExp re;
210 re.setWildcard(true); // most people understand these better. 210 re.setWildcard(true); // most people understand these better.
211 re.setCaseSensitive(false); 211 re.setCaseSensitive(false);
212 re.setPattern(searchEdit->text()); 212 re.setPattern(searchEdit->text());
213 if (re.isValid()) { 213 if (re.isValid()) {
214 search(re); 214 search(re);
215 } else { 215 } else {
216 mMatchedEvents.clear(); 216 mMatchedEvents.clear();
217 mMatchedTodos.clear(); 217 mMatchedTodos.clear();
218 mMatchedJournals.clear(); 218 mMatchedJournals.clear();
219 } 219 }
220 listView->setStartDate( mStartDate->date() ); 220 listView->setStartDate( mStartDate->date() );
221 listView->showEvents(mMatchedEvents); 221 listView->showEvents(mMatchedEvents);