# HG changeset patch # User hgs # Date 1279877569 -10800 # Node ID 6aefa3341fcc458f3ac7de899b8f9d66ce9da7e2 # Parent 8d5d7fcf9b59b667b0a99054d4728e505410d9dd 201029 diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cbs/cbsserver/Group/CbsServer.mmp --- a/cbs/cbsserver/Group/CbsServer.mmp Wed Jul 21 18:26:52 2010 +0300 +++ b/cbs/cbsserver/Group/CbsServer.mmp Fri Jul 23 12:32:49 2010 +0300 @@ -39,6 +39,7 @@ START RESOURCE ../Data/CbsServer.rss HEADER +TARGET CbsServer.rsg TARGETPATH RESOURCE_FILES_DIR LANGUAGE_IDS END diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cbs/cbsserver/ServerSrc/CCbsReceiverHelper.cpp --- a/cbs/cbsserver/ServerSrc/CCbsReceiverHelper.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/cbs/cbsserver/ServerSrc/CCbsReceiverHelper.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -40,13 +40,15 @@ #include "CCbsDbImpTopicMessages.h" #include "CCbsDbImpTopicCollection.h" #include "CCbsRecMessage.h" -#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS -#include // View server access -#else -#include -#endif -#include // ECellBroadcastNotification -#include // Soft Notification API +// <-- QT PHONE START --> +//#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS +//#include // View server access +//#else +//#include +//#endif +//#include // ECellBroadcastNotification +//#include // Soft Notification API +// <-- QT PHONE END --> #include #include // <-- QT PHONE START --> @@ -62,12 +64,17 @@ // CONSTANTS +// <-- QT PHONE START --> // UID of CBS UI application -#define KUidCbsUiappDef 0x101F4CD3 -const TUid KUidCbsUiappApp = { KUidCbsUiappDef }; +//#define KUidCbsUiappDef 0x101F4CD3 +//const TUid KUidCbsUiappApp = { KUidCbsUiappDef }; +// <-- QT PHONE END --> -const TInt KCbsImmediateMessageIdInt = 313; -const TUid KCbsImmediateMessageId = { KCbsImmediateMessageIdInt }; +// <-- QT PHONE START --> +//const TInt KCbsImmediateMessageIdInt = 313; +//const TUid KCbsImmediateMessageId = { KCbsImmediateMessageIdInt }; +// <-- QT PHONE END --> + // <-- QT PHONE START --> //const TInt KCbsMessageTone = 2; // See SharedDataKeysVariant.h or NcnListInternalPSKeys.h // <-- QT PHONE END --> @@ -325,7 +332,11 @@ { CBSLOGSTRING("CBSSERVER: >>> CCbsReceiverHelper::ConstructL()"); + // <-- QT PHONE START --> + /* iVwsSession = CVwsSessionWrapper::NewL(); + */ + // <-- QT PHONE END--> // Array for SIM Topic numbers. This way we know which topics // to delete also from the SIM card (when deleting all topics). @@ -366,7 +377,11 @@ CBSLOGSTRING("CBSSERVER: >>> CCbsReceiverHelper::~CCbsReceiverHelper()"); delete iSimTopics; + // <-- QT PHONE START --> + /* delete iVwsSession; + */ + // <-- QT PHONE END--> CBSLOGSTRING("CBSSERVER: <<< CCbsReceiverHelper::~CCbsReceiverHelper()"); } @@ -835,8 +850,10 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -void CCbsReceiverHelper::LaunchMessageSoftNotificationL( const TBool aPlayTone ) +void CCbsReceiverHelper::LaunchMessageSoftNotificationL( const TBool /*aPlayTone*/ ) { + // <-- QT PHONE START --> + /* TInt numberOfHotMsgs( 0 ); numberOfHotMsgs = iDatabase.TopicListL().UnreadHotmarkedMessageCount(); @@ -851,6 +868,8 @@ notifier->SetNotificationCountL( ECellBroadcastNotification, numberOfHotMsgs ); CleanupStack::PopAndDestroy( notifier ); + */ + // <-- QT PHONE END--> } // ----------------------------------------------------------------------------- @@ -860,14 +879,18 @@ // ----------------------------------------------------------------------------- // void CCbsReceiverHelper::LaunchMessageImmediateDisplay( - const TCbsDbMessage& aMessage ) + const TCbsDbMessage& /*aMessage*/ ) { + // <-- QT PHONE START --> + /* TUid uiViewUid( TUid::Uid( ECbsUiMsgViewId ) ); TVwsViewId id( KUidCbsUiappApp, uiViewUid ); TPckgBuf pckg( aMessage.iHandle ); // Ignore result value. iVwsSession->CreateActivateViewEvent( id, KCbsImmediateMessageId, pckg ); + */ + // <-- QT PHONE END--> } // ----------------------------------------------------------------------------- diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/mocks/mock_hbglobal.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/mocks/mock_hbglobal.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,26 @@ +/* +* 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 +#include +#include "hbglobal.h" + +// ============================ MEMBER FUNCTIONS =============================== + +QString hbTrId(const char *id, int n) +{ + SMC_MOCK_METHOD2( QString, const char *, id, int, n ) +} \ No newline at end of file diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/mocks/mock_psetcalldivertingwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/mocks/mock_psetcalldivertingwrapper.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,136 @@ +/* +* 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 +#include +#include "psetcalldivertingwrapper.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// PSetCallDivertingWrapper::PSetCallDivertingWrapper +// ----------------------------------------------------------------------------- +// +PSetCallDivertingWrapper::PSetCallDivertingWrapper( + CPsetContainer & psetContainer, + QObject * parent ) + //: + //QObject( /*psetContainer, parent*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// PSetCallDivertingWrapper::~PSetCallDivertingWrapper +// ----------------------------------------------------------------------------- +// +PSetCallDivertingWrapper::~PSetCallDivertingWrapper( ) + { + + } + + +// ----------------------------------------------------------------------------- +// PSetCallDivertingWrapper::setCallDiverting +// ----------------------------------------------------------------------------- +// +int PSetCallDivertingWrapper::setCallDiverting( + PSCallDivertingCommand & aSetting, + int aBasicServiceGroup ) + { + SMC_MOCK_METHOD2( int, PSCallDivertingCommand &, aSetting, + int, aBasicServiceGroup ) + } + + +// ----------------------------------------------------------------------------- +// PSetCallDivertingWrapper::getCallDivertingStatus +// ----------------------------------------------------------------------------- +// +void PSetCallDivertingWrapper::getCallDivertingStatus( + const PsServiceGroup aServiceGroup, + const PsCallDivertingCondition aCondition, + int aBsc ) + { + int iDummy = aServiceGroup; + SMC_MOCK_METHOD3( void, int, iDummy, + const PsCallDivertingCondition, aCondition, + int, aBsc ) + } + + +// ----------------------------------------------------------------------------- +// PSetCallDivertingWrapper::cancelProcess +// ----------------------------------------------------------------------------- +// +void PSetCallDivertingWrapper::cancelProcess( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// PSetCallDivertingWrapper::getDefaultNumbers +// ----------------------------------------------------------------------------- +// +void PSetCallDivertingWrapper::getDefaultNumbers( + QStringList & aDefNumbers ) + { + QStringList list; + list << "0401234567" << "0501234567" << "0451234567"; + aDefNumbers = list; + + SMC_MOCK_METHOD1( void, QStringList &, aDefNumbers ) + } + + +// ----------------------------------------------------------------------------- +// PSetCallDivertingWrapper::setNewDefaultNumber +// ----------------------------------------------------------------------------- +// +void PSetCallDivertingWrapper::setNewDefaultNumber( + QString aNumber ) + { + SMC_MOCK_METHOD1( void, QString, aNumber ) + } + + +// ----------------------------------------------------------------------------- +// PSetCallDivertingWrapper::getVoiceMailBoxNumber +// ----------------------------------------------------------------------------- +// +int PSetCallDivertingWrapper::getVoiceMailBoxNumber( + QString & aNumber, + PsService aService ) + { + SMC_MOCK_METHOD2( int, QString &, aNumber, + PsService, aService ) + } + + +// ----------------------------------------------------------------------------- +// PSetCallDivertingWrapper::queryVoiceMailBoxNumber +// ----------------------------------------------------------------------------- +// +int PSetCallDivertingWrapper::queryVoiceMailBoxNumber( + QString & aNumber, + PsService aService ) + { + SMC_MOCK_METHOD2( int, QString &, aNumber, + PsService, aService ) + } + diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/mocks/mock_psetcallwaitingwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/mocks/mock_psetcallwaitingwrapper.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,76 @@ +/* +* 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 +#include +#include "psetcallwaitingwrapper.h" +#include "psetcallwaitingwrapper_p.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapper::PSetCallWaitingWrapper +// ----------------------------------------------------------------------------- +// +PSetCallWaitingWrapper::PSetCallWaitingWrapper( + CPsetContainer & psetContainer, + QObject * parent ) : QObject( parent ) + { + Q_UNUSED(psetContainer); + } + + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapper::~PSetCallWaitingWrapper +// ----------------------------------------------------------------------------- +// +PSetCallWaitingWrapper::~PSetCallWaitingWrapper( ) + { + + } + + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapper::setCallWaiting +// ----------------------------------------------------------------------------- +// +void PSetCallWaitingWrapper::setCallWaiting( + PsCallWaitingCommand aSetting, + int aBasicServiceGroup ) + { + SMC_MOCK_METHOD2( void, PsCallWaitingCommand, aSetting, + int, aBasicServiceGroup ) + } + + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapper::getCallWaitingStatus +// ----------------------------------------------------------------------------- +// +void PSetCallWaitingWrapper::getCallWaitingStatus( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapper::cancelProcess +// ----------------------------------------------------------------------------- +// +void PSetCallWaitingWrapper::cancelProcess( ) + { + SMC_MOCK_METHOD0( void ) + } diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/mocks/mock_psetcallwaitingwrapper_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/mocks/mock_psetcallwaitingwrapper_p.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,111 @@ +/* +* 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 +#include +#include +#include +#include +#include "psetcallwaitingwrapper_p.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapperPrivate::PSetCallWaitingWrapperPrivate +// ----------------------------------------------------------------------------- +// +PSetCallWaitingWrapperPrivate::PSetCallWaitingWrapperPrivate( + PSetCallWaitingWrapper & owner ) + : m_Owner(owner) + { + + } + + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapperPrivate::~PSetCallWaitingWrapperPrivate +// ----------------------------------------------------------------------------- +// +PSetCallWaitingWrapperPrivate::~PSetCallWaitingWrapperPrivate( ) + { + + } + + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapperPrivate::HandleCallWaitingGetStatusL +// ----------------------------------------------------------------------------- +// +void PSetCallWaitingWrapperPrivate::HandleCallWaitingGetStatusL( + const MPsetCallWaiting::TGetCallWaitingStatus aStatus, + TUint8 aBsc[KPSetNumberOfBsc]) + { + Q_UNUSED(aStatus) + Q_UNUSED(aBsc) + // TODO: make compile + // SMC_MOCK_METHOD2( void, const MPsetCallWaiting::TGetCallWaitingStatus, aStatus, + // TUint8[KPSetNumberOfBsc], aBsc) + } + + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapperPrivate::HandleCallWaitingChangedL +// ----------------------------------------------------------------------------- +// +void PSetCallWaitingWrapperPrivate::HandleCallWaitingChangedL( + const MPsetCallWaiting::TSetCallWaiting aSetting, + const TInt aResult ) + { + SMC_MOCK_METHOD2( void, const MPsetCallWaiting::TSetCallWaiting, aSetting, + const TInt, aResult ) + } + + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapperPrivate::HandleCWRequestingL +// ----------------------------------------------------------------------------- +// +void PSetCallWaitingWrapperPrivate::HandleCWRequestingL( + TBool aOngoing, + TBool aInterrupted ) + { + SMC_MOCK_METHOD2( void, TBool, aOngoing, + TBool, aInterrupted ) + } + + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapperPrivate::HandleCWErrorL +// ----------------------------------------------------------------------------- +// +void PSetCallWaitingWrapperPrivate::HandleCWErrorL( + TInt aReason ) + { + SMC_MOCK_METHOD1( void, TInt, aReason ) + } + + +// ----------------------------------------------------------------------------- +// PSetCallWaitingWrapperPrivate::SetEngineContact +// ----------------------------------------------------------------------------- +// +void PSetCallWaitingWrapperPrivate::SetEngineContact( + MPsetCallWaiting & aEngineContact ) + { + SMC_MOCK_METHOD1( void, MPsetCallWaiting &, aEngineContact ) + } + + diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/mocks/mock_psuinotes.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/mocks/mock_psuinotes.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,205 @@ +/* +* 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 +#include +#include +#include "psuinotes.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// PsUiNotes::PsUiNotes +// ----------------------------------------------------------------------------- +// +PsUiNotes::PsUiNotes( ) + //: + //QObject( /**/ ) + { + + } + +// ----------------------------------------------------------------------------- +// PsUiNotes::PsUiNotes +// ----------------------------------------------------------------------------- +// +PsUiNotes::~PsUiNotes( ) + { + + } + + +// ----------------------------------------------------------------------------- +// PsUiNotes::instance +// ----------------------------------------------------------------------------- +// +PsUiNotes * PsUiNotes::instance( ) + { + SMC_MOCK_METHOD0( PsUiNotes * ) + } + + +// ----------------------------------------------------------------------------- +// PsUiNotes::showGlobalProgressNote +// ----------------------------------------------------------------------------- +// +void PsUiNotes::showGlobalProgressNote( + int & noteId, + const QString & text ) + { + SMC_MOCK_METHOD2( void, int &, noteId, + const QString &, text ) + } + + +// ----------------------------------------------------------------------------- +// PsUiNotes::showGlobalNote +// ----------------------------------------------------------------------------- +// +void PsUiNotes::showGlobalNote( + int & noteId, + const QString & text, + HbMessageBox::MessageBoxType noteType ) + { + SMC_MOCK_METHOD3( void, int &, noteId, + const QString &, text, + HbMessageBox::MessageBoxType, noteType ) + } + + +// ----------------------------------------------------------------------------- +// PsUiNotes::showGlobalErrorNote +// ----------------------------------------------------------------------------- +// +void PsUiNotes::showGlobalErrorNote( + int & noteId, + int errorCode ) + { + SMC_MOCK_METHOD2( void, int &, noteId, + int, errorCode ) + } + + +// ----------------------------------------------------------------------------- +// PsUiNotes::showCallDivertDetails +// ----------------------------------------------------------------------------- +// +void PsUiNotes::showCallDivertDetails( + const QList & divertingStatusList ) + { + SMC_MOCK_METHOD1( void, const QList &, divertingStatusList ) + } + + +// ----------------------------------------------------------------------------- +// PsUiNotes::showPasswordQueryDialog +// ----------------------------------------------------------------------------- +// +void PsUiNotes::showPasswordQueryDialog( + const QString & title, + const QValidator & validator, + int maxPasswordLength ) + { + SMC_MOCK_METHOD3( void, const QString &, title, + const QValidator &, validator, + int, maxPasswordLength ) + } + + +// ----------------------------------------------------------------------------- +// PsUiNotes::cancelNote +// ----------------------------------------------------------------------------- +// +void PsUiNotes::cancelNote( + int noteId ) + { + SMC_MOCK_METHOD1( void, int, noteId ) + } + + +// ----------------------------------------------------------------------------- +// PsUiNotes::noteShowing +// ----------------------------------------------------------------------------- +// +bool PsUiNotes::noteShowing( ) + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// PsUiNotes::finishedPasswordQueryDialog +// ----------------------------------------------------------------------------- +// +void PsUiNotes::finishedPasswordQueryDialog( + HbAction * action2 ) + { + SMC_MOCK_METHOD1( void, HbAction *, action2 ) + } + + +// ----------------------------------------------------------------------------- +// PsUiNotes::showNotificationDialog +// ----------------------------------------------------------------------------- +// +void PsUiNotes::showNotificationDialog( + const QString & text ) + { + SMC_MOCK_METHOD1( void, const QString &, text ) + } + + +// ----------------------------------------------------------------------------- +// PsUiNotes::showGlobalNotificationDialog +// ----------------------------------------------------------------------------- +// +void PsUiNotes::showGlobalNotificationDialog( + const QString & text ) + { + SMC_MOCK_METHOD1( void, const QString &, text ) + } + + +// ----------------------------------------------------------------------------- +// CpPhoneNotes::activeNoteAboutToClose +// ----------------------------------------------------------------------------- +// +void PsUiNotes::activeNoteAboutToClose() +{ + SMC_MOCK_METHOD0( void ) +} + + +// ----------------------------------------------------------------------------- +// CpPhoneNotes::handleProgressNoteCanceled +// ----------------------------------------------------------------------------- +// +void PsUiNotes::handleProgressNoteCanceled() +{ + SMC_MOCK_METHOD0( void ) +} + + +// ----------------------------------------------------------------------------- +// CpPhoneNotes::passwordTextChanged +// ----------------------------------------------------------------------------- +// +void PsUiNotes::passwordTextChanged() +{ + SMC_MOCK_METHOD0( void ) +} + + diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/mocks/mock_qobject.cpp --- a/cellular/psuinotes/tsrc/mocks/mock_qobject.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/cellular/psuinotes/tsrc/mocks/mock_qobject.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -330,13 +330,13 @@ const char * signal, const QObject * receiver, const char * member, - Qt:: ConnectionType ) + Qt::ConnectionType ConnectionType ) { -// SMC_MOCK_METHOD5( bool, const QObject *, sender, -// const char *, signal, -// const QObject *, receiver, -// const char *, member, -// Qt::, ConnectionType ) + SMC_MOCK_METHOD5( bool, const QObject *, sender, + const char *, signal, + const QObject *, receiver, + const char *, member, + Qt::ConnectionType, ConnectionType ) } diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/ut_psuidivertnotehandler/qtestmains60.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/ut_psuidivertnotehandler/qtestmains60.h Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,40 @@ +/* +* 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 QTESTMAINS60 +#define QTESTMAINS60 + +#define QTEST_MAIN_S60(TestObject) \ +int main(int argc, char *argv[]) \ +{ \ +char *new_argv[3]; \ +QCoreApplication app(argc, argv); \ +\ +QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \ +QByteArray bytes = str.toAscii(); \ +\ +char arg1[] = "-o"; \ +\ +new_argv[0] = argv[0]; \ +new_argv[1] = arg1; \ +new_argv[2] = bytes.data(); \ +\ +TestObject tc; \ +return QTest::qExec(&tc, 3, new_argv); \ +} + +#endif \ No newline at end of file diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/ut_psuidivertnotehandler/ut_psuidivertnotehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/ut_psuidivertnotehandler/ut_psuidivertnotehandler.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,195 @@ +/* +* 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" +/* +* 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_psuidivertnotehandler.h" +#include "psuidivertnotehandler.h" +#include "psetcalldivertingwrapper.h" +#include "qtestmains60.h" +#include + +class CPsetContainer +{ +public: + CPsetContainer(){}; + ~CPsetContainer(){}; +}; + +/*QString hbTrId(const char *id, int n) +{ + SMC_MOCK_METHOD2( QString, const char *, id, int, n ) +}*/ + + +/*! + UT_psuidivertnotehandler::UT_psuidivertnotehandler + */ +UT_psuidivertnotehandler::UT_psuidivertnotehandler() +{ + +} + +/*! + UT_psuidivertnotehandler::~UT_psuidivertnotehandler + */ +UT_psuidivertnotehandler::~UT_psuidivertnotehandler() +{ + +} + +/*! + UT_psuidivertnotehandler::init + */ +void UT_psuidivertnotehandler::init() +{ + initialize(); +} + +/*! + UT_psuidivertnotehandler::cleanup + */ +void UT_psuidivertnotehandler::cleanup() +{ + reset(); +} + +/*! + UT_psuidivertnotehandler::t_memleak + */ +void UT_psuidivertnotehandler::t_memleak() +{ + +} + +/*! + UT_psuidivertnotehandler::t_construction + */ +void UT_psuidivertnotehandler::t_construction() +{ + expect("QObject::connect").times(4); + CPsetContainer psetContainer; + PSetCallDivertingWrapper *mockDivertWrapper = new PSetCallDivertingWrapper(psetContainer,this); + PsUiDivertNoteHandler *divertHandler = new PsUiDivertNoteHandler(*mockDivertWrapper); + delete divertHandler; + delete mockDivertWrapper; + QVERIFY(verify()); +} + +void UT_psuidivertnotehandler::t_handleDivertingChanged() +{ + CPsetContainer psetContainer; + PSetCallDivertingWrapper *mockDivertWrapper = new PSetCallDivertingWrapper(psetContainer,this); + PsUiDivertNoteHandler *divertHandler = new PsUiDivertNoteHandler(*mockDivertWrapper); + + // Divert activated, plural false + PSCallDivertingCommand testCommand; + testCommand.iStatus = DivertingStatusActive; + expect("PsUiNotes::showGlobalNotificationDialog"); + divertHandler->handleDivertingChanged(testCommand, false); + QVERIFY(verify()); + + // Divert activated, plural true + testCommand.iStatus = DivertingStatusActive; + expect("PsUiNotes::showGlobalNotificationDialog"); + divertHandler->handleDivertingChanged(testCommand, true); + QVERIFY(verify()); + + // Divert deactivated, plural false + testCommand.iStatus = DivertingStatusInactive; + expect("PsUiNotes::showGlobalNotificationDialog"); + divertHandler->handleDivertingChanged(testCommand, false); + QVERIFY(verify()); + + // Divert deactivated, plural true + testCommand.iStatus = DivertingStatusInactive; + expect("PsUiNotes::showGlobalNotificationDialog"); + divertHandler->handleDivertingChanged(testCommand, true); + QVERIFY(verify()); + + // Divert status unknown + testCommand.iStatus = DivertingStatusUnknown; + expect("PsUiNotes::showGlobalNotificationDialog"); + divertHandler->handleDivertingChanged(testCommand, true); + QVERIFY(verify()); + + delete divertHandler; + delete mockDivertWrapper; +} + +void UT_psuidivertnotehandler::t_handleDivertingStatus() +{ + CPsetContainer psetContainer; + PSetCallDivertingWrapper *mockDivertWrapper = new PSetCallDivertingWrapper(psetContainer,this); + PsUiDivertNoteHandler *divertHandler = new PsUiDivertNoteHandler(*mockDivertWrapper); + QList divertList; + + expect("PsUiNotes::showCallDivertDetails").with(divertList); + divertHandler->handleDivertingStatus(divertList,false); + + QVERIFY(verify()); + delete divertHandler; + delete mockDivertWrapper; +} + +void UT_psuidivertnotehandler::t_handleDivertingError() +{ + CPsetContainer psetContainer; + PSetCallDivertingWrapper *mockDivertWrapper = new PSetCallDivertingWrapper(psetContainer,this); + PsUiDivertNoteHandler *divertHandler = new PsUiDivertNoteHandler(*mockDivertWrapper); + int errorCode = -1; + expect("PsUiNotes::cancelNote"); + expect("PsUiNotes::showGlobalErrorNote"); + divertHandler->handleDivertingError(errorCode); + + QVERIFY(verify()); + delete divertHandler; + delete mockDivertWrapper; +} + +void UT_psuidivertnotehandler::t_handleCFRequesting() +{ + CPsetContainer psetContainer; + PSetCallDivertingWrapper *mockDivertWrapper = new PSetCallDivertingWrapper(psetContainer,this); + PsUiDivertNoteHandler *divertHandler = new PsUiDivertNoteHandler(*mockDivertWrapper); + + bool ongoing = true; + bool interrupted = false; + expect("PsUiNotes::showGlobalProgressNote"); + divertHandler->handleCFRequesting(ongoing,interrupted); + QVERIFY(verify()); + + ongoing = false; + interrupted = true; + expect("PsUiNotes::cancelNote").times(2); + divertHandler->handleCFRequesting(ongoing,interrupted); + QVERIFY(verify()); + + ongoing = false; + interrupted = false; + expect("PsUiNotes::cancelNote"); + divertHandler->handleCFRequesting(ongoing,interrupted); + QVERIFY(verify()); + + delete divertHandler; + delete mockDivertWrapper; +} + +QTEST_MAIN_S60(UT_psuidivertnotehandler) diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/ut_psuidivertnotehandler/ut_psuidivertnotehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/ut_psuidivertnotehandler/ut_psuidivertnotehandler.h Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,48 @@ +/* +* 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_PSUIDIVERTNOTEHANDLER_H +#define UT_PSUIDIVERTNOTEHANDLER_H + +#include +#include + +class UT_psuidivertnotehandler : public QObject, MockService +{ + Q_OBJECT + +public: + UT_psuidivertnotehandler(); + ~UT_psuidivertnotehandler(); + +private slots: + void init(); + void cleanup(); + void t_memleak(); + + void t_construction(); + void t_handleDivertingChanged(); + void t_handleDivertingStatus(); + void t_handleDivertingError(); + void t_handleCFRequesting(); + + +private: + +}; + +#endif // UT_PSUIDIVERTNOTEHANDLER_H diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/ut_psuidivertnotehandler/ut_psuidivertnotehandler.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/ut_psuidivertnotehandler/ut_psuidivertnotehandler.pro Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,48 @@ +# +# 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: +# + + +CONFIG += hb qtestlib +TEMPLATE = app +TARGET = +DEPENDPATH += . ../../src/ +INCLUDEPATH += . ../../inc/ +DEFINES += BUILD_PSUINOTES BUILD_PSETWRAPPER + +QT -= gui +QT += testlib + +symbian: { + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + LIBS += -lmocklib -lsymbianmock +} + +# test code +HEADERS += ut_psuidivertnotehandler.h +SOURCES += ut_psuidivertnotehandler.cpp + +# code to be tested +HEADERS += ../../../../phonesrv_plat/phone_settings_ui_notes_api/inc/psuidivertnotehandler.h + +SOURCES += ../../src/psuidivertnotehandler.cpp + +# mocks needed for testing +HEADERS += ../../../../phonesrv_plat/phone_settings_ui_notes_api/inc/psuinotes.h \ + ../../../../phonesrv_plat/phone_settings_api/inc/psetcalldivertingwrapper.h + +SOURCES += ../mocks/mock_psuinotes.cpp \ + ../mocks/mock_psetcalldivertingwrapper.cpp \ + ../mocks/mock_qobject.cpp diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/ut_psuiwaitingnotehandler/qtestmains60.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/ut_psuiwaitingnotehandler/qtestmains60.h Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,40 @@ +/* +* 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 QTESTMAINS60 +#define QTESTMAINS60 + +#define QTEST_MAIN_S60(TestObject) \ +int main(int argc, char *argv[]) \ +{ \ +char *new_argv[3]; \ +QCoreApplication app(argc, argv); \ +\ +QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \ +QByteArray bytes = str.toAscii(); \ +\ +char arg1[] = "-o"; \ +\ +new_argv[0] = argv[0]; \ +new_argv[1] = arg1; \ +new_argv[2] = bytes.data(); \ +\ +TestObject tc; \ +return QTest::qExec(&tc, 3, new_argv); \ +} + +#endif \ No newline at end of file diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/ut_psuiwaitingnotehandler/ut_psuiwaitingnotehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/ut_psuiwaitingnotehandler/ut_psuiwaitingnotehandler.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,175 @@ +/* +* 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" +/* +* 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_psuiwaitingnotehandler.h" +#include "psuiwaitingnotehandler.h" +#include "psetcallwaitingwrapper.h" +#include "qtestmains60.h" +#include + +class CPsetContainer +{ +public: + CPsetContainer(){}; + ~CPsetContainer(){}; +}; + +/*! + UT_psuiwaitingnotehandler::UT_psuiwaitingnotehandler + */ +UT_psuiwaitingnotehandler::UT_psuiwaitingnotehandler() +{ + +} + +/*! + UT_psuiwaitingnotehandler::~UT_psuiwaitingnotehandler + */ +UT_psuiwaitingnotehandler::~UT_psuiwaitingnotehandler() +{ + +} + +/*! + UT_psuiwaitingnotehandler::init + */ +void UT_psuiwaitingnotehandler::init() +{ + initialize(); + m_psetContainer = new CPsetContainer(); + m_mockWaitingWrapper = new PSetCallWaitingWrapper(*m_psetContainer,this); + m_waitingHandler = new PsUiWaitingNoteHandler(*m_mockWaitingWrapper); +} + +/*! + UT_psuiwaitingnotehandler::cleanup + */ +void UT_psuiwaitingnotehandler::cleanup() +{ + delete m_waitingHandler; + delete m_mockWaitingWrapper; + delete m_psetContainer; + reset(); +} + +/*! + UT_psuiwaitingnotehandler::t_memleak + */ +void UT_psuiwaitingnotehandler::t_memleak() +{ + +} + +/*! + UT_psuiwaitingnotehandler::t_construction + */ +void UT_psuiwaitingnotehandler::t_construction() +{ + expect("QObject::connect").times(4); + CPsetContainer psetContainer; + PSetCallWaitingWrapper *mockWaitingWrapper = new PSetCallWaitingWrapper(psetContainer,this); + PsUiWaitingNoteHandler *waitingHandler = new PsUiWaitingNoteHandler(*mockWaitingWrapper); + delete waitingHandler; + delete mockWaitingWrapper; + QVERIFY(verify()); +} + +void UT_psuiwaitingnotehandler::t_handleCallWaitingGetStatus() +{ + + PSetCallWaitingWrapper::PsCallWaitingStatus status = + PSetCallWaitingWrapper::StatusNotProvisioned; + QList serviceGroups; + expect("PsUiNotes::cancelNote"); + expect("PsUiSettingsWrapper::isFeatureCallWaitingDistiquishNotProvisionedEnabled").returns(true); + expect("PsUiNotes::showGlobalNotificationDialog"); + m_waitingHandler->handleCallWaitingGetStatus(status,serviceGroups); + QVERIFY(verify()); + + status = PSetCallWaitingWrapper::StatusActive; + expect("PsUiNotes::showGlobalNotificationDialog"); + m_waitingHandler->handleCallWaitingGetStatus(status,serviceGroups); + QVERIFY(verify()); + + status = PSetCallWaitingWrapper::StatusDisabled; + expect("PsUiNotes::showGlobalNotificationDialog"); + m_waitingHandler->handleCallWaitingGetStatus(status,serviceGroups); + QVERIFY(verify()); +} + +void UT_psuiwaitingnotehandler::t_handleCallWaitingChanged() +{ + PSetCallWaitingWrapper::PsCallWaitingCommand setting; + int result; + + setting = PSetCallWaitingWrapper::ActivateCallWaiting; + result = true; + expect("PsUiNotes::showGlobalNote"); + m_waitingHandler->handleCallWaitingChanged(setting,result); + QVERIFY(verify()); + + setting = PSetCallWaitingWrapper::ActivateCallWaiting; + result = false; + expect("PsUiNotes::showGlobalNotificationDialog"); + m_waitingHandler->handleCallWaitingChanged(setting,result); + QVERIFY(verify()); + + setting = PSetCallWaitingWrapper::DeactivateCallWaiting; + result = false; + expect("PsUiNotes::showGlobalNotificationDialog"); + m_waitingHandler->handleCallWaitingChanged(setting,result); + QVERIFY(verify()); + + setting = PSetCallWaitingWrapper::CheckCallWaitingStatus; + result = false; + expect("PsUiNotes::showGlobalNotificationDialog"); + m_waitingHandler->handleCallWaitingChanged(setting,result); + QVERIFY(verify()); +} + +void UT_psuiwaitingnotehandler::t_handleCallWaitingRequesting() +{ + expect("PsUiNotes::showGlobalProgressNote"); + bool ongoing = true; + bool interrupted = false; + m_waitingHandler->handleCallWaitingRequesting(ongoing,interrupted); + QVERIFY(verify()); + + expect("PsUiNotes::cancelNote"); + ongoing = false; + interrupted = true; + m_waitingHandler->handleCallWaitingRequesting(ongoing,interrupted); + + QVERIFY(verify()); +} + +void UT_psuiwaitingnotehandler::t_handleCallWaitingError() +{ + expect("PsUiNotes::cancelNote"); + expect("PsUiNotes::showGlobalErrorNote"); + int error = -1; + m_waitingHandler->handleCallWaitingError(error); + + QVERIFY(verify()); +} + +QTEST_MAIN_S60(UT_psuiwaitingnotehandler) diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/ut_psuiwaitingnotehandler/ut_psuiwaitingnotehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/ut_psuiwaitingnotehandler/ut_psuiwaitingnotehandler.h Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,54 @@ +/* +* 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_PSUIWAITINGNOTEHANDLER_H +#define UT_PSUIWAITINGNOTEHANDLER_H + +#include +#include + +class CPsetContainer; +class PSetCallWaitingWrapper; +class PsUiWaitingNoteHandler; + +class UT_psuiwaitingnotehandler : public QObject, MockService +{ + Q_OBJECT + +public: + UT_psuiwaitingnotehandler(); + ~UT_psuiwaitingnotehandler(); + +private slots: + void init(); + void cleanup(); + void t_memleak(); + + void t_construction(); + void t_handleCallWaitingGetStatus(); + void t_handleCallWaitingChanged(); + void t_handleCallWaitingRequesting(); + void t_handleCallWaitingError(); + + +private: + CPsetContainer *m_psetContainer; + PSetCallWaitingWrapper *m_mockWaitingWrapper; + PsUiWaitingNoteHandler *m_waitingHandler; +}; + +#endif // UT_PSUIWAITINGNOTEHANDLER_H diff -r 8d5d7fcf9b59 -r 6aefa3341fcc cellular/psuinotes/tsrc/ut_psuiwaitingnotehandler/ut_psuiwaitingnotehandler.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cellular/psuinotes/tsrc/ut_psuiwaitingnotehandler/ut_psuiwaitingnotehandler.pro Fri Jul 23 12:32:49 2010 +0300 @@ -0,0 +1,52 @@ +# +# Copyright (c) 2010 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: +# + + +CONFIG += hb qtestlib +TEMPLATE = app +TARGET = +DEPENDPATH += . ../../src/ +INCLUDEPATH += . ../../inc/ +DEFINES += BUILD_PSUINOTES BUILD_PSETWRAPPER + +QT -= gui +QT += testlib + +symbian: { + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + LIBS += -lmocklib -lsymbianmock +} + +# test code +HEADERS += ut_psuiwaitingnotehandler.h +SOURCES += ut_psuiwaitingnotehandler.cpp + +# code to be tested +HEADERS += ../../../../phonesrv_plat/phone_settings_ui_notes_api/inc/psuiwaitingnotehandler.h +SOURCES += ../../src/psuiwaitingnotehandler.cpp + +# mocks needed for testing +HEADERS += ../../../../phonesrv_plat/phone_settings_ui_notes_api/inc/psuinotes.h \ + ../../../../phonesrv_plat/phone_settings_api/inc/psetcallwaitingwrapper.h \ + ../../../../phonesrv_plat/phone_settings_api/inc/psetcalldivertingwrapper.h \ + ../../../telephonysettings/xqbindings/psetwrapper/src/psetcallwaitingwrapper_p.h \ + ../../inc/psuiutils.h + +SOURCES += ../mocks/mock_psuinotes.cpp \ + ../mocks/mock_psetcallwaitingwrapper.cpp \ + ../mocks/mock_qobject.cpp \ + ../mocks/mock_psuiutils.cpp \ + ../mocks/mock_psetcallwaitingwrapper_p.cpp diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satengine/satserver/Engine/group/SatEngine.mmp --- a/satengine/satserver/Engine/group/SatEngine.mmp Wed Jul 21 18:26:52 2010 +0300 +++ b/satengine/satserver/Engine/group/SatEngine.mmp Fri Jul 23 12:32:49 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 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" @@ -75,12 +75,8 @@ SYSTEMINCLUDE /epoc32/include/ecom SYSTEMINCLUDE ../../../../inc // Domain telephonyservices SYSTEMINCLUDE ../../../inc // Subsystem satengine +SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore -START RESOURCE ../src/SatServer.rss -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END // RESOURCE USERINCLUDE ../inc USERINCLUDE ../../inc @@ -108,6 +104,7 @@ LIBRARY netmeta.lib LIBRARY cmmanager.lib LIBRARY extendedconnpref.lib +LIBRARY hbcore.lib #ifdef ENABLE_SAT_LOGGING LIBRARY flogger.lib diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satengine/satserver/Engine/group/bld.inf --- a/satengine/satserver/Engine/group/bld.inf Wed Jul 21 18:26:52 2010 +0300 +++ b/satengine/satserver/Engine/group/bld.inf Fri Jul 23 12:32:49 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2003-2010 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" @@ -24,7 +24,6 @@ PRJ_EXPORTS ../inc/MSatShellController.h |../../../../inc/MSatShellController.h ../../CenRep/SATInternalPSKeys.h |../../../../inc/SATInternalPSKeys.h -../../loc/SatServer.loc MW_LAYER_LOC_EXPORT_PATH( satserver.loc ) PRJ_MMPFILES SatEngine.mmp diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satengine/satserver/Engine/inc/CSatCommandContainer.h --- a/satengine/satserver/Engine/inc/CSatCommandContainer.h Wed Jul 21 18:26:52 2010 +0300 +++ b/satengine/satserver/Engine/inc/CSatCommandContainer.h Fri Jul 23 12:32:49 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 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" @@ -372,7 +372,7 @@ * @since S60 v3.0 * @param aResourceId Selects name of the item to be read. */ - void CreateSatAppNameL( const TInt aResourceId ); + void CreateSatAppNameL( const TDesC& aResourceId ); /** * Gives pointer to BIP Utils class. diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satengine/satserver/Engine/src/CSatCommandContainer.cpp --- a/satengine/satserver/Engine/src/CSatCommandContainer.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/satengine/satserver/Engine/src/CSatCommandContainer.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -20,12 +20,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include "MSatSystemState.h" #include "TSatSystemStateFactory.h" @@ -52,16 +52,14 @@ #include "csatmultimodeapi.h" #include "csatsactivewrapper.h" -// Drive letter for resource file -_LIT( KResourceDrive, "Z:" ); -// SatServer's resource file -_LIT( KSatServerRsc, "SatServer.rsc" ); - +_LIT( KResourceDrive, "z:\\resource\\qt\\translations" ); +_LIT( KSatServerRsc, "satapp_"); +_LIT( KSatLogTitle, "txt_simatk_title_sim_services"); +_LIT( KSatCmccTitle, "txt_simatk_titlw_cmcc_sim_services"); const TUid KSatInterfaceDefinitionUid = { 0x1000f001 }; const TInt KSizeOfBuf = 50; -const TInt8 KCreateSatAppNamePop( 2 ); // Important plugins UIDs. These are started on startup // Implementation UID is from the .rss @@ -395,7 +393,7 @@ iIsCmccSim = ETrue; // Update default name read in ConstructL. - TRAPD( err, CreateSatAppNameL( R_QTN_SAT_CMCC_TITLE ) ); + TRAPD( err, CreateSatAppNameL( KSatCmccTitle ) ); LOG2( NORMAL, "SATENGINE: Error: %i", err ) if ( KErrNone == err ) { @@ -627,7 +625,7 @@ { LOG( NORMAL, "SATENGINE: CSatCommandContainer::RestoreSatAppNameL name reset" ) - CreateSatAppNameL( R_QTN_SAT_LOG_TITLE ); + CreateSatAppNameL( KSatLogTitle ); } LOG( NORMAL, "SATENGINE: CSatCommandContainer::RestoreSatAppNameL exiting" ) } @@ -902,7 +900,7 @@ LOG( NORMAL, "SATENGINE: CSatCommandContainer::ConstructL calling" ) iIsCmccSim = EFalse; - CreateSatAppNameL( R_QTN_SAT_LOG_TITLE ); + CreateSatAppNameL( KSatLogTitle ); // Register for ui events in order to keep track if user or command // has launched the ui. @@ -991,52 +989,22 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -void CSatCommandContainer::CreateSatAppNameL( const TInt aResourceId ) +void CSatCommandContainer::CreateSatAppNameL( const TDesC& aResourceId ) { LOG( NORMAL, "SATENGINE: CSatCommandContainer::CreateSatAppNameL calling" ) - - // Open the RFs session. - RFs fs; - - User::LeaveIfError( fs.Connect() ); - - // Push close operation in tbe cleanup stack - CleanupClosePushL( fs ); - - RResourceFile resFile; - // Backslashes are already defined in resource file, not needed here. - TBuf buf( KResourceDrive ); - buf.Append( KDC_RESOURCE_FILES_DIR ); - buf.Append( KSatServerRsc ); - - TFileName fileName( buf ); - - BaflUtils::NearestLanguageFile( fs, fileName ); - - // Open the resource file - resFile.OpenL( fs, fileName ); + delete iSatAppName; + iSatAppName = NULL; + const TBool textResolver = HbTextResolverSymbian::Init( + KSatServerRsc, KResourceDrive ); + LOG2(NORMAL,"SATENGINE: CSatCommandContainer::\ + CreateSatAppNameL textResolver = %d", textResolver ) + LOG2(NORMAL,"SATENGINE: CSatCommandContainer::\ + CreateSatAppNameL aResourceId = %S", &aResourceId ) - // Push close operation in the cleanup stack - CleanupClosePushL( resFile ); - - resFile.ConfirmSignatureL( ESatSResourceSignature ); - - // Reads a resource structure with memory allocation. - HBufC8* dataBuffer = resFile.AllocReadLC( aResourceId ); - - TResourceReader resReader; - resReader.SetBuffer( dataBuffer ); - - // Reads a string with memory allocation - iSatAppName = resReader.ReadHBufCL(); + iSatAppName = HbTextResolverSymbian::LoadL( aResourceId ); + LOG2(NORMAL,"SATENGINE: CSatCommandContainer::\ + CreateSatAppNameL iSatAppName = %S", iSatAppName ) iSatBipName.Copy( SatAppName() ); - - // dataBuffer - CleanupStack::PopAndDestroy( dataBuffer ); - // resFile, Calls resFile.Close() - // fs, Calls fs.Close - CleanupStack::PopAndDestroy( KCreateSatAppNamePop ); - LOG( NORMAL, "SATENGINE: CSatCommandContainer::CreateSatAppNameL exiting" ) } diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satengine/satserver/Engine/src/SatServer.rss --- a/satengine/satserver/Engine/src/SatServer.rss Wed Jul 21 18:26:52 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2003-2007 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: This file contains all the resources for the module. -* -*/ - - -NAME SATS - -#include - -#include "SatServer.hrh" -#include - -RESOURCE RSS_SIGNATURE { signature = ESatSResourceSignature; } - -/******************* Localized texts **********************/ - -// ----------------------------------------------------------------------------- -// r_sats_ti_log_title -// Defines localized text -// ----------------------------------------------------------------------------- -// -RESOURCE LBUF r_qtn_sat_log_title - { - txt = qtn_sat_log_title; - } - -RESOURCE LBUF r_qtn_sat_cmcc_title - { - txt = qtn_sat_cmcc_title; - } diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satengine/satserver/group/bld.inf --- a/satengine/satserver/group/bld.inf Wed Jul 21 18:26:52 2010 +0300 +++ b/satengine/satserver/group/bld.inf Fri Jul 23 12:32:49 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2003-2010 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" @@ -24,7 +24,6 @@ PRJ_EXPORTS satserver_stub.sis /epoc32/data/z/system/install/SatServer_stub.sis ../rom/satserver.iby CORE_MW_LAYER_IBY_EXPORT_PATH( satserver.iby ) -../rom/SatServerResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH( SatServerResources.iby ) // Generic configuration interface for component cenrep settings ../conf/sat.confml MW_LAYER_CONFML(sat.confml) diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satengine/satserver/loc/SatServer.loc --- a/satengine/satserver/loc/SatServer.loc Wed Jul 21 18:26:52 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2003-2007 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: SatServer localisation file -* -*/ - - -// LOCALISATION STRINGS: - -//d: Sat application name under the Sat icon in app shell. -//l: cell_app_pane_t1 -//w: S90DeskAppName -// -#define qtn_sat_log_title "SIM Services" - -//d: Application title and SAT application name when China -//d: Mobile SIM cards used -//l: cell_app_pane_t1 -#define qtn_sat_cmcc_title "SIM Card Application" - -// End of File diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satengine/satserver/rom/SatServerResources.iby --- a/satengine/satserver/rom/SatServerResources.iby Wed Jul 21 18:26:52 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2003-2006 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: Sat Server Resources iby file, contains resource file -* iby- information -* -*/ - - -#ifndef SATSERVERRESOURCES_IBY -#define SATSERVERRESOURCES_IBY - -#ifdef __SIMCARD - -// Resource file(s) for SatServer -data = DATAZ_\RESOURCE_FILES_DIR\satserver.rsc RESOURCE_FILES_DIR\satserver.rsc - -#endif // __SIMCARD - -#endif // SATSERVERRESOURCES_IBY - -// End of File diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/inc/satappmainhandler.h --- a/satui/satapp/inc/satappmainhandler.h Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/inc/satappmainhandler.h Fri Jul 23 12:32:49 2010 +0300 @@ -23,6 +23,7 @@ #include class HbMainWindow; +class HbMessageBox; class SatAppServerDispatcher; class SatAppMenuProvider; class SatAppInputProvider; @@ -37,6 +38,7 @@ public: SatAppMainHandler(HbMainWindow &window, QObject *parent = 0); ~SatAppMainHandler(); + void showOfflineWarning(); private: void initConnections(); @@ -47,7 +49,7 @@ private: void removeActivity(); - + bool isOffline(); private: // data SatAppServerDispatcher* mServer; @@ -57,6 +59,8 @@ SatAppPopupProvider* mPopup; SatAppConfirmProvider *mConfirm; QVariantHash mActivity; + + HbMessageBox *mOfflineWarningDlg; }; #endif // SATAPPMAINHANDLER_H diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/inc/satappserverdispatcher.h --- a/satui/satapp/inc/satappserverdispatcher.h Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/inc/satappserverdispatcher.h Fri Jul 23 12:32:49 2010 +0300 @@ -96,7 +96,6 @@ void ConnectSatSessionL(); void DisconnectSatSession(); - int ProfileState(); public: // from MSatUiObserver diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/src/satappaction.cpp --- a/satui/satapp/src/satappaction.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/src/satappaction.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -80,6 +80,12 @@ mState=Waiting; qDebug("SATAPP: waitUntilCompleted: waiting..."); loop.exec(); + // When use the FSW complete the satapp, the signal aboutToExit + // can not be recieved. temp solution + if(Waiting == mState){ + mState=Completed; + mResponse=ESatSessionTerminatedByUser; + } qDebug("SATAPP: waitUntilCompleted: ...released"); } diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/src/satappconfirmprovider.cpp --- a/satui/satapp/src/satappconfirmprovider.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/src/satappconfirmprovider.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -42,7 +42,8 @@ SatAppConfirmProvider::~SatAppConfirmProvider() { qDebug("SATAPP: SatAppConfirmProvider::~SatAppConfirmProvider >"); - clearScreen(); + delete mConfirmQuery; + mConfirmQuery = 0; qDebug("SATAPP: SatAppConfirmProvider::~SatAppConfirmProvider <"); } diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/src/satappinputprovider.cpp --- a/satui/satapp/src/satappinputprovider.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/src/satappinputprovider.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -51,7 +51,8 @@ SatAppInputProvider::~SatAppInputProvider() { qDebug("SATAPP: SatAppInputProvider::~SatAppInputProvider >"); - resetState(); + delete mCurrentDialog; + mCurrentDialog = 0; qDebug("SATAPP: SatAppInputProvider::~SatAppInputProvider <"); } diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/src/satappmainhandler.cpp --- a/satui/satapp/src/satappmainhandler.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/src/satappmainhandler.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -15,9 +15,16 @@ * * */ - +//Qt #include #include +#include +#include + +// symbian +#include +#include + #include "satappmainhandler.h" #include "satappserverdispatcher.h" #include "satappmenuprovider.h" @@ -38,18 +45,25 @@ // ---------------------------------------------------------------------------- // SatAppMainHandler::SatAppMainHandler(HbMainWindow &window, - QObject */*parent*/) + QObject */*parent*/): +mOfflineWarningDlg(NULL) { qDebug("SATAPP: SatAppMainHandler::SatAppMainHandler >"); + + if(!isOffline()){ + mServer = new SatAppServerDispatcher(this); + mMenu = new SatAppMenuProvider(&window, this); + mInput = new SatAppInputProvider(this); + mTone = new SatAppToneProvider(this); + mPopup = new SatAppPopupProvider(this); + mConfirm = new SatAppConfirmProvider(this); + initConnections(); + } + else{ + showOfflineWarning(); + } + removeActivity(); - mServer = new SatAppServerDispatcher(this); - mMenu = new SatAppMenuProvider(&window, this); - mInput = new SatAppInputProvider(this); - mTone = new SatAppToneProvider(this); - mPopup = new SatAppPopupProvider(this); - mConfirm = new SatAppConfirmProvider(this); - initConnections(); - removeActivity(); qDebug("SATAPP: SatAppMainHandler::SatAppMainHandler <"); } @@ -60,7 +74,9 @@ // SatAppMainHandler::~SatAppMainHandler() { - qDebug("SATAPP: SatAppMainHandler::~SatAppMainHandler"); + qDebug("SATAPP: SatAppMainHandler::~SatAppMainHandler >"); + delete mOfflineWarningDlg; + qDebug("SATAPP: SatAppMainHandler::~SatAppMainHandler <"); } // ---------------------------------------------------------------------------- @@ -205,13 +221,13 @@ // void SatAppMainHandler::saveActivity() { - qDebug("SATAPP: SatAppMenuProvider::saveActivity >"); + qDebug("SATAPP: SatAppMainHandler::saveActivity >"); // Add the activity to the activity manager const bool ok = qobject_cast(qApp)->activityManager()-> addActivity(SATAPP_ACTIVITY_ID, QVariant(), mActivity); - qDebug("SATAPP: SatAppMenuProvider::saveActivity < %d", ok); + qDebug("SATAPP: SatAppMainHandler::saveActivity < %d", ok); } // ---------------------------------------------------------------------------- @@ -220,7 +236,7 @@ // void SatAppMainHandler::removeActivity() { - qDebug("SATAPP: SatAppMenuProvider::removeActivity >"); + qDebug("SATAPP: SatAppMainHandler::removeActivity >"); QList activityList = qobject_cast(qApp)->activityManager()->activities(); @@ -237,7 +253,50 @@ const bool ok = qobject_cast(qApp)->activityManager()-> removeActivity(SATAPP_ACTIVITY_ID); - qDebug("SATAPP: SatAppMenuProvider::removeActivity < %d", ok); + qDebug("SATAPP: SatAppMainHandler::removeActivity < %d", ok); +} + +// ---------------------------------------------------------------------------- +// SatAppMainHandler::isOffline +// ---------------------------------------------------------------------------- +// +bool SatAppMainHandler::isOffline() +{ + //If current active profile is offline, show a warning and quit + qDebug("SATAPP: SatAppMainHandler::isOffline >"); + TInt profileId(0); + CRepository* cr (NULL); + TRAPD(err, cr = CRepository::NewL(KCRUidProfileEngine)); + if ( KErrNone == err ) + { + // Get the ID of the currently active profile: + const TInt error = cr->Get(KProEngActiveProfile, profileId); + qDebug("SATAPP: SatAppMainHandler::isOffline get active \ + profile error=%d",error); + delete cr; + } + qDebug("SATAPP: SatAppMainHandler::isOffline< profileId = %d",profileId); + return ( KSatActiveProfileOffline == profileId ); +} + +// ---------------------------------------------------------------------------- +// SatAppMainHandler::showOfflineWarning +// ---------------------------------------------------------------------------- +// +void SatAppMainHandler::showOfflineWarning() +{ + qDebug("SATAPP: SatAppMainHandler::showOfflineWarning >"); + mOfflineWarningDlg = + new HbMessageBox(HbMessageBox::MessageTypeWarning); + mOfflineWarningDlg->setText( + hbTrId("txt_simatk_dpopinfo_sim_services_not_available")); + mOfflineWarningDlg->clearActions(); + mOfflineWarningDlg->setDismissPolicy(HbDialog::TapOutside); + mOfflineWarningDlg->setTimeout(KDisplayTxtUserClearTimeout); + SAT_ASSERT(connect(mOfflineWarningDlg, SIGNAL(aboutToClose()), + qApp, SLOT(quit()))); + mOfflineWarningDlg->open(); + qDebug("SATAPP: SatAppMainHandler::showOfflineWarning <"); } //End of file diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/src/satappmenuprovider.cpp --- a/satui/satapp/src/satappmenuprovider.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/src/satappmenuprovider.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -169,7 +169,9 @@ void SatAppMenuProvider::setUpMenu(SatAppAction &action) { qDebug("SATAPP: SatAppMenuProvider::setUpMenu >"); - if (!mSetupMenuView) loadMainView(); + if (!mSetupMenuView) { + loadMainView(); + } resetState(); mCurrentAction = &action; switchView(); @@ -209,7 +211,11 @@ void SatAppMenuProvider::selectItem( SatAppAction &action) { qDebug("SATAPP: SatAppMenuProvider::selectItem >"); - + + if (!mSetupMenuView) { + loadMainView(); + } + resetState(); mCurrentAction = &action; switchView(); diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/src/satapppopupprovider.cpp --- a/satui/satapp/src/satapppopupprovider.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/src/satapppopupprovider.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -49,7 +49,26 @@ SatAppPopupProvider::~SatAppPopupProvider() { qDebug("SATAPP: SatAppPopupProvider::~SatAppPopupProvider >"); - clearScreen(); + + if (mWaitDialog) { + qDebug("SATAPP: SatAppPopupProvider::~SatAppPopupProvider wait note"); + mWaitDialog->close(); + delete mWaitDialog; + mWaitDialog = NULL; + } + + if (mWaitDeviceDialog) { + qDebug("SATAPP: SatAppPopupProvider::~SatAppPopupProvider device note"); + mWaitDeviceDialog->close(); + delete mWaitDeviceDialog; + mWaitDeviceDialog = NULL; + } + + if (mDisplayText){ + qDebug( "SatAppPopupProvider::~SatAppPopupProvider DisplayText" ); + delete mDisplayText; + mDisplayText = 0; + } qDebug("SATAPP: SatAppPopupProvider::~SatAppPopupProvider <"); } @@ -236,8 +255,7 @@ mWaitDeviceDialog = NULL; } - qDebug("SATAPP:SatAppPopupProvider::stopShowWaitNote: Get(KProEngActiveProfile, profileId); - qDebug("SATAPP: SatAppServerDispatcher::ProfileState error=%d", - error); - delete cr; - } - - return profileId; - } - -// ---------------------------------------------------------------------------- // My own quick string -> descriptor conversion function :-) // ---------------------------------------------------------------------------- // @@ -325,8 +301,7 @@ QT_TRYCATCH_LEAVING( // validate - if (!aMenuItems.MdcaCount() || - (KSatActiveProfileOffline == ProfileState())) { + if (!aMenuItems.MdcaCount()) { emit clearScreen(); QCoreApplication::instance()->quit(); return ESatSuccess; diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/src/satapptoneprovider.cpp --- a/satui/satapp/src/satapptoneprovider.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/src/satapptoneprovider.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -51,10 +51,23 @@ SatAppToneProvider::~SatAppToneProvider() { qDebug("SATAPP: SatAppToneProvider::~SatAppToneProvider >"); + if (mCurrentAction) { stopPlayTone(); } - resetState(); + + if (mPermanentNote) { + qDebug("SatAppToneProvider::resetState delete mPermanentNote"); + delete mPermanentNote; + mPermanentNote = 0; + } + + if (mTimer) { + qDebug("SatAppToneProvider::resetState delete timer"); + delete mTimer; + mTimer = 0; + } + qDebug("SATAPP: SatAppToneProvider::~SatAppToneProvider <"); } diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/tsrc/ut_satapp/inc/ut_satappmainhandler.h --- a/satui/satapp/tsrc/ut_satapp/inc/ut_satappmainhandler.h Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/tsrc/ut_satapp/inc/ut_satappmainhandler.h Fri Jul 23 12:32:49 2010 +0300 @@ -60,6 +60,12 @@ * */ void testCreateMainHandler(); + + /** + * Test SatAppMainHandler's constructor in offline. + * + */ + void testCreateMainHandler_OfflineMode(); private: diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/tsrc/ut_satapp/src/ut_satappinputprovider.cpp --- a/satui/satapp/tsrc/ut_satapp/src/ut_satappinputprovider.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/tsrc/ut_satapp/src/ut_satappinputprovider.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -187,9 +187,9 @@ test.mInput->getInkey(a); } // at this point everything should be cleaned up safely, and action - // should be completed with ESatNoResponseFromUser + // should be completed later when application exit or timeout - QCOMPARE(a.response(),ESatNoResponseFromUser); + QCOMPARE(a.response(),ESatFailure); } void Ut_SatAppInputProvider::testGetInkeyImmediateAndOk() @@ -366,9 +366,9 @@ test.mInput->getInput(a); } // at this point input dialog out of scope and destroyed. - // pending action should have been completed with ESatNoResponseFromUser + // pending action should have been completed later when application exit or timeout - QCOMPARE(a.response(),ESatNoResponseFromUser); + QCOMPARE(a.response(),ESatFailure); } diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/tsrc/ut_satapp/src/ut_satappmainhandler.cpp --- a/satui/satapp/tsrc/ut_satapp/src/ut_satappmainhandler.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/tsrc/ut_satapp/src/ut_satappmainhandler.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -17,9 +17,12 @@ #include +#include +#include #include "ut_satappmainhandler.h" //test class #include "satappmainhandler.h" +#include "satappconstant.h" // ----------------------------------------------------------------------------- // Ut_SatAppMainHandler::Ut_SatAppMainHandler @@ -71,16 +74,52 @@ } // ----------------------------------------------------------------------------- -// Ut_SatAppMainHandler::testProfileState +// Ut_SatAppMainHandler::testCreateMainHandler // // Connects to test object signal and verifies received data. // ----------------------------------------------------------------------------- void Ut_SatAppMainHandler::testCreateMainHandler() { - qDebug("Ut_SatAppMainHandler::testProfileState >"); + qDebug("Ut_SatAppMainHandler::testCreateMainHandler >"); mMainHandler = new SatAppMainHandler(*mMainWindow); QVERIFY(mMainHandler); - qDebug("Ut_SatAppMainHandler::testProfileState <"); + qDebug("Ut_SatAppMainHandler::testCreateMainHandler <"); } +// ----------------------------------------------------------------------------- +// Ut_SatAppMainHandler::testCreateMainHandler_OfflineMode +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppMainHandler::testCreateMainHandler_OfflineMode() +{ + qDebug("Ut_SatAppMainHandler::testCreateMainHandler_OfflineMode >"); + cleanupTestCase(); + TInt profileId(0); + CRepository* cr (NULL); + TRAPD(err, cr = CRepository::NewL(KCRUidProfileEngine)); + if ( KErrNone == err ) + { + // Get the ID of the currently active profile: + TInt error = cr->Get(KProEngActiveProfile, profileId); + qDebug("Ut_SatAppMainHandler::SatAppMainHandler get active \ + profile error=%d, profileId=%d", error, profileId); + if( KErrNone != error){ + delete cr; + return; + } + error = cr->Set(KProEngActiveProfile, + KSatActiveProfileOffline); + qDebug("Ut_SatAppMainHandler::SatAppMainHandler set active \ + profile error=%d",error); + mMainHandler = new SatAppMainHandler(*mMainWindow); + QVERIFY(mMainHandler); + error = cr->Set(KProEngActiveProfile, profileId); + qDebug("Ut_SatAppMainHandler::SatAppMainHandler set active \ + profile error=%d",error); + delete cr; + } + + qDebug("Ut_SatAppMainHandler::testCreateMainHandler_OfflineMode <"); +} // End of file diff -r 8d5d7fcf9b59 -r 6aefa3341fcc satui/satapp/tsrc/ut_satapp/src/ut_satapppopupprovider.cpp --- a/satui/satapp/tsrc/ut_satapp/src/ut_satapppopupprovider.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/satui/satapp/tsrc/ut_satapp/src/ut_satapppopupprovider.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -120,7 +120,7 @@ SatAppAction a(ESatDisplayTextAction); a.set(KeyText,"hello world"); a.set(KeyApplicationName,"sat"); - a.set(KeySustainedText,true); + a.set(KeySustainedText,false); a.set(KeyDuration,1000); a.set(KeyWaitUserToClear,true); a.setResponse(ESatFailure); diff -r 8d5d7fcf9b59 -r 6aefa3341fcc vmbx/vmbxcpplugin/inc/customedit.h --- a/vmbx/vmbxcpplugin/inc/customedit.h Wed Jul 21 18:26:52 2010 +0300 +++ b/vmbx/vmbxcpplugin/inc/customedit.h Fri Jul 23 12:32:49 2010 +0300 @@ -19,6 +19,8 @@ #define CUSTOMEDIT_H #include +#include + class CustomEdit : public HbLineEdit { @@ -46,7 +48,17 @@ Click line edit */ void editItemClicked(); + +private slots: + + // emits the editItemClicked signal + void emitEditItemClicked(); + +private: + + // timer for item clicked emission + QTimer mItemClickedTimer; + }; #endif //CUSTOMEDIT_H - diff -r 8d5d7fcf9b59 -r 6aefa3341fcc vmbx/vmbxcpplugin/src/customedit.cpp --- a/vmbx/vmbxcpplugin/src/customedit.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/vmbx/vmbxcpplugin/src/customedit.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -1,4 +1,4 @@ - /* +/* * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available @@ -15,8 +15,6 @@ * */ -#include - #include "customedit.h" #include "loggerutil.h" @@ -26,7 +24,10 @@ CustomEdit::CustomEdit(QGraphicsItem *parent) : HbLineEdit(parent) { - _DBGLOG("CustomEdit::CustomEdit()") + _DBGLOG("CustomEdit::CustomEdit() >") + const bool ret = connect(&mItemClickedTimer, SIGNAL(timeout()), + this, SLOT(emitEditItemClicked())); + _DBGLOG2("CustomEdit::CustomEdit() <", ret) } /*! @@ -35,25 +36,39 @@ CustomEdit::~CustomEdit() { _DBGLOG("CustomEdit::CustomEdit()") + disconnect(&mItemClickedTimer, SIGNAL(timeout()), + this, SLOT(emitEditItemClicked())); } /*! - mousePressEvent + focusInEvent */ void CustomEdit::focusInEvent(QFocusEvent *event) { _DBGLOG("CustomEdit::focusInEvent() >") if (!event->gotFocus()) { + _DBGLOG("CustomEdit::focusInEvent() ignore") event->ignore(); - _DBGLOG("CustomEdit::focusInEvent() ignore") - return; } else { - emit editItemClicked(); + _DBGLOG("CustomEdit::focusInEvent() emit clicked") + // When focus comes to the controller, a 100 ms timer is started. + // a signal is emitted after this 100 ms, and focus transfer to other controller, + // after the other controller finished,to avoid focus gained again. + mItemClickedTimer.start(100); event->accept(); - _DBGLOG("CustomEdit::focusInEvent() emit clicked") } _DBGLOG("CustomEdit::focusInEvent() <") } - + +/*! + emitEditItemClicked +*/ +void CustomEdit::emitEditItemClicked() +{ + _DBGLOG("CustomEdit::emitEditItemClicked() >") + emit editItemClicked(); + mItemClickedTimer.stop(); + _DBGLOG("CustomEdit::emitEditItemClicked() <") +} // End of file diff -r 8d5d7fcf9b59 -r 6aefa3341fcc vmbx/vmbxcpplugin/tsrc/src/ut_customedit.cpp --- a/vmbx/vmbxcpplugin/tsrc/src/ut_customedit.cpp Wed Jul 21 18:26:52 2010 +0300 +++ b/vmbx/vmbxcpplugin/tsrc/src/ut_customedit.cpp Fri Jul 23 12:32:49 2010 +0300 @@ -18,6 +18,7 @@ #include #include #include +#include #include "ut_customedit.h" #include "customedit.h" @@ -44,9 +45,15 @@ Qt::MouseFocusReason); QVERIFY(event); edit->focusInEvent(event); + // test for emitEditItemClicked + QEventLoop loop; + QTimer timer; + timer.start(150); + connect( &timer,SIGNAL(timeout()), + &loop,SLOT(quit())); + loop.exec(); delete event; event = NULL; - delete edit; edit = NULL; QVERIFY(!edit); diff -r 8d5d7fcf9b59 -r 6aefa3341fcc vmbx/vmbxengine/tsrc/ut_vmbxengine/ut_vmbxengine.pro --- a/vmbx/vmbxengine/tsrc/ut_vmbxengine/ut_vmbxengine.pro Wed Jul 21 18:26:52 2010 +0300 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/ut_vmbxengine.pro Fri Jul 23 12:32:49 2010 +0300 @@ -112,12 +112,13 @@ SOURCES += src\qtuihandler_mock.cpp SOURCES += src\cenrep_mock.cpp -LIBS += -lflogger.dll -LIBS += -lfeatmgr.dll -LIBS += -lcenrepnotifhandler.dll -LIBS += -lphoneclient.dll -LIBS += -lsssettings.dll -LIBS += -lsatclient.dll -LIBS += -lserviceprovidersettings.dll +LIBS += -lflogger +LIBS += -lfeatmgr +LIBS += -lcenrepnotifhandler +LIBS += -lphoneclient +LIBS += -lsssettings +LIBS += -lsatclient +LIBS += -lserviceprovidersettings +LIBS += -lefsrv -#End of files \ No newline at end of file +#End of file