summaryrefslogtreecommitdiffabout
path: root/korganizer/searchdialog.cpp
authorzautrix <zautrix>2005-06-25 02:44:17 (UTC)
committer zautrix <zautrix>2005-06-25 02:44:17 (UTC)
commitdcc7c9ed932ec2ef521aa04b929d0319f65c8bdc (patch) (unidiff)
treef61360b8f883a6e5fe007c5a24cd35d7cc29ffc0 /korganizer/searchdialog.cpp
parent1d0b53abc70e66708d93b7081a21a7689b1a1303 (diff)
downloadkdepimpi-dcc7c9ed932ec2ef521aa04b929d0319f65c8bdc.zip
kdepimpi-dcc7c9ed932ec2ef521aa04b929d0319f65c8bdc.tar.gz
kdepimpi-dcc7c9ed932ec2ef521aa04b929d0319f65c8bdc.tar.bz2
serach fix
Diffstat (limited to 'korganizer/searchdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/searchdialog.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 2390520..0e9f64c 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -260,25 +260,24 @@ void SearchDialog::updateList()
260 } 260 }
261} 261}
262void SearchDialog::searchTextChanged( const QString &_text ) 262void SearchDialog::searchTextChanged( const QString &_text )
263{ 263{
264#if 0 264#if 0
265 enableButton( KDialogBase::User1, !_text.isEmpty() ); 265 enableButton( KDialogBase::User1, !_text.isEmpty() );
266#endif 266#endif
267} 267}
268 268
269void SearchDialog::doSearch() 269void SearchDialog::doSearch()
270{ 270{
271 QRegExp re; 271 QRegExp re;
272
273 re.setWildcard(true); // most people understand these better. 272 re.setWildcard(true); // most people understand these better.
274 re.setCaseSensitive(false); 273 re.setCaseSensitive(false);
275 QString st = searchEdit->text(); 274 QString st = searchEdit->text();
276 if ( st.right(1) != "*") 275 if ( st.right(1) != "*")
277 st += "*"; 276 st += "*";
278 re.setPattern(st); 277 re.setPattern(st);
279 if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) { 278 if (!mSearchEvent->isChecked() && !mSearchTodo->isChecked() && !mSearchJournal->isChecked() ) {
280 KMessageBox::sorry(this, 279 KMessageBox::sorry(this,
281 i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals")); 280 i18n("Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals"));
282 return; 281 return;
283 } 282 }
284 if (!re.isValid() ) { 283 if (!re.isValid() ) {
@@ -309,30 +308,29 @@ void SearchDialog::updateConfig()
309 listView->updateConfig(); 308 listView->updateConfig();
310} 309}
311void SearchDialog::updateView() 310void SearchDialog::updateView()
312{ 311{
313 //qDebug("SearchDialog::updateView() %d ", isVisible()); 312 //qDebug("SearchDialog::updateView() %d ", isVisible());
314 QRegExp re; 313 QRegExp re;
315 re.setWildcard(true); // most people understand these better. 314 re.setWildcard(true); // most people understand these better.
316 re.setCaseSensitive(false); 315 re.setCaseSensitive(false);
317 QString st = searchEdit->text(); 316 QString st = searchEdit->text();
318 if ( st.right(1) != "*") 317 if ( st.right(1) != "*")
319 st += "*"; 318 st += "*";
320 re.setPattern(st); 319 re.setPattern(st);
320 mMatchedEvents.clear();
321 mMatchedTodos.clear();
322 mMatchedJournals.clear();
321 if (re.isValid()) { 323 if (re.isValid()) {
322 search(re); 324 search(re);
323 } else {
324 mMatchedEvents.clear();
325 mMatchedTodos.clear();
326 mMatchedJournals.clear();
327 } 325 }
328 listView->setStartDate( mStartDate->date() ); 326 listView->setStartDate( mStartDate->date() );
329 listView->showEvents(mMatchedEvents); 327 listView->showEvents(mMatchedEvents);
330 listView->addTodos(mMatchedTodos); 328 listView->addTodos(mMatchedTodos);
331 listView->addJournals(mMatchedJournals); 329 listView->addJournals(mMatchedJournals);
332} 330}
333 331
334void SearchDialog::search(const QRegExp &re) 332void SearchDialog::search(const QRegExp &re)
335{ 333{
336 QPtrList<Event> events; 334 QPtrList<Event> events;
337 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { 335 if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) {
338 if ( mRefineItems->isChecked() ) events = mMatchedEvents; 336 if ( mRefineItems->isChecked() ) events = mMatchedEvents;