# HG changeset patch # User hgs # Date 1281095867 -10800 # Node ID 52d644758b05dc1e233b1ad3c9ac9e68cc114911 # Parent 68f3171a5819b9a39edab70f6f30725748d294ec 201031 diff -r 68f3171a5819 -r 52d644758b05 logsui/logsapp/src/logsbaseview.cpp --- a/logsui/logsapp/src/logsbaseview.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsapp/src/logsbaseview.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -590,7 +590,7 @@ if (mMessage) { HbAction* messageAction = new HbAction; - messageAction->setText(hbTrId("txt_common_menu_create_message")); + messageAction->setText(hbTrId("txt_common_menu_send_message")); menu.addAction(messageAction); QObject::connect( messageAction, SIGNAL(triggered()), this, SLOT( createMessage() ) ); diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/inc/logsdetailsmodel.h --- a/logsui/logsengine/inc/logsdetailsmodel.h Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/inc/logsdetailsmodel.h Fri Aug 06 14:57:47 2010 +0300 @@ -57,6 +57,7 @@ protected: // From LogsAbstractModel virtual QVariant createContact(const LogsModelItemContainer& item) const; + virtual void updateModel(); private slots: diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/logsengine.pro --- a/logsui/logsengine/logsengine.pro Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/logsengine.pro Fri Aug 06 14:57:47 2010 +0300 @@ -55,6 +55,7 @@ HEADERS += logssymbianos/inc/logseventparser.h HEADERS += logssymbianos/inc/logseventdataparser.h HEADERS += logssymbianos/inc/logsremove.h +HEADERS += logssymbianos/inc/logssystemtimeobserver.h SOURCES += src/logsfilter.cpp SOURCES += src/logsabstractmodel.cpp @@ -79,6 +80,7 @@ SOURCES += logssymbianos/src/logseventparser.cpp SOURCES += logssymbianos/src/logseventdataparser.cpp SOURCES += logssymbianos/src/logsremove.cpp +SOURCES += logssymbianos/src/logssystemtimeobserver.cpp DEFINES += LOGSENGINE_LIB @@ -92,7 +94,9 @@ TARGET.CAPABILITY = CAP_GENERAL_DLL TARGET.EPOCALLOWDLLDATA = 1 - LIBS += -lflogger -llogcli -llogwrap -lefsrv -lxqservice -lxqserviceutil -lqtcontacts -llogscntfinder -lthumbnailmanagerqt -lcentralrepository + LIBS += -lflogger -llogcli -llogwrap -lefsrv -lxqservice -lxqserviceutil \ + -lqtcontacts -llogscntfinder -lthumbnailmanagerqt \ + -lcentralrepository -lbafl defFiles = "$${LITERAL_HASH}ifdef WINS" \ "DEFFILE bwins/logsengine.def" \ diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/logssymbianos/inc/logssystemtimeobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/logsui/logsengine/logssymbianos/inc/logssystemtimeobserver.h Fri Aug 06 14:57:47 2010 +0300 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef LOGSSYSTEMTIMEOBSERVER_H +#define LOGSSYSTEMTIMEOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATION +class CEnvironmentChangeNotifier; + +// CLASS DECLARATION + + + +/** + * LogsSystemTimeObserver is used to observe changes in system locale settings + */ +class LogsSystemTimeObserver : public QObject + { + Q_OBJECT + +public: + + explicit LogsSystemTimeObserver(QObject* parent = 0); + + virtual ~LogsSystemTimeObserver(); + +signals: + + void timeFormatChanged(); + + +private: + + static TInt EnvironmentChangeCallback(TAny* aThis); + +private: // data + + CEnvironmentChangeNotifier* mEnvChangeNotifier; + +private: + friend class UT_LogsSystemTimeObserver; + }; + +#endif // LOGSSYSTEMTIMEOBSERVER_H + +// End of File + + + + diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/logssymbianos/src/logssystemtimeobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/logsui/logsengine/logssymbianos/src/logssystemtimeobserver.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES +#include // CEnvironmentChangeNotifier +#include "logssystemtimeobserver.h" +#include "logslogger.h" + +// CONSTANTS + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +LogsSystemTimeObserver::LogsSystemTimeObserver(QObject* parent) : QObject(parent) +{ + LOGS_QDEBUG( "logs [ENG] -> LogsSystemTimeObserver::LogsSystemTimeObserver()" ) + TCallBack callback(EnvironmentChangeCallback, this); + + QT_TRAP_THROWING(mEnvChangeNotifier = + CEnvironmentChangeNotifier::NewL( CActive::EPriorityStandard, callback )); + + mEnvChangeNotifier->Start(); + LOGS_QDEBUG( "logs [ENG] <- LogsSystemTimeObserver::LogsSystemTimeObserver()" ) +} + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +LogsSystemTimeObserver::~LogsSystemTimeObserver() +{ + LOGS_QDEBUG( "logs [ENG] -> LogsSystemTimeObserver::~LogsSystemTimeObserver()" ) + + delete mEnvChangeNotifier; + + LOGS_QDEBUG( "logs [ENG] <- LogsSystemTimeObserver::~LogsSystemTimeObserver()" ) +} + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TInt LogsSystemTimeObserver::EnvironmentChangeCallback(TAny* aThis) +{ + LOGS_QDEBUG( "logs [ENG] -> LogsSystemTimeObserver::EnvironmentChangeCallback()" ) + LogsSystemTimeObserver* self = static_cast(aThis); + if (self->mEnvChangeNotifier->Change() & EChangesLocale) { + LOGS_QDEBUG( "logs [ENG] system time or Locale CHANGED!!!!" ) + emit self->timeFormatChanged(); + } + return 0; +} diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/logssymbianos/tsrc/stubs/logclient_stubs.cpp --- a/logsui/logsengine/logssymbianos/tsrc/stubs/logclient_stubs.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/logssymbianos/tsrc/stubs/logclient_stubs.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -183,7 +183,8 @@ void CLogClient::DeleteEvent(TLogId /*aId*/, TRequestStatus& aStatus) { aStatus = KRequestPending; - User::RequestComplete( &aStatus, KErrNone ); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); } void CLogClient::DoRunL() @@ -199,14 +200,16 @@ { stubLastCalledFunc = "ClearLog"; aStatus = KRequestPending; - User::RequestComplete( &aStatus, KErrNone ); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); } void CLogClient::ClearLog(TInt /*aRecentList*/, TRequestStatus& aStatus) { stubLastCalledFunc = "ClearLogRecentList"; aStatus = KRequestPending; - User::RequestComplete( &aStatus, KErrNone ); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); } void CLogClient::CLogBase_Reserved1() @@ -253,7 +256,8 @@ TBool CLogView::FirstL(TRequestStatus& aStatus) { aStatus = KRequestPending; - User::RequestComplete( &aStatus, KErrNone ); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); return ETrue; } @@ -261,7 +265,8 @@ { if ( stubAsyncCallPossible ){ aStatus = KRequestPending; - User::RequestComplete( &aStatus, KErrNone ); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); } return stubAsyncCallPossible; } @@ -320,7 +325,8 @@ iRecentList = aList; if ( stubAsyncCallPossible ){ aStatus = KRequestPending; - User::RequestComplete( &aStatus, KErrNone ); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); } return stubAsyncCallPossible; } @@ -330,7 +336,8 @@ iRecentList = aList; if ( stubAsyncCallPossible ){ aStatus = KRequestPending; - User::RequestComplete( &aStatus, KErrNone ); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); } return stubAsyncCallPossible; } @@ -340,7 +347,8 @@ iRecentList = aList; if ( stubAsyncCallPossible ){ aStatus = KRequestPending; - User::RequestComplete( &aStatus, KErrNone ); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); } return stubAsyncCallPossible; } @@ -354,7 +362,8 @@ { if ( stubAsyncCallPossible ){ aStatus = KRequestPending; - User::RequestComplete( &aStatus, KErrNone ); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); } return stubAsyncCallPossible; } @@ -363,7 +372,8 @@ { if ( stubAsyncCallPossible ){ aStatus = KRequestPending; - User::RequestComplete( &aStatus, KErrNone ); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); } return stubAsyncCallPossible; } @@ -396,7 +406,8 @@ { if ( stubAsyncCallPossible ){ aStatus = KRequestPending; - User::RequestComplete( &aStatus, KErrNone ); + TRequestStatus* status = &aStatus; + User::RequestComplete( status, KErrNone ); } return stubAsyncCallPossible; } diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp --- a/logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -114,16 +114,6 @@ return list; } -QContact QContactManager::contact(const QContactLocalId& contactId, const QStringList& definitionRestrictions) const -{ - Q_UNUSED(definitionRestrictions) - QContact contact; - if ( contactId == logsTestContactId ) { - logsTestContactLocalId = logsTestContactId; - } - return contact; -} - QContact QContactManager::contact(const QContactLocalId& contactId, const QContactFetchHint& fetchHint) const { Q_UNUSED(fetchHint) @@ -147,12 +137,15 @@ void QContactDetailFilter::setDetailDefinitionName( const QString& definition, const QString& fieldName) { + Q_UNUSED(definition) + Q_UNUSED(fieldName) +} -} void QContactDetailFilter::setMatchFlags(QContactFilter::MatchFlags flags) { Q_UNUSED(flags) } + void QContactDetailFilter::setValue(const QVariant& value) { logsTestNumber = value.toString(); @@ -176,8 +169,23 @@ QContact& QContact::operator=(const QContact& other) { Q_UNUSED(other) + return *this; } +QContactDetail QContact::detail(const char* definitionId) const +{ + if ( definitionId == QContactName::DefinitionName ){ + QContactName name; + return name; + } else if ( definitionId == QContactPhoneNumber::DefinitionName ){ + QContactPhoneNumber number; + return number; + } + QContactDetail detail; + return detail; +} + + QContactDetail QContact::detail(const QString& definitionId) const { if ( definitionId == QContactName::DefinitionName ){ @@ -192,14 +200,16 @@ } bool QContact::saveDetail(QContactDetail* detail) - { - return true; - } +{ + Q_UNUSED(detail) + return true; +} bool QContact::removeDetail(QContactDetail* detail) - { - return true; - } +{ + Q_UNUSED(detail) + return true; +} QContactLocalId QContact::localId() const @@ -229,6 +239,7 @@ QContactDetail& QContactDetail::operator=(const QContactDetail& other) { Q_UNUSED(other) + return *this; } QString QContactDetail::definitionName() const @@ -260,4 +271,14 @@ return QString(""); } - +QString QContactDetail::value(const char* key) const +{ + if ( key == QContactName::FieldFirstName ){ + return logsFirstName; + } else if ( key == QContactName::FieldLastName ) { + return logsLastName; + } else if ( key == QContactPhoneNumber::FieldNumber ) { + return QString( "12345" ); + } + return QString(""); +} diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/inc/ut_logssystemtimeobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/inc/ut_logssystemtimeobserver.h Fri Aug 06 14:57:47 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef UT_LOGSSYSTEMTIMEOBSERVER_H +#define UT_LOGSSYSTEMTIMEOBSERVER_H + +#include + +class LogsSystemTimeObserver; + +class UT_LogsSystemTimeObserver : public QObject +{ + Q_OBJECT + +private slots: + +/* + * In addition, there are four private slots that are not treated as testfunctions. + * They will be executed by the testing framework and can be used to initialize and clean up + * either the entire test or the current test function. + * + * initTestCase() will be called before the first testfunction is executed. + * cleanupTestCase() will be called after the last testfunction was executed. + * init() will be called before each testfunction is executed. + * cleanup() will be called after every testfunction. +*/ + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + +private slots: //test methods + + void testConstructor(); + void testEnvironmentChangeCallback(); + +private: + + LogsSystemTimeObserver* mTimeObserver; +}; + + +#endif //UT_LOGSSYSTEMTIMEOBSERVER_H diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/main.cpp --- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/main.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/main.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -26,6 +26,7 @@ #include "testresultxmlparser.h" #include "ut_logsremove.h" #include "ut_logsremovestates.h" +#include "ut_logssystemtimeobserver.h" int main(int argc, char *argv[]) @@ -89,6 +90,12 @@ QT_TRAP_THROWING( QTest::qExec(&ut_logsEventData, args_logsEventData); ) parser.parseAndPrintResults(resultFileName,true); + UT_LogsSystemTimeObserver ut_logsSystemTimeObserver; + resultFileName = "c:/ut_logs_logsSystemTimeObserver.xml"; + QStringList args_logsSystemTimeObserver( "ut_logsSystemTimeObserver"); + args_logsSystemTimeObserver << "-xml" << "-o" << resultFileName; + QT_TRAP_THROWING( QTest::qExec(&ut_logsSystemTimeObserver, args_logsSystemTimeObserver); ) + parser.parseAndPrintResults(resultFileName,true); if (promptOnExit) { printf("Press any key...\n"); diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/ut_logssystemtimeobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/ut_logssystemtimeobserver.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "ut_logssystemtimeobserver.h" +#include "logssystemtimeobserver.h" +#include +#include +#include + +void UT_LogsSystemTimeObserver::initTestCase() +{ +} + +void UT_LogsSystemTimeObserver::cleanupTestCase() +{ +} + +void UT_LogsSystemTimeObserver::init() +{ + mTimeObserver = new LogsSystemTimeObserver(); +} + +void UT_LogsSystemTimeObserver::cleanup() +{ + delete mTimeObserver; +} + +void UT_LogsSystemTimeObserver::testConstructor() +{ + QVERIFY( mTimeObserver ); + QVERIFY( mTimeObserver->mEnvChangeNotifier->IsActive() ); +} + +void UT_LogsSystemTimeObserver::testEnvironmentChangeCallback() +{ + QSignalSpy spy(mTimeObserver, SIGNAL(timeFormatChanged())); + QCOMPARE( mTimeObserver->EnvironmentChangeCallback(mTimeObserver), 0 ); + QCOMPARE( spy.count(), 0 ); +} diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/ut_logssymbianos.pro --- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/ut_logssymbianos.pro Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/ut_logssymbianos.pro Fri Aug 06 14:57:47 2010 +0300 @@ -46,6 +46,7 @@ HEADERS += inc/ut_logseventdataparser.h HEADERS += inc/ut_logsremove.h HEADERS += inc/ut_logsremovestates.h +HEADERS += inc/ut_logssystemtimeobserver.h HEADERS += ../../inc/logsdbconnector.h HEADERS += ../../inc/logsworker.h HEADERS += ../../inc/logsreader.h @@ -53,6 +54,7 @@ HEADERS += ../../inc/logsreaderobserver.h HEADERS += ../../inc/logsremove.h HEADERS += ../../inc/logsremovestates.h +HEADERS += ../../inc/logssystemtimeobserver.h HEADERS += ../../../../../recents_plat/logs_engine_api/inc/logsevent.h HEADERS += ../../../inc/logseventdata.h HEADERS += ../../../inc/logscommondata.h @@ -68,6 +70,7 @@ SOURCES += src/ut_logseventdataparser.cpp SOURCES += src/ut_logsremove.cpp SOURCES += src/ut_logsremovestates.cpp +SOURCES += src/ut_logssystemtimeobserver.cpp SOURCES += ../../src/logsdbconnector.cpp SOURCES += ../../src/logsworker.cpp SOURCES += ../../src/logsreader.cpp @@ -77,6 +80,7 @@ SOURCES += ../../src/logseventdataparser.cpp SOURCES += ../../src/logsremove.cpp SOURCES += ../../src/logsremovestates.cpp +SOURCES += ../../src/logssystemtimeobserver.cpp SOURCES += ../../../src/logsevent.cpp SOURCES += ../../../src/logseventdata.cpp SOURCES += ../../../src/logscommondata.cpp @@ -91,6 +95,6 @@ TARGET.UID2 = 0x100039CE TARGET.UID3 = 0xEfaaa9b2 TARGET.CAPABILITY = ALL -TCB - LIBS += -lecom -lflogger -lws32 -lbafl -lqtcontacts + LIBS += -lecom -lflogger -lws32 -lbafl -lqtcontacts -lefsrv TARGET.EPOCALLOWDLLDATA = 1 } diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/src/logsabstractmodel.cpp --- a/logsui/logsengine/src/logsabstractmodel.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/src/logsabstractmodel.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -24,6 +24,10 @@ #include "logsengdefs.h" #include "logsmessage.h" #include +#include +#include +#include "logssystemtimeobserver.h" + Q_DECLARE_METATYPE(LogsEvent *) Q_DECLARE_METATYPE(LogsCall *) @@ -37,7 +41,9 @@ LogsAbstractModel::LogsAbstractModel() : QAbstractListModel(), mDbConnector(0) { LOGS_QDEBUG( "logs [ENG] -> LogsAbstractModel::LogsAbstractModel()" ) - + mSystemTimeObserver = new LogsSystemTimeObserver(this); + connect(mSystemTimeObserver, SIGNAL(timeFormatChanged()), + this, SLOT(updateModel())); LOGS_QDEBUG( "logs [ENG] <- LogsAbstractModel::LogsAbstractModel()" ) } @@ -93,7 +99,7 @@ // bool LogsAbstractModel::isCommunicationPossible(const LogsEvent& event) const { -return ( !event.isRemotePartyPrivate() && !event.isRemotePartyUnknown() ); + return ( !event.isRemotePartyPrivate() && !event.isRemotePartyUnknown() ); } // ----------------------------------------------------------------------------- @@ -109,6 +115,21 @@ // // ----------------------------------------------------------------------------- // +void LogsAbstractModel::updateModel() +{ + LOGS_QDEBUG( "logs [ENG] -> LogsAbstractModel::updateModel(), SYSTEM TIME CHANGED!" ) + //reset(); + if (rowCount()) { + emit dataChanged(createIndex(0,0), createIndex(rowCount(),0)); + } + LOGS_QDEBUG( "logs [ENG] <- LogsAbstractModel::updateModel()" ) +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// QVariant LogsAbstractModel::doGetData(int role, const LogsModelItemContainer& item) const { if ( role == RoleFullEvent ) { @@ -292,6 +313,29 @@ // // ----------------------------------------------------------------------------- // +QString LogsAbstractModel::dateAndTimeString(const QDateTime& dateTime) const +{ + HbExtendedLocale locale = HbExtendedLocale::system(); + QString dateTimeString = + locale.format(dateTime.date(), r_qtn_date_usual_with_zero) + % QChar(' ') + % locale.format(dateTime.time(), r_qtn_time_usual_with_zero); + return dateTimeString; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +QString LogsAbstractModel::durationString(const QTime& time) const +{ + return HbExtendedLocale::system().format(time, r_qtn_time_durat_long_with_zero); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// LogsModelItemContainer::LogsModelItemContainer(LogsEvent* event) : mEvent(event) { diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/src/logsdetailsmodel.cpp --- a/logsui/logsengine/src/logsdetailsmodel.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/src/logsdetailsmodel.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -156,14 +156,25 @@ // // ----------------------------------------------------------------------------- // +void LogsDetailsModel::updateModel() +{ + LOGS_QDEBUG( "logs [ENG] -> LogsDetailsModel::updateModel()" ) + initContent(); + reset(); + LOGS_QDEBUG( "logs [ENG] <- LogsDetailsModel::updateModel()" ) +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// void LogsDetailsModel::contactActionCompleted(bool modified) { if ( modified ){ mEvent->prepareForContactMatching(); if ( mEvent->updateRemotePartyFromContacts( LogsCommonData::getInstance().contactManager() ).length() > 0 ) { - initContent(); - reset(); + updateModel(); } } } @@ -180,8 +191,7 @@ mDuplicates.clear(); mDuplicates = mDbConnector->takeDuplicates(); - initContent(); - reset(); + updateModel(); // Someone else might be reading duplicates as well, don't interfere with them. disconnect( mDbConnector, SIGNAL(duplicatesRead()), this, SLOT(duplicatesRead()) ); @@ -380,7 +390,7 @@ callDurationRow << hbTrId("txt_dialer_ui_dblist_call_duration"); QTime n(0, 0, 0); QTime t = n.addSecs(mEvent->duration()); - callDurationRow << t.toString("hh:mm:ss"); + callDurationRow << durationString(t); mDetailTexts.append(callDurationRow); } @@ -435,6 +445,6 @@ } else { dateAndTimeRow << hbTrId("txt_dialer_ui_dblist_date_and_time"); } - dateAndTimeRow << event.time().toTimeSpec(Qt::LocalTime).toString(); + dateAndTimeRow << dateAndTimeString( event.time().toTimeSpec(Qt::LocalTime) ); mDetailTexts.append(dateAndTimeRow); } diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/src/logsmatchesmodel.cpp --- a/logsui/logsengine/src/logsmatchesmodel.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/src/logsmatchesmodel.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -685,7 +685,8 @@ QStringList list; if ( mEvent ){ list << mFormattedCallerId; - list << mEvent->time().toTimeSpec(Qt::LocalTime).toString(); + list << mParentModel.dateAndTimeString( + mEvent->time().toTimeSpec(Qt::LocalTime) ); } else if ( mContactId > 0 ) { list << mContactName; list << mContactNumber; diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/src/logsmodel.cpp --- a/logsui/logsengine/src/logsmodel.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/src/logsmodel.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -220,7 +220,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; diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/tsrc/stubs/logscntfinder_stub.cpp --- a/logsui/logsengine/tsrc/stubs/logscntfinder_stub.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/tsrc/stubs/logscntfinder_stub.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -398,8 +398,8 @@ if ( !entry->isCached() ) { QContact contact = mContactManager->contact( entry->contactId() ); QContactName contactName = contact.detail( QContactName::DefinitionName ); - entry->setFirstName( contactName.value( QContactName::FieldFirst ) ); - entry->setLastName( contactName.value( QContactName::FieldLast ) ); + entry->setFirstName( contactName.value( QContactName::FieldFirstName ) ); + entry->setLastName( contactName.value( QContactName::FieldLastName ) ); QContactPhoneNumber contactPhoneNumber = contact.detail( QContactPhoneNumber::DefinitionName ); entry->setPhoneNumber( diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/tsrc/symbianos_stub/logseventdataparser_stub.cpp --- a/logsui/logsengine/tsrc/symbianos_stub/logseventdataparser_stub.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/tsrc/symbianos_stub/logseventdataparser_stub.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -25,7 +25,7 @@ // Separator for gprs data (old legacy non-tagged format for sent and // received grps data) -_LIT8(KDataSeparator,","); +//_LIT8(KDataSeparator,","); // ---------------------------------------------------------------------------- // LogsEventDataParser::parse diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/tsrc/symbianos_stub/logssystemtimeobserver_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/logsui/logsengine/tsrc/symbianos_stub/logssystemtimeobserver_stub.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// INCLUDE FILES +#include "logssystemtimeobserver.h" + +// CONSTANTS + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +LogsSystemTimeObserver::LogsSystemTimeObserver(QObject* parent) : QObject(parent) +{ +} + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +LogsSystemTimeObserver::~LogsSystemTimeObserver() +{ +} + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +TInt LogsSystemTimeObserver::EnvironmentChangeCallback(TAny* /*aThis*/) +{ + return 0; +} diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/tsrc/ut_logsengine/src/ut_logsdetailsmodel.cpp --- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsdetailsmodel.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsdetailsmodel.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -26,6 +26,7 @@ #include "logsdbconnector_stub_helper.h" #include #include +#include #include Q_DECLARE_METATYPE(LogsCall *) @@ -115,7 +116,10 @@ // Test date and time display = mModel->data(mModel->index(1), Qt::DisplayRole).toStringList(); QVERIFY( display.count() == 2 ); - QVERIFY( display.at(1) == testDetailsDateAndTime.toTimeSpec(Qt::LocalTime).toString() ); + QDateTime localTime = testDetailsDateAndTime.toTimeSpec(Qt::LocalTime); + QVERIFY( display.at(1).startsWith( + localTime.date().toString(Qt::SystemLocaleShortDate)) ); + decoration = mModel->data(mModel->index(1), Qt::DecorationRole).toList(); QVERIFY( decoration.count() == 1 ); @@ -138,7 +142,9 @@ QVERIFY( display.count() == 2 ); QTime n(0,0,0); QTime t = n.addSecs(testDetailsDuration); - QVERIFY( display.at(1) == t.toString("hh:mm:ss") ); + QChar timeSeparator = HbExtendedLocale::system().timeSeparator(1); + QString tiemFormat = QString("hh%1mm%2ss").arg(timeSeparator).arg(timeSeparator); + QCOMPARE( display.at(1), t.toString(tiemFormat)); decoration = mModel->data(mModel->index(4), Qt::DecorationRole).toList(); QVERIFY( decoration.count() == 1 ); diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/tsrc/ut_logsengine/src/ut_logsmodel.cpp --- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsmodel.cpp Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsmodel.cpp Fri Aug 06 14:57:47 2010 +0300 @@ -39,7 +39,7 @@ #define LOGS_TEST_CMP_ICONS( var, icon ){ \ const HbIcon& tempIcon = qVariantValue( var );\ - QVERIFY( &tempIcon = icon ); } + QVERIFY( &tempIcon == icon ); } #define LOGS_TEST_CREATE_EVENT(eventName, index, eventState ) \ LogsEvent* eventName = new LogsEvent; \ diff -r 68f3171a5819 -r 52d644758b05 logsui/logsengine/tsrc/ut_logsengine/ut_logsengine.pro --- a/logsui/logsengine/tsrc/ut_logsengine/ut_logsengine.pro Thu Jul 08 11:31:03 2010 +0300 +++ b/logsui/logsengine/tsrc/ut_logsengine/ut_logsengine.pro Fri Aug 06 14:57:47 2010 +0300 @@ -71,6 +71,7 @@ HEADERS += ../../logssymbianos/inc/logseventdataparser.h HEADERS += ../../logssymbianos/inc/logsdbconnector.h HEADERS += ../../logssymbianos/inc/logsremove.h +HEADERS += ../../logssymbianos/inc/logssystemtimeobserver.h HEADERS += ../stubs/logscntfinder.h SOURCES += src/main.cpp @@ -105,6 +106,7 @@ SOURCES += ../symbianos_stub/logsdbconnector_stub.cpp SOURCES += ../symbianos_stub/logseventparser_stub.cpp SOURCES += ../symbianos_stub/logseventdataparser_stub.cpp +SOURCES += ../symbianos_stub/logssystemtimeobserver_stub.cpp SOURCES += ../../../tsrc/qtestutils/src/testresultxmlparser.cpp SOURCES += ../stubs/qthighway_stub.cpp SOURCES += ../stubs/logscntfinder_stub.cpp diff -r 68f3171a5819 -r 52d644758b05 recents_plat/logs_engine_api/inc/logsabstractmodel.h --- a/recents_plat/logs_engine_api/inc/logsabstractmodel.h Thu Jul 08 11:31:03 2010 +0300 +++ b/recents_plat/logs_engine_api/inc/logsabstractmodel.h Fri Aug 06 14:57:47 2010 +0300 @@ -26,6 +26,7 @@ class LogsModelItemContainer; class HbIcon; class LogsContact; +class LogsSystemTimeObserver; /** * Abstract logs model. @@ -91,10 +92,21 @@ void getDecorationData(const LogsEvent& event, QList& iconList) const; LogsDbConnector* dbConnector(); + + /** + * Construct a date and time string based on system locale + */ + QString dateAndTimeString(const QDateTime& dateTime) const; + /** + * Construct a duration string using separator from system locale + */ + QString durationString(const QTime& time) const; + protected slots: virtual void contactSavingCompleted(bool modified); + virtual void updateModel(); protected: @@ -111,6 +123,7 @@ LogsDbConnector* mDbConnector; QMap mIcons; + LogsSystemTimeObserver* mSystemTimeObserver; private: // Testing related friend definitions