Changeset 6448 for trunk/qt4-gui/src/dialogs
- Timestamp:
- 07/13/08 03:39:22 (4 months ago)
- Location:
- trunk/qt4-gui/src/dialogs
- Files:
-
- 2 modified
-
historydlg.cpp (modified) (3 diffs)
-
historydlg.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/dialogs/historydlg.cpp
r6374 r6448 133 133 searchLayout->addLayout(findLayout); 134 134 connect(myPatternEdit, SIGNAL(textChanged(const QString&)), SLOT(searchTextChanged(const QString&))); 135 myPatternChanged = true; 135 136 136 137 // Shortcuts for searching … … 392 393 QRegExp regExp(getRegExp()); 393 394 395 // If search pattern has changed, find all matching dates and mark them in the calendar 396 if (myPatternChanged) 397 { 398 myCalendar->clearMatches(); 399 400 for (HistoryListIter i = myHistoryList.begin(); i != myHistoryList.end(); ++i) 401 { 402 QString messageText; 403 if ((*i)->SubCommand() == ICQ_CMDxSUB_SMS) // SMSs are always in UTF-8 404 messageText = QString::fromUtf8((*i)->Text()); 405 else 406 messageText = myContactCodec->toUnicode((*i)->Text()); 407 408 if (messageText.contains(regExp)) 409 { 410 QDate date = QDateTime::fromTime_t((*i)->Time()).date(); 411 myCalendar->addMatch(date); 412 } 413 } 414 415 // No need to do this again next time 416 myPatternChanged = false; 417 } 418 394 419 myStatusLabel->setText(QString()); 395 420 … … 469 494 // Clear failed status from previous search 470 495 myPatternEdit->setStyleSheet(""); 496 497 // Mark that pattern has changed since previous search 498 myPatternChanged = true; 499 500 // Search field is cleared so clear status message and matching dates 501 if (text.isEmpty()) 502 { 503 myStatusLabel->setText(QString()); 504 myCalendar->clearMatches(); 505 } 471 506 } 472 507 -
trunk/qt4-gui/src/dialogs/historydlg.h
r6186 r6448 153 153 QTextCodec* myContactCodec; 154 154 bool myUseHtml; 155 bool myPatternChanged; 155 156 156 157 HistoryList myHistoryList;
