diff -r f27aebe284bb -r c5af8598d22c logsui/logsengine/src/logsmodel.cpp --- a/logsui/logsengine/src/logsmodel.cpp Wed Aug 18 09:49:12 2010 +0300 +++ b/logsui/logsengine/src/logsmodel.cpp Thu Sep 02 20:27:05 2010 +0300 @@ -32,6 +32,7 @@ #include #include #include +#include Q_DECLARE_METATYPE(LogsEvent *) Q_DECLARE_METATYPE(LogsCall *) @@ -94,7 +95,8 @@ LOGS_QDEBUG( "logs [ENG] -> LogsModel::clearList()" ) connect( mDbConnector, SIGNAL(clearingCompleted(int)), - this, SIGNAL(clearingCompleted(int)) ); + this, SIGNAL(clearingCompleted(int)), + Qt::UniqueConnection ); return mDbConnector->clearList(cleartype); } @@ -106,14 +108,15 @@ { LOGS_QDEBUG( "logs [ENG] -> LogsModel::markEventsSeen()" ) - QList markedEvents; + QList markedEvents; foreach ( LogsEvent* event, mEvents ){ if ( matchEventWithClearType(*event, cleartype) && !event->isSeenLocally() ){ - markedEvents.append(event->logId()); + markedEvents.append(event); } } connect( mDbConnector, SIGNAL(markingCompleted(int)), - this, SIGNAL(markingCompleted(int)) ); + this, SIGNAL(markingCompleted(int)), + Qt::UniqueConnection ); bool retVal = mDbConnector->markEventsSeen(markedEvents); LOGS_QDEBUG_2( "logs [ENG] <- LogsModel::markEventsSeen()", retVal ) return retVal; @@ -162,24 +165,30 @@ int LogsModel::updateConfiguration(LogsConfigurationParams& params) { LOGS_QDEBUG( "logs [ENG] -> LogsModel::updateConfiguration()" ) - int currWidth = - LogsCommonData::getInstance().currentConfiguration().listItemTextWidth(); - int newWidth = params.listItemTextWidth(); - LOGS_QDEBUG_3( "logs [ENG] Curr and new width", currWidth, newWidth ) - int retVal = LogsCommonData::getInstance().updateConfiguration(params); - - // Do model reset if list item width has changed as we need to ensure - // missed call's duplicate info visibility - bool unseenExists = false; - for ( int i = 0; i < mEvents.count() && !unseenExists; i++ ){ - LogsEvent* event = mEvents.at(i); - if ( event->duplicates() > 0 && !event->isSeenLocally() ){ - unseenExists = true; + int retVal = 0; + if (params.localeChanged()) { + LOGS_QDEBUG( "logs [ENG] -> Locale changed, have to update model" ) + updateModel(); + } else { + int currWidth = + LogsCommonData::getInstance().currentConfiguration().listItemTextWidth(); + int newWidth = params.listItemTextWidth(); + LOGS_QDEBUG_3( "logs [ENG] Curr and new width", currWidth, newWidth ) + retVal = LogsCommonData::getInstance().updateConfiguration(params); + + // Do model reset if list item width has changed as we need to ensure + // missed call's duplicate info visibility + bool unseenExists = false; + for ( int i = 0; i < mEvents.count() && !unseenExists; i++ ){ + LogsEvent* event = mEvents.at(i); + if ( event->duplicates() > 0 && !event->isSeenLocally() ){ + unseenExists = true; + } } - } - if ( unseenExists && currWidth > 0 && currWidth != newWidth ){ - LOGS_QDEBUG( "logs [ENG] Do model reset" ) - resetModel(); + if ( unseenExists && newWidth > 0 && currWidth != newWidth ){ + LOGS_QDEBUG( "logs [ENG] Do model reset" ) + resetModel(); + } } LOGS_QDEBUG( "logs [ENG] <- LogsModel::updateConfiguration()" ) return retVal; @@ -220,7 +229,7 @@ if (role == Qt::DisplayRole){ QStringList list; list << getCallerId( *event ); - list << event->time().toTimeSpec(Qt::LocalTime).toString(); + list << dateAndTimeString( event->time().toTimeSpec(Qt::LocalTime) ); return QVariant(list); } else if (role == Qt::DecorationRole) { QList icons; @@ -342,7 +351,7 @@ { QString callerId(event.remoteParty()); if ( callerId.length() == 0 ){ - callerId = event.number(); + callerId = phoneNumString(event.number()); } if ( callerId.length() == 0 && event.logsEventData() ){ callerId = event.logsEventData()->remoteUrl(); @@ -359,7 +368,8 @@ int duplicates = event.duplicates(); if ( duplicates > 0 && !event.isSeenLocally() ){ QString callerIdBaseString = callerId; - QString callerIdDupString = "(" + QString::number(duplicates + 1) + ")"; + QString callerIdDupString = "(" + + HbStringUtil::convertDigits(QString::number(duplicates + 1)) + ")"; int width = LogsCommonData::getInstance().currentConfiguration().listItemTextWidth(); callerId = SqueezedString(callerIdBaseString,callerIdDupString,width); }