Changeset 594:95385fc82b2a in qutecom-2.2 for wengophone/src/presentation/qt/chat/QtChatWidget.cpp
Legend:
- Unmodified
- Added
- Removed
-
wengophone/src/presentation/qt/chat/QtChatWidget.cpp
r587 r594 49 49 #include <cutil/global.h> 50 50 #include <qtutil/SafeConnect.h> 51 #include <qtutil/StringListConvert.h> 51 52 52 53 #include <string> … … 163 164 164 165 //load theme 166 connect(_ui.chatHistory,SIGNAL(loadFinished(bool)),this,SLOT(htmlLoadFinished(bool))); 165 167 _ui.chatHistory->setTheme(QString::fromStdString(config.getChatTheme()),QString::fromStdString(config.getChatThemeVariant())); 166 168 } … … 610 612 return false; 611 613 } 614 615 void QtChatWidget::readyToLoadHistory() 616 { 617 618 HistoryMementoCollection * hmc = _cChatHandler.getCUserProfile().getUserProfile().getHistory().getSessionCollection(_imChatSession->getId()); 619 620 621 if(hmc) 622 for (HistoryMap::iterator it = hmc->begin(); it != hmc->end(); it++) { 623 624 HistoryMemento * memento = it->second; 625 626 Time mementoTime = memento->getTime(); 627 QTime time = QTime(mementoTime.getHour(), mementoTime.getMinute()); 628 629 QString contactName = QString::fromUtf8(memento->getPeer().c_str()); 630 contactName.remove("sip:"); 631 632 QtContactList * qtContactList = _qtWengoPhone->getQtContactList(); 633 CContactList & cContactList = qtContactList->getCContactList(); 634 QString contactId = QString::fromStdString(cContactList.findContactThatOwns(contactName.toStdString())); 635 636 _ui.chatHistory->insertMessage( 637 contactId, 638 contactName, 639 QString::fromUtf8(memento->getData().c_str()), 640 time 641 ); 642 } 643 } 644 645 void QtChatWidget::htmlLoadFinished(bool) 646 { 647 //WebKit need a little time to load resources ... 648 QTimer::singleShot(500, this, SLOT(readyToLoadHistory())); 649 }
Note: See TracChangeset
for help on using the changeset viewer.
