# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277305985 -10800 # Node ID b04270301d3bfc45f52d58842c9cd2342ac91d1e # Parent 41c0a814d878948c12a0628a697ab7fdc4b8fb1c Revision: 201023 Kit: 2010125 diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/inc/logsmainwindow.h --- a/logsui/logsapp/inc/logsmainwindow.h Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/inc/logsmainwindow.h Wed Jun 23 18:13:05 2010 +0300 @@ -21,8 +21,6 @@ #include #include -class LogsForegroundWatcher; - class LogsMainWindow : public HbMainWindow { @@ -45,12 +43,9 @@ signals: void callKeyPressed(); - void appFocusGained(); - void appFocusLost(); private: - LogsForegroundWatcher* mWatcher; bool mForeground; friend class UT_LogsMainWindow; diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/inc/logsrecentcallsview.h --- a/logsui/logsapp/inc/logsrecentcallsview.h Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/inc/logsrecentcallsview.h Wed Jun 23 18:13:05 2010 +0300 @@ -19,7 +19,6 @@ #include "logsfilter.h" #include "logsbaseview.h" -#include class HbListView; class HbLabel; @@ -106,7 +105,6 @@ //from HbWidget void gestureEvent(QGestureEvent *event); - QSwipeGesture::SwipeDirection swipeAngleToDirection(int angle, int delta); int getListItemTextWidth(); diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/inc/logsviewmanager.h --- a/logsui/logsapp/inc/logsviewmanager.h Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/inc/logsviewmanager.h Wed Jun 23 18:13:05 2010 +0300 @@ -57,8 +57,6 @@ void changeRecentView(LogsServices::LogsView view, bool showDialpad); void changeMatchesView(QString dialpadText); - void appFocusGained(); - void appFocusLost(); public: // From LogsAbstractViewManager diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/logsapp.pro --- a/logsui/logsapp/logsapp.pro Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/logsapp.pro Wed Jun 23 18:13:05 2010 +0300 @@ -43,7 +43,6 @@ HEADERS += inc/logseffecthandler.h HEADERS += inc/logspageindicator.h HEADERS += inc/logspageindicatoritem.h -HEADERS += ../logsengine/logssymbianos/inc/logsforegroundwatcher.h SOURCES += src/main.cpp SOURCES += src/logsmainwindow.cpp @@ -58,7 +57,6 @@ SOURCES += src/logseffecthandler.cpp SOURCES += src/logspageindicator.cpp SOURCES += src/logspageindicatoritem.cpp -SOURCES += ../logsengine/logssymbianos/src/logsforegroundwatcher.cpp symbian: { TARGET.UID2 = 0x100039CE diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/resources/detailsView.docml --- a/logsui/logsapp/resources/detailsView.docml Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/resources/detailsView.docml Wed Jun 23 18:13:05 2010 +0300 @@ -1,25 +1,25 @@ - + - + - + - + - + @@ -34,16 +34,16 @@ - + - + - + - + diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/resources/matchesView.docml --- a/logsui/logsapp/resources/matchesView.docml Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/resources/matchesView.docml Wed Jun 23 18:13:05 2010 +0300 @@ -22,16 +22,16 @@ - + - + - + - + @@ -63,17 +63,6 @@ - - - - - - - - - - - @@ -109,6 +98,17 @@ + + + + + + + + + + +
@@ -117,6 +117,17 @@ + + + + + + + + + + +
@@ -125,6 +136,17 @@ + + + + + + + + + + +
diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/resources/recentCallsView.docml --- a/logsui/logsapp/resources/recentCallsView.docml Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/resources/recentCallsView.docml Wed Jun 23 18:13:05 2010 +0300 @@ -7,7 +7,7 @@ - + @@ -28,19 +28,19 @@ - + - + - + - + diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/src/logsbaseview.cpp --- a/logsui/logsapp/src/logsbaseview.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/src/logsbaseview.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -744,14 +744,14 @@ popup->setAttribute(Qt::WA_DeleteOnClose); popup->setTimeout( HbPopup::NoTimeout ); popup->addAction( - new HbAction(hbTrId("txt_dial_button_cancel"), popup)); + new HbAction(hbTrId("txt_common_button_cancel"), popup)); HbWidget* buttonWidget = new HbWidget(popup); QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical); HbPushButton* addButton = new HbPushButton(buttonWidget); addButton->setStretched(true); - addButton->setText(hbTrId("txt_dial_list_save_as_a_new_contact")); + addButton->setText(hbTrId("txt_dial_button_save_as_a_new_contact")); HbIcon plusIcon("qtg_mono_plus"); addButton->setIcon(plusIcon); connect(addButton, SIGNAL(clicked()), popup, SLOT(close())); @@ -759,7 +759,7 @@ HbPushButton* updateButton = new HbPushButton(buttonWidget); updateButton->setStretched(true); - updateButton->setText(hbTrId("txt_dial_list_update_existing_contact")); + updateButton->setText(hbTrId("txt_dial_button_update_existing_contact")); updateButton->setIcon(plusIcon); connect(updateButton, SIGNAL(clicked()), popup, SLOT(close())); connect(updateButton, SIGNAL(clicked()), diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/src/logsmainwindow.cpp --- a/logsui/logsapp/src/logsmainwindow.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/src/logsmainwindow.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -17,7 +17,6 @@ #include "logsmainwindow.h" #include "logslogger.h" -#include "logsforegroundwatcher.h" #include #include @@ -30,9 +29,6 @@ if ( viewport() ){ viewport()->grabGesture(Qt::SwipeGesture); } - mWatcher = new LogsForegroundWatcher(this); - connect( mWatcher, SIGNAL(losingForeground()), this, SIGNAL(appFocusLost()) ); - connect( mWatcher, SIGNAL(gainingForeground()), this, SIGNAL(appFocusGained()) ); } // ----------------------------------------------------------------------------- diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/src/logsrecentcallsview.cpp --- a/logsui/logsapp/src/logsrecentcallsview.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/src/logsrecentcallsview.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -42,13 +42,13 @@ #include #include #include +#include #include #include Q_DECLARE_METATYPE(LogsMatchesModel*) const int logsMissedCallsMarkingDelayMs = 1000; -const int logsSwipeAngleDelta = 30; // angle is from 0 to 360 // ----------------------------------------------------------------------------- // LogsRecentCallsView::LogsRecentCallsView @@ -536,55 +536,25 @@ { QGesture* gesture = event->gesture(Qt::SwipeGesture); if (gesture) { - QSwipeGesture* swipe = static_cast(gesture); - if (swipe->state() == Qt::GestureFinished) { - QSwipeGesture::SwipeDirection direction = swipeAngleToDirection( - swipe->swipeAngle(), logsSwipeAngleDelta); - if (mViewManager.mainWindow().orientation() == Qt::Vertical) { - if (direction == QSwipeGesture::Left) { - leftFlick(); - event->accept(Qt::SwipeGesture); - } else if (direction == QSwipeGesture::Right) { - rightFlick(); - event->accept(Qt::SwipeGesture); - } - } else { - if (direction == QSwipeGesture::Down) { - rightFlick(); - event->accept(Qt::SwipeGesture); - } else if (direction == QSwipeGesture::Up) { - leftFlick(); - event->accept(Qt::SwipeGesture); - } + LOGS_QDEBUG( "logs [UI] -> LogsRecentCallsView::gestureEvent()" ); + HbSwipeGesture* swipe = static_cast(gesture); + if (swipe && swipe->state() == Qt::GestureFinished) { + LOGS_QDEBUG_2( "logs [UI] sceneSwipeAngle: ", swipe->sceneSwipeAngle() ); + LOGS_QDEBUG_2( "logs [UI] swipeAngle: ", swipe->swipeAngle() ); + + QSwipeGesture::SwipeDirection direction = swipe->sceneHorizontalDirection(); + if (direction == QSwipeGesture::Left) { + leftFlick(); + event->accept(Qt::SwipeGesture); + } else if (direction == QSwipeGesture::Right) { + rightFlick(); + event->accept(Qt::SwipeGesture); } } } } // ----------------------------------------------------------------------------- -// LogsRecentCallsView::swipeAngleToDirection -// ----------------------------------------------------------------------------- -// -QSwipeGesture::SwipeDirection LogsRecentCallsView::swipeAngleToDirection( - int angle, int delta) -{ - QSwipeGesture::SwipeDirection direction(QSwipeGesture::NoDirection); - if ((angle > 90-delta) && (angle < 90+delta)) { - direction = QSwipeGesture::Up; - } else if ((angle > 270-delta) && (angle < 270+delta)) { - direction = QSwipeGesture::Down; - } else if (((angle >= 0) && (angle < delta)) - || ((angle > 360-delta) && (angle <= 360))) { - direction = QSwipeGesture::Right; - } else if ((angle > 180-delta) && (angle < 180+delta)) { - direction = QSwipeGesture::Left; - } - LOGS_QDEBUG_4( "logs [UI] LogsRecentCallsView::swipeAngleToDirection() angle: ", - angle, " direction: ", direction ); - return direction; -} - -// ----------------------------------------------------------------------------- // LogsRecentCallsView::leftFlick // ----------------------------------------------------------------------------- // diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/src/logsviewmanager.cpp --- a/logsui/logsapp/src/logsviewmanager.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/src/logsviewmanager.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -70,9 +70,6 @@ connect( &mServiceOld, SIGNAL( activateView(QString) ), this, SLOT( changeMatchesView(QString) )); - connect( &mMainWindow, SIGNAL(appFocusGained()), this, SLOT(appFocusGained()) ); - connect( &mMainWindow, SIGNAL(appFocusLost()), this, SLOT(appFocusLost()) ); - QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(saveActivity())); handleFirstActivation(); @@ -144,35 +141,6 @@ } // ----------------------------------------------------------------------------- -// LogsViewManager::appFocusGained -// Activate recent view if gaining focus first time and app was not started -// via highway service. If app was started by using service request, -// wait the request to appear before activating view. -// ----------------------------------------------------------------------------- -// -void LogsViewManager::appFocusGained() -{ - LOGS_QDEBUG( "logs [UI] -> LogsViewManager::appFocusGained()" ); - - foreach ( LogsBaseView* view, mViewStack ){ - disconnect( view, SIGNAL(exitAllowed()), this, SLOT(proceedExit()) ); - } - - LOGS_QDEBUG( "logs [UI] <- LogsViewManager::appFocusGained()" ); -} - -// ----------------------------------------------------------------------------- -// LogsViewManager::appFocusLost -// ----------------------------------------------------------------------------- -// -void LogsViewManager::appFocusLost() -{ - LOGS_QDEBUG( "logs [UI] -> LogsViewManager::appFocusLost()" ); - - LOGS_QDEBUG( "logs [UI] <- LogsViewManager::appFocusLost()" ); -} - -// ----------------------------------------------------------------------------- // LogsViewManager::proceedExit // ----------------------------------------------------------------------------- // diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsrecentcallsview.h --- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsrecentcallsview.h Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsrecentcallsview.h Wed Jun 23 18:13:05 2010 +0300 @@ -64,7 +64,6 @@ void testOpenDialpad(); void testDialpadEditorTextChanged(); void testGestureEvent(); - void testSwipeAngleToDirection(); void testViewChangeByFlicking(); void testModel(); void testShowListItemMenu(); diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsviewmanager.h --- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsviewmanager.h Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsviewmanager.h Wed Jun 23 18:13:05 2010 +0300 @@ -54,7 +54,6 @@ void testActivateView(); void testchangeMatchesView(); void testExitApplication(); - void testAppFocusGained(); void testStartingWithService(); void testHandleOrientationChanged(); void testCompleteViewActivation(); diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsforegroundwatcher.cpp --- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsforegroundwatcher.cpp Fri Jun 11 13:38:41 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,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 "logsforegroundwatcher.h" - -// ----------------------------------------------------------------------------- -// Currently no other way to monitor app foreground/background switches. -// HbForegroundWatcher might become public at some point which could be then -// used instead. -// ----------------------------------------------------------------------------- -// -LogsForegroundWatcher::LogsForegroundWatcher(QObject* parent) : QObject(parent) -{ -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void LogsForegroundWatcher::HandleGainingForeground() -{ - emit gainingForeground(); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void LogsForegroundWatcher::HandleLosingForeground() -{ - emit losingForeground(); -} - diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsforegroundwatcher.h --- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsforegroundwatcher.h Fri Jun 11 13:38:41 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,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: -* -*/ -#ifndef LOGSFOREGROUNDWATCHER_H -#define LOGSFOREGROUNDWATCHER_H - - -#include - -class LogsForegroundWatcher : public QObject -{ - Q_OBJECT - -public: - - LogsForegroundWatcher(QObject* parent = 0); - virtual ~LogsForegroundWatcher(){} - -signals: - void gainingForeground(); - void losingForeground(); - -public: // from MCoeForegroundObserver - void HandleGainingForeground(); - void HandleLosingForeground(); - -}; - -#endif //LOGSFOREGROUNDWATCHER_H diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/tsrc/ut_logsapp/src/ut_logsmatchesview.cpp --- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsmatchesview.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsmatchesview.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -77,7 +77,7 @@ { //activate for the first time mMatchesView->mViewManager.mainWindow().setOrientation( Qt::Vertical ); - mRepository->matchesView(); + LogsMatchesView* view = mRepository->matchesView(); QVERIFY( !mMatchesView->mInitialized ); QVERIFY( !mMatchesView->mListView ); QVERIFY( !mMatchesView->mModel ); @@ -125,6 +125,7 @@ QVERIFY( mMatchesView->mListView ); QVERIFY( mMatchesView->mModel ); QVERIFY( mMatchesView->mModel->mLastCall == QLatin1String("constructor") ); + delete view; } @@ -240,17 +241,18 @@ //text erased from input, view changed to recent calls mMatchesView->mDialpad->editor().setText( QString("") ); + mMatchesView->dialpadEditorTextChanged(); QVERIFY( mViewManager->mViewId == LogsRecentViewId ); } void UT_LogsMatchesView::testDialpadClosed() { + LogsMatchesView* view = mRepository->matchesView(); mMatchesView->mViewManager.mainWindow().setOrientation( Qt::Horizontal ); - mMatchesView->mListView = new HbListView(); + mMatchesView->initView(); mMatchesView->mLayoutSectionName = QString("landscape_dialpad"); QString hello("hello"); mMatchesView->mDialpad->editor().setText( hello ); - mMatchesView->mAddToContactsButton = new HbPushButton(); mMatchesView->mAddToContactsButton->setVisible(true); mMatchesView->dialpadClosed(); @@ -258,21 +260,18 @@ QVERIFY( mMatchesView->mDialpad->editor().text() == hello ); QVERIFY( mMatchesView->mLayoutSectionName == logsViewDefaultSection ); QVERIFY( !mMatchesView->mAddToContactsButton->isVisible() ); - delete mMatchesView->mListView; - mMatchesView->mListView = 0; - delete mMatchesView->mAddToContactsButton; - mMatchesView->mAddToContactsButton = 0; + delete view; } void UT_LogsMatchesView::testDialpadOpened() { //widgets size and layout updated + LogsMatchesView* view = mRepository->matchesView(); mMatchesView->mViewManager.mainWindow().setOrientation( Qt::Vertical ); - mMatchesView->mListView = new HbListView(); + mMatchesView->initView(); mMatchesView->mLayoutSectionName = QString("dummy"); mMatchesView->mListView->setLayoutName("dummy"); mMatchesView->mDialpad->mIsOpen = true; - mMatchesView->mAddToContactsButton = new HbPushButton(); mMatchesView->mAddToContactsButton->setVisible(false); mMatchesView->mDialpad->editor().setText( "hello" ); mMatchesView->mDialpad->mIsOpen = true; @@ -282,10 +281,7 @@ QVERIFY( mMatchesView->mListView->layoutName() == logsListDefaultLayout ); QVERIFY( mMatchesView->mLayoutSectionName == logsViewPortraitDialpadSection ); QVERIFY( mMatchesView->mAddToContactsButton->isVisible() ); - delete mMatchesView->mListView; - mMatchesView->mListView = 0; - delete mMatchesView->mAddToContactsButton; - mMatchesView->mAddToContactsButton = 0; + delete view; } void UT_LogsMatchesView::testModel() @@ -304,7 +300,7 @@ mMatchesView->updateWidgetsSizeAndLayout(); //listView exists, layout and size updated, dialpad not visible - mRepository->matchesView(); + LogsMatchesView* view = mRepository->matchesView(); mMatchesView->mViewManager.mainWindow().setOrientation( Qt::Vertical ); mMatchesView->mDialpad->closeDialpad(); mMatchesView->mListView = new HbListView(); @@ -331,14 +327,16 @@ QVERIFY( messageAction->isVisible() ); delete mMatchesView->mListView; - mMatchesView->mListView = 0; -} + mMatchesView->mListView = 0; + delete view; + } void UT_LogsMatchesView::testHandleOrientationChanged() { //dialpad position recalculated and layout/size updated QPointF pos; - mMatchesView->mListView = new HbListView(); + LogsMatchesView* view = mRepository->matchesView(); + mMatchesView->initView(); mMatchesView->mListView->setLayoutName("dummy"); mMatchesView->mLayoutSectionName = "dummy"; mMatchesView->mDialpad->setPos(pos); @@ -349,8 +347,7 @@ QVERIFY( pos != mMatchesView->mDialpad->pos() ); QVERIFY( mMatchesView->mListView->layoutName() == logsListLandscapeLayout ); QVERIFY( mMatchesView->mLayoutSectionName == logsViewDefaultSection ); - delete mMatchesView->mListView; - mMatchesView->mListView = 0; + delete view; } void UT_LogsMatchesView::testUpdateEmptyListWidgetsVisibility() @@ -433,7 +430,8 @@ status = view->mModel->predictiveSearchStatus(); QVERIFY( status == 2 ); QVERIFY( mViewManager->mViewId == LogsRecentViewId ); - QVERIFY( mMatchesView->mDialpad->editor().text() == "1234" ); + QVERIFY( mMatchesView->mDialpad->editor().text() == "1234" ); + delete view; } diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/tsrc/ut_logsapp/src/ut_logsrecentcallsview.cpp --- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsrecentcallsview.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsrecentcallsview.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -32,7 +32,7 @@ //SYSTEM #include -#include +#include #include #include #include @@ -393,9 +393,8 @@ view->activated( false, QVariant(LogsServices::ViewCalled) ); view->mCurrentView = LogsServices::ViewCalled; view->mAppearingView = LogsServices::ViewCalled; - mRecentCallsView->mViewManager.mainWindow().setOrientation( Qt::Vertical ); - QSwipeGesture* swipe = new QSwipeGesture(); + HbSwipeGesture* swipe = new HbSwipeGesture(); QList list; QGestureEvent event(list); event.ignore(Qt::SwipeGesture); @@ -404,7 +403,8 @@ QVERIFY(!event.isAccepted(Qt::SwipeGesture)); view->gestureEvent(&event); QVERIFY(!event.isAccepted(Qt::SwipeGesture)); - QVERIFY(view->mAppearingView == LogsServices::ViewCalled); + QCOMPARE(view->mCurrentView, LogsServices::ViewCalled); + QCOMPARE(view->mAppearingView, LogsServices::ViewCalled); //swipe gesture in event, but gesture isn't finished list.append(swipe); @@ -414,86 +414,36 @@ QVERIFY(swipe->state() != Qt::GestureFinished); view->gestureEvent(&event2); QVERIFY(!event2.isAccepted(Qt::SwipeGesture)); - QVERIFY(view->mAppearingView == LogsServices::ViewCalled); + QCOMPARE(view->mCurrentView, LogsServices::ViewCalled); + QCOMPARE(view->mAppearingView, LogsServices::ViewCalled); - //vertical orientation swipe right up + //swipe right HbStubHelper::setGestureState(Qt::GestureFinished); event2.setAccepted(Qt::SwipeGesture, false); - swipe->setSwipeAngle(10); + swipe->setSceneSwipeAngle(10); view->gestureEvent(&event2); - QVERIFY( view->mAppearingView == LogsServices::ViewAll ); + QCOMPARE(view->mCurrentView, LogsServices::ViewCalled); + QCOMPARE(view->mAppearingView, LogsServices::ViewAll ); QVERIFY( event2.isAccepted(Qt::SwipeGesture) ); - //vertical orientation swipe left up - event2.setAccepted(Qt::SwipeGesture, false); - swipe->setSwipeAngle(170); - view->gestureEvent(&event2); - QVERIFY(view->mAppearingView == LogsServices::ViewReceived); - QVERIFY(event2.isAccepted(Qt::SwipeGesture)); - - //vertical orientation swipe down, nothing happens + //swipe left event2.setAccepted(Qt::SwipeGesture, false); - swipe->setSwipeAngle(70); - view->mAppearingView = view->mCurrentView; + swipe->setSceneSwipeAngle(170); view->gestureEvent(&event2); - QVERIFY(view->mAppearingView == LogsServices::ViewCalled); - QVERIFY(!event2.isAccepted(Qt::SwipeGesture)); - - //horizontal orientation swipe right up - mRecentCallsView->mViewManager.mainWindow().setOrientation( Qt::Horizontal ); - event2.setAccepted(Qt::SwipeGesture, false); - swipe->setSwipeAngle(80); - view->gestureEvent(&event2); - QVERIFY(view->mAppearingView == LogsServices::ViewReceived); + QCOMPARE(view->mCurrentView, LogsServices::ViewCalled); + QCOMPARE(view->mAppearingView, LogsServices::ViewReceived); QVERIFY(event2.isAccepted(Qt::SwipeGesture)); - //horizontal orientation swipe right down + //swipe down, nothing happens event2.setAccepted(Qt::SwipeGesture, false); - swipe->setSwipeAngle(280); - view->gestureEvent(&event2); - QVERIFY(view->mAppearingView == LogsServices::ViewAll); - QVERIFY(event2.isAccepted(Qt::SwipeGesture)); - - //horizontal orientation swipe left, nothing happens - event2.setAccepted(Qt::SwipeGesture, false); - swipe->setSwipeAngle(200); + swipe->setSceneSwipeAngle(70); view->mAppearingView = view->mCurrentView; view->gestureEvent(&event2); - QVERIFY(view->mAppearingView == LogsServices::ViewCalled); + QCOMPARE(view->mCurrentView, LogsServices::ViewCalled); + QCOMPARE(view->mAppearingView, LogsServices::ViewCalled); QVERIFY(!event2.isAccepted(Qt::SwipeGesture)); } -void UT_LogsRecentCallsView::testSwipeAngleToDirection() -{ - int delta = 30; - QCOMPARE(mRecentCallsView->swipeAngleToDirection(61, delta), QSwipeGesture::Up); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(119, delta), QSwipeGesture::Up); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(90, delta), QSwipeGesture::Up); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(60, delta), QSwipeGesture::NoDirection); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(120, delta), QSwipeGesture::NoDirection); - - QCOMPARE(mRecentCallsView->swipeAngleToDirection(241, delta), QSwipeGesture::Down); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(299, delta), QSwipeGesture::Down); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(270, delta), QSwipeGesture::Down); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(300, delta), QSwipeGesture::NoDirection); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(240, delta), QSwipeGesture::NoDirection); - - QCOMPARE(mRecentCallsView->swipeAngleToDirection(29, delta), QSwipeGesture::Right); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(331, delta), QSwipeGesture::Right); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(0, delta), QSwipeGesture::Right); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(360, delta), QSwipeGesture::Right); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(30, delta), QSwipeGesture::NoDirection); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(330, delta), QSwipeGesture::NoDirection); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(361, delta), QSwipeGesture::NoDirection); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(-1, delta), QSwipeGesture::NoDirection); - - QCOMPARE(mRecentCallsView->swipeAngleToDirection(151, delta), QSwipeGesture::Left); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(209, delta), QSwipeGesture::Left); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(180, delta), QSwipeGesture::Left); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(150, delta), QSwipeGesture::NoDirection); - QCOMPARE(mRecentCallsView->swipeAngleToDirection(210, delta), QSwipeGesture::NoDirection); -} - void UT_LogsRecentCallsView::testViewChangeByFlicking() { // At leftmost list, moving to left not possible diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/tsrc/ut_logsapp/src/ut_logsviewmanager.cpp --- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsviewmanager.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsviewmanager.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -160,12 +160,6 @@ QVERIFY( HbStubHelper::quitCalled() ); } -void UT_LogsViewManager::testAppFocusGained() -{ - mLogsViewManager->appFocusGained(); - // Nothing to verify -} - void UT_LogsViewManager::testStartingWithService() { // If app is started with highway service, view is not activated diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/tsrc/ut_logsapp/stubs/qthighway_stub.cpp --- a/logsui/logsapp/tsrc/ut_logsapp/stubs/qthighway_stub.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/qthighway_stub.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -134,11 +134,21 @@ { return true; } + void XQServiceRequest::addArg(const QVariant& v) { } +void XQServiceRequest::setInfo(const XQRequestInfo &info) +{ + Q_UNUSED(info); +} + +void XQRequestInfo::setForeground(bool on) +{ + Q_UNUSED(on) +} // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- diff -r 41c0a814d878 -r b04270301d3b logsui/logsapp/tsrc/ut_logsapp/ut_logsapp.pro --- a/logsui/logsapp/tsrc/ut_logsapp/ut_logsapp.pro Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/tsrc/ut_logsapp/ut_logsapp.pro Wed Jun 23 18:13:05 2010 +0300 @@ -63,7 +63,6 @@ #HEADERS += ../../../logsengine/inc/logscommondata.h HEADERS += ../../../logsengine/inc/logsconfigurationparams.h HEADERS += logsengine_stub/logscontact.h -HEADERS += logsengine_stub/logsforegroundwatcher.h HEADERS += ./stubs/dialpad.h HEADERS += ./stubs/dialpadkeyhandler.h @@ -83,7 +82,6 @@ SOURCES += logsengine_stub/logseventdata.cpp SOURCES += logsengine_stub/logscontact.cpp SOURCES += logsengine_stub/logsmatchesmodel.cpp -SOURCES += logsengine_stub/logsforegroundwatcher.cpp SOURCES += ../../../logsengine/src/logsconfigurationparams.cpp SOURCES += src/ut_logsbaseview.cpp SOURCES += src/ut_logsrecentcallsview.cpp diff -r 41c0a814d878 -r b04270301d3b logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinder.cpp --- a/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinder.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinder.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -36,10 +36,14 @@ void ST_LogsCntFinder::initTestCase() { + //open symbian database + m_manager = new QContactManager("symbian"); } void ST_LogsCntFinder::cleanupTestCase() { + delete m_manager; + m_manager = 0; } @@ -50,8 +54,6 @@ HbInputSettingProxy::instance()->setGlobalInputLanguage( eng ); m_finder = 0; - //open symbian database - m_manager = new QContactManager("symbian"); m_finder = new LogsCntFinder(*m_manager); QVERIFY(m_finder); @@ -59,7 +61,7 @@ QList cnt_ids = m_manager->contactIds(); qDebug() << "contacts now before deleting" << cnt_ids.count(); - QVERIFY( m_manager->removeContacts(cnt_ids, 0 ) ); + m_manager->removeContacts(cnt_ids, 0 ); cnt_ids = m_manager->contactIds(); QCOMPARE(cnt_ids.count(), 0); @@ -71,8 +73,6 @@ void ST_LogsCntFinder::cleanup() { - delete m_manager; - m_manager = 0; delete m_finder; m_finder = 0; HbInputLanguage eng( QLocale::English ); @@ -110,8 +110,7 @@ createOneContact( QString("Tisha"), QString("Iatzkovits"), QString("932472398") ); createOneContact( QString("Wilda"), QString("Lazar"), QString("932472398") ); createOneContact( QString("Una Vivi"), QString("Kantsak"), QString("932472398") ); - - + int contactsCount = m_manager->contactIds().count(); QCOMPARE(contactsCount, 13); @@ -141,7 +140,8 @@ void ST_LogsCntFinder::createHistoryEvents() -{ +{ + //inserted inreverse order createLogEvent( QString("Stefann Albert"), QString("Fedrernn"), QString("932472398") ); createLogEvent( QString("Jonn"), QString("Lennon"), QString("932472398") ); createLogEvent( QString("Dim-Petter"), QString("Jones"), QString("932472398") ); @@ -512,7 +512,6 @@ QCOMPARE( m_finder->resultsCount(), 1 ); CHECK_RESULTS( 1, "Jonn", "Lennon" ); - QCOMPARE( m_finder->resultsCount(), 0 ); m_finder->predictiveSearchQuery( QString("5") ); QCOMPARE( m_finder->resultsCount(), 2 ); CHECK_RESULTS( 2, "Dim-Petter", "Jones" ); @@ -536,7 +535,7 @@ m_finder->predictiveSearchQuery( QString("503") ); QCOMPARE( m_finder->resultsCount(), 1 ); - CHECK_RESULTS( 2, "Dim-Petter", "Jones" ); + CHECK_RESULTS( 1, "Dim-Petter", "Jones" ); m_finder->predictiveSearchQuery( QString("50") ); QCOMPARE( m_finder->resultsCount(), 2 ); @@ -636,11 +635,11 @@ m_finder->predictiveSearchQuery( QString("9") ); QCOMPARE( m_finder->resultsCount(), 6 ); //3 history + 3 contacts - CHECK_RESULTS( 5, "Stefann", "Fedrernn" ); + CHECK_RESULTS( 5, "Dim-Petter", "Jones" ); m_finder->predictiveSearchQuery( QString("93") ); QCOMPARE( m_finder->resultsCount(), 3 ); - CHECK_RESULTS( 1, "Stefann", "Fedrernn" ); + CHECK_RESULTS( 1, "Dim-Petter", "Jones" ); } diff -r 41c0a814d878 -r b04270301d3b logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinderqwerty.cpp --- a/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinderqwerty.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinderqwerty.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -77,7 +77,7 @@ // Remove all contacts from the database QList cnt_ids = m_manager->contactIds(); - QVERIFY( m_manager->removeContacts(cnt_ids, 0 ) ); + m_manager->removeContacts(cnt_ids, 0 ); cnt_ids = m_manager->contactIds(); QCOMPARE(cnt_ids.count(), 0); @@ -97,7 +97,7 @@ // Remove all contacts from the database QList cnt_ids = m_manager->contactIds(); - QVERIFY( m_manager->removeContacts(cnt_ids, 0 ) ); + m_manager->removeContacts(cnt_ids, 0 ); cnt_ids = m_manager->contactIds(); QVERIFY(0 == cnt_ids.count()); @@ -128,7 +128,6 @@ { createContacts(); - QEXPECT_FAIL("", "Not implemented", Abort ); QContactDetailFilter df; df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); @@ -161,7 +160,6 @@ { createContacts(); - QEXPECT_FAIL("", "Not implemented", Abort ); QContactDetailFilter df; df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); @@ -186,7 +184,6 @@ { createContacts(); - QEXPECT_FAIL("", "Not implemented", Abort ); QContactDetailFilter df; df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); @@ -210,7 +207,6 @@ { createContacts(); - QEXPECT_FAIL("", "Not implemented", Abort ); QContactDetailFilter df; df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); @@ -230,7 +226,6 @@ { createContacts(); - QEXPECT_FAIL("", "Not implemented", Abort ); QContactDetailFilter df; df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); @@ -254,7 +249,6 @@ { createContacts(); - QEXPECT_FAIL("", "Not implemented", Abort ); QContactDetailFilter df; df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); diff -r 41c0a814d878 -r b04270301d3b logsui/logscntfinder/tsrc/ut_logscntfinder/ut_logscntfinder.pro --- a/logsui/logscntfinder/tsrc/ut_logscntfinder/ut_logscntfinder.pro Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/ut_logscntfinder.pro Wed Jun 23 18:13:05 2010 +0300 @@ -66,7 +66,7 @@ symbian: { TARGET.UID2 = 0x100039CE - TARGET.UID3 = 0xEfa329b2 + TARGET.UID3 = 0xEfa329b3 TARGET.CAPABILITY = ALL -TCB TARGET.EPOCALLOWDLLDATA = 1 LIBS += -lflogger -lqtcontacts diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/inc/logsmatchesmodel.h --- a/logsui/logsengine/inc/logsmatchesmodel.h Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsengine/inc/logsmatchesmodel.h Wed Jun 23 18:13:05 2010 +0300 @@ -26,6 +26,7 @@ class LogsDbConnector; class LogsCntFinder; class LogsCntEntry; +class LogsCntText; class LogsContact; class LogsMatchesModelItemContainer; class LogsThumbIconManager; @@ -137,6 +138,8 @@ QString getFormattedCallerId(const LogsCntEntry& entry) const; void getFormattedContactInfo( const LogsCntEntry& entry, QString& contactName, QString& contactNumber ) const; + void getFormattedName(QString& formattedName, + const QList& list) const; private: diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/logssymbianos/inc/logsforegroundwatcher.h --- a/logsui/logsengine/logssymbianos/inc/logsforegroundwatcher.h Fri Jun 11 13:38:41 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,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: -* -*/ -#ifndef LOGSFOREGROUNDWATCHER_H -#define LOGSFOREGROUNDWATCHER_H - - -#include -#include - -class LogsForegroundWatcher : public QObject, public MCoeForegroundObserver -{ - Q_OBJECT - -public: - - LogsForegroundWatcher(QObject* parent = 0); - virtual ~LogsForegroundWatcher(){} - -signals: - void gainingForeground(); - void losingForeground(); - -public: // from MCoeForegroundObserver - void HandleGainingForeground(); - void HandleLosingForeground(); - -}; - -#endif //LOGSFOREGROUNDWATCHER_H diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/logssymbianos/src/logsforegroundwatcher.cpp --- a/logsui/logsengine/logssymbianos/src/logsforegroundwatcher.cpp Fri Jun 11 13:38:41 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,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 "logsforegroundwatcher.h" -#include "logslogger.h" - -// ----------------------------------------------------------------------------- -// Currently no other way to monitor app foreground/background switches. -// HbForegroundWatcher might become public at some point which could be then -// used instead. -// ----------------------------------------------------------------------------- -// -LogsForegroundWatcher::LogsForegroundWatcher(QObject* parent) : QObject(parent) -{ - CCoeEnv* env = CCoeEnv::Static(); - if (env) { - TRAP_IGNORE(env->AddForegroundObserverL(*this)); - } -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void LogsForegroundWatcher::HandleGainingForeground() -{ - LOGS_QDEBUG( "logs [UI] -> LogsForegroundWatcher::HandleGainingForeground" ); - emit gainingForeground(); - LOGS_QDEBUG( "logs [UI] <- LogsForegroundWatcher::HandleGainingForeground" ); -} - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void LogsForegroundWatcher::HandleLosingForeground() -{ - LOGS_QDEBUG( "logs [UI] -> LogsForegroundWatcher::HandleLosingForeground" ); - emit losingForeground(); - LOGS_QDEBUG( "logs [UI] <- LogsForegroundWatcher::HandleLosingForeground" ); -} - diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/logssymbianos/tsrc/stubs/centralrepository_stub.cpp --- a/logsui/logsengine/logssymbianos/tsrc/stubs/centralrepository_stub.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsengine/logssymbianos/tsrc/stubs/centralrepository_stub.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -27,6 +27,7 @@ mFailCode = KErrNone; mCurrentVal = 0; } + void CentralRepositoryStubHelper::setFailCode(TInt err) { mFailCode = err; @@ -76,7 +77,7 @@ // // ----------------------------------------------------------------------------- // -TInt CRepository::Get(TUint32 aKey, TInt& aValue) +TInt CRepository::Get(TUint32 /*aKey*/, TInt& aValue) { aValue = mCurrentVal; return mFailCode; @@ -87,7 +88,7 @@ // // ----------------------------------------------------------------------------- // -TInt CRepository::Set(TUint32 aKey, TInt aValue) +TInt CRepository::Set(TUint32 /*aKey*/, TInt aValue) { if ( mFailCode == KErrNone ) { diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp --- a/logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -187,12 +187,6 @@ QContactPhoneNumber number; return number; } - else if ( definitionId == QContactAvatar::DefinitionName){ - QContactAvatar avatar; - avatar.setSubType(QContactAvatar::SubTypeImage); - avatar.setAvatar("c:\\data\\images\\logstest1.jpg"); - return avatar; - } QContactDetail detail; return detail; } @@ -263,8 +257,7 @@ } else if ( key == QContactPhoneNumber::FieldNumber ) { return QString( "12345" ); } - else if ( key == QContactAvatar::FieldAvatar){ - return QString( "Avatar" ); - } return QString(""); } + + diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/inc/ut_logsforegroundwatcher.h --- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/inc/ut_logsforegroundwatcher.h Fri Jun 11 13:38:41 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,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: -* -*/ -#ifndef UT_LOGSFOREGROUNDWATCHER_H -#define UT_LOGSFOREGROUNDWATCHER_H - -#include - -class LogsForegroundWatcher; - -class UT_LogsForegroundWatcher : 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 testHandleLosingForeground(); - void testHandleGainingForeground(); - - -private: - - LogsForegroundWatcher* mWatcher; - -}; - - -#endif //UT_LOGSFOREGROUNDWATCHER_H diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/main.cpp --- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/main.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/main.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -23,7 +23,6 @@ #include "ut_logsreaderstates.h" #include "ut_logseventparser.h" #include "ut_logseventdataparser.h" -#include "ut_logsforegroundwatcher.h" #include "testresultxmlparser.h" #include "ut_logsremove.h" @@ -82,14 +81,6 @@ QT_TRAP_THROWING( QTest::qExec(&ut_logsEventData, args_logsEventData); ) parser.parseAndPrintResults(resultFileName,true); - UT_LogsForegroundWatcher ut_logsForegroundWatcher; - resultFileName = "c:/ut_logs_logsForegroundWatcher.xml"; - QStringList args_logsForegroundWatcher( "ut_logsForegroundWatcher"); - args_logsForegroundWatcher << "-xml" << "-o" << resultFileName; - QT_TRAP_THROWING( QTest::qExec(&ut_logsForegroundWatcher, args_logsForegroundWatcher); ) - parser.parseAndPrintResults(resultFileName,true); - - if (promptOnExit) { printf("Press any key...\n"); diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/ut_logsforegroundwatcher.cpp --- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/ut_logsforegroundwatcher.cpp Fri Jun 11 13:38:41 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,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_logsforegroundwatcher.h" -#include "logsforegroundwatcher.h" - -#include -#include - -CCoeEnv* testEnv = 0; - -CCoeEnv* CCoeEnv::Static() -{ - testEnv = new CCoeEnv(); - return testEnv; -} - -CCoeEnv::CCoeEnv() : CActive(EPriorityNormal) -{ - -} - -CCoeEnv::~CCoeEnv() -{ -} - -void CCoeEnv::AddForegroundObserverL(MCoeForegroundObserver& /*aForegroundObserver*/) -{ - -} - -void UT_LogsForegroundWatcher::initTestCase() -{ -} - -void UT_LogsForegroundWatcher::cleanupTestCase() -{ - delete testEnv; - testEnv = 0; -} - -void UT_LogsForegroundWatcher::init() -{ - mWatcher = new LogsForegroundWatcher(); -} - -void UT_LogsForegroundWatcher::cleanup() -{ - delete mWatcher; -} - -void UT_LogsForegroundWatcher::testConstructor() -{ - QVERIFY( mWatcher ); -} - -void UT_LogsForegroundWatcher::testHandleLosingForeground() -{ - QSignalSpy spyGaining( mWatcher, SIGNAL(gainingForeground()) ); - QSignalSpy spyLosing( mWatcher, SIGNAL(losingForeground()) ); - mWatcher->HandleLosingForeground(); - QVERIFY( spyGaining.count() == 0 ); - QVERIFY( spyLosing.count() == 1 ); -} - -void UT_LogsForegroundWatcher::testHandleGainingForeground() -{ - QSignalSpy spyGaining( mWatcher, SIGNAL(gainingForeground()) ); - QSignalSpy spyLosing( mWatcher, SIGNAL(losingForeground()) ); - mWatcher->HandleGainingForeground(); - QVERIFY( spyGaining.count() == 1 ); - QVERIFY( spyLosing.count() == 0 ); -} - diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/ut_logssymbianos.pro --- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/ut_logssymbianos.pro Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/ut_logssymbianos.pro Wed Jun 23 18:13:05 2010 +0300 @@ -45,13 +45,11 @@ HEADERS += inc/ut_logseventparser.h HEADERS += inc/ut_logseventdataparser.h HEADERS += inc/ut_logsremove.h -HEADERS += inc/ut_logsforegroundwatcher.h HEADERS += ../../inc/logsdbconnector.h HEADERS += ../../inc/logsreader.h HEADERS += ../../inc/logsreaderstates.h HEADERS += ../../inc/logsreaderobserver.h HEADERS += ../../inc/logsremove.h -HEADERS += ../../inc/logsforegroundwatcher.h HEADERS += ../../../../../recents_plat/logs_engine_api/inc/logsevent.h HEADERS += ../../../inc/logseventdata.h HEADERS += ../../../inc/logscommondata.h @@ -66,14 +64,12 @@ SOURCES += src/ut_logseventparser.cpp SOURCES += src/ut_logseventdataparser.cpp SOURCES += src/ut_logsremove.cpp -SOURCES += src/ut_logsforegroundwatcher.cpp SOURCES += ../../src/logsdbconnector.cpp SOURCES += ../../src/logsreader.cpp SOURCES += ../../src/logsreaderstates.cpp SOURCES += ../../src/logseventparser.cpp SOURCES += ../../src/logseventdataparser.cpp SOURCES += ../../src/logsremove.cpp -SOURCES += ../../src/logsforegroundwatcher.cpp SOURCES += ../../../src/logsevent.cpp SOURCES += ../../../src/logseventdata.cpp SOURCES += ../../../src/logscommondata.cpp diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/src/logscall.cpp --- a/logsui/logsengine/src/logscall.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsengine/src/logscall.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -128,9 +128,9 @@ LOGS_QDEBUG_2( "logs [ENG] -> LogsCall::callToNumber(), type", callType ) if (callType == TypeLogsVoiceCall) { - createcall("com.nokia.services.telephony", "dial(QString)", number, false); + createcall("com.nokia.symbian.ICallDial", "dial(QString)", number, false); } else if (callType == TypeLogsVideoCall) { - createcall("com.nokia.services.telephony", "dialVideo(QString)", number, false); + createcall("com.nokia.symbian.ICallDial", "dialVideo(QString)", number, false); } else if (callType == TypeLogsVoIPCall){ if ( serviceId ){ @@ -140,7 +140,7 @@ // also contact must be passed if available if change service is // provided (no point change service and try to call service specific // uri with another service)? - createCallWithService("com.nokia.services.telephony", + createCallWithService("com.nokia.symbian.ICallDial", "dialVoipService(QString,int)", number, false, serviceId); } else { @@ -148,7 +148,7 @@ // offer any kind of service selection. Normally voip call // should always have service id set but if it's missing // for some reason, then this provides call failure UI. - createcall("com.nokia.services.telephony", + createcall("com.nokia.symbian.ICallDial", "dialVoip(QString)", number, false); } } @@ -189,6 +189,7 @@ void LogsCall::createcall(QString service, QString type, QString num, bool sync) { LOGS_QDEBUG_2( "logs [ENG] -> LogsCall::createcall(), num", num ) + LOGS_QDEBUG_2( "logs [ENG] -> LogsCall::createcall(), service", service ) XQServiceRequest snd(service, type, sync); snd << num; // Start call at bg, call UI will bring itself to foreground when ever diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/src/logsevent.cpp --- a/logsui/logsengine/src/logsevent.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsengine/src/logsevent.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -642,18 +642,11 @@ { QString firstName = name.value(QContactName::FieldFirstName); QString lastName = name.value(QContactName::FieldLastName); - QString parsedName; - if (!lastName.isEmpty()) { - if (!firstName.isEmpty()) { - parsedName = - QString(QLatin1String("%1 %2")).arg(firstName).arg(lastName); - } - else { - parsedName = lastName; - } - } else if (!firstName.isEmpty()) { - parsedName = firstName; + QString parsedName = firstName; + if (!parsedName.isEmpty() && !lastName.isEmpty()) { + parsedName.append(" "); } + parsedName.append(lastName); return parsedName; } diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/src/logsmatchesmodel.cpp --- a/logsui/logsengine/src/logsmatchesmodel.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsengine/src/logsmatchesmodel.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -675,12 +675,7 @@ const LogsCntEntry& entry) const { QString callerId; - foreach( LogsCntText name, entry.firstName() ) { - callerId.append( name.richText() ); - if ( name.text().length() > 0 ) { - callerId.append(" "); - } - } + getFormattedName(callerId, entry.firstName()); if ( callerId.length() == 0 ) { callerId = entry.phoneNumber().richText(); @@ -699,20 +694,25 @@ QString& contactNumber ) const { contactName.clear(); - foreach( LogsCntText name, entry.firstName() ) { - contactName.append( name.richText() ); + + getFormattedName(contactName, entry.firstName()); + getFormattedName(contactName, entry.lastName()); + + contactName = contactName.trimmed(); + contactNumber = entry.phoneNumber().text(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LogsMatchesModelItemContainer::getFormattedName(QString& formattedName, + const QList& list) const +{ + foreach( LogsCntText name, list ) { if ( name.text().length() > 0 ) { - contactName.append(" "); + formattedName.append(name.richText()); + formattedName.append(" "); } } - - foreach( LogsCntText lastname, entry.lastName() ) { - contactName.append( lastname.richText() ); - if ( lastname.text().length() > 0 ) { - contactName.append(" "); - } - } - contactName = contactName.trimmed(); - - contactNumber = entry.phoneNumber().text(); } diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/tsrc/ut_logsengine/src/ut_logscall.cpp --- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logscall.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logscall.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -119,21 +119,21 @@ { QtHighwayStubHelper::reset(); mLogsCall->call(LogsCall::TypeLogsVoiceCall); - QVERIFY( QtHighwayStubHelper::service() == "com.nokia.services.telephony" ); + QVERIFY( QtHighwayStubHelper::service() == "com.nokia.symbian.ICallDial" ); QVERIFY( QtHighwayStubHelper::message() == "dial(QString)" ); QVERIFY( QtHighwayStubHelper::isRequestBg() ); // Video call message is longer than voice call QtHighwayStubHelper::reset(); mLogsCall->call(LogsCall::TypeLogsVideoCall); - QVERIFY( QtHighwayStubHelper::service() == "com.nokia.services.telephony" ); + QVERIFY( QtHighwayStubHelper::service() == "com.nokia.symbian.ICallDial" ); QVERIFY( QtHighwayStubHelper::message() == "dialVideo(QString)" ); QVERIFY( QtHighwayStubHelper::isRequestBg() ); QtHighwayStubHelper::reset(); mLogsCall->mServiceId = 3; mLogsCall->call(LogsCall::TypeLogsVoIPCall); - QVERIFY( QtHighwayStubHelper::service() == "com.nokia.services.telephony" ); + QVERIFY( QtHighwayStubHelper::service() == "com.nokia.symbian.ICallDial" ); QVERIFY( QtHighwayStubHelper::message() == "dialVoipService(QString,int)" ); QVERIFY( QtHighwayStubHelper::isRequestBg() ); @@ -149,7 +149,7 @@ { QtHighwayStubHelper::reset(); mLogsCall->initiateCallback(); - QVERIFY( QtHighwayStubHelper::service() == "com.nokia.services.telephony" ); + QVERIFY( QtHighwayStubHelper::service() == "com.nokia.symbian.ICallDial" ); QVERIFY( QtHighwayStubHelper::message() == "dial(QString)" ); QVERIFY( QtHighwayStubHelper::isRequestBg() ); @@ -157,7 +157,7 @@ mLogsCall->mDefaultCall = LogsCall::TypeLogsVideoCall; QtHighwayStubHelper::reset(); mLogsCall->initiateCallback(); - QVERIFY( QtHighwayStubHelper::service() == "com.nokia.services.telephony" ); + QVERIFY( QtHighwayStubHelper::service() == "com.nokia.symbian.ICallDial" ); QVERIFY( QtHighwayStubHelper::message() == "dialVideo(QString)" ); QVERIFY( QtHighwayStubHelper::isRequestBg() ); @@ -165,7 +165,7 @@ QtHighwayStubHelper::reset(); mLogsCall->mServiceId = 3; mLogsCall->initiateCallback(); - QVERIFY( QtHighwayStubHelper::service() == "com.nokia.services.telephony" ); + QVERIFY( QtHighwayStubHelper::service() == "com.nokia.symbian.ICallDial" ); QVERIFY( QtHighwayStubHelper::message() == "dialVoipService(QString,int)" ); QVERIFY( QtHighwayStubHelper::isRequestBg() ); } diff -r 41c0a814d878 -r b04270301d3b logsui/logsengine/tsrc/ut_logsengine/src/ut_logsevent.cpp --- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsevent.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsevent.cpp Wed Jun 23 18:13:05 2010 +0300 @@ -172,16 +172,16 @@ QtContactsStubsHelper::reset(); QContactName name; QtContactsStubsHelper::setContactNames("firstname", ""); - QVERIFY(event.parseContactName(name) == "firstname"); + QCOMPARE(event.parseContactName(name), QString("firstname")); QtContactsStubsHelper::setContactNames("firstname", "lastname"); - QVERIFY(event.parseContactName(name) == "firstname lastname"); + QCOMPARE(event.parseContactName(name), QString("firstname lastname")); QtContactsStubsHelper::setContactNames("", "lastname"); - QVERIFY(event.parseContactName(name) == "lastname"); + QCOMPARE(event.parseContactName(name), QString("lastname")); QtContactsStubsHelper::setContactNames("", ""); - QVERIFY(event.parseContactName(name) == ""); + QCOMPARE(event.parseContactName(name), QString("")); } void UT_LogsEvent::testSerialization() diff -r 41c0a814d878 -r b04270301d3b logsui/tsrc/unittestrunner/unittest_qt_config.txt --- a/logsui/tsrc/unittestrunner/unittest_qt_config.txt Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/tsrc/unittestrunner/unittest_qt_config.txt Wed Jun 23 18:13:05 2010 +0300 @@ -1,4 +1,4 @@ ut_logsengine -noprompt,ut_logs_logsModel.xml,ut_logs_logsDetailsModel.xml,ut_logs_logsMatchesModel.xml,ut_logs_logsFilter.xml,ut_logs_logsCustomFilter.xml,ut_logs_logsCall.xml,ut_logs_logsContact.xml,ut_logs_logsMessage.xml,ut_logs_logsEvent.xml,ut_logs_logsEventData.xml ut_logssymbianos -noprompt,ut_logs_logsDbConnector.xml,ut_logs_logsRemove.xml,ut_logs_logsReader.xml,ut_logs_logsReaderStates.xml,ut_logs_logsEventParser.xml,ut_logs_logsEventDataParser.xml,ut_logs_logsForegroundWatcher.xml -ut_logscntfinder -noprompt,ut_logs_logsCntFinder.xml,ut_logs_logsPredictiveTranslator.xml,ut_logs_logscntentry.xml +ut_logscntfinder -noprompt,UT_LogsPredictiveTranslator.xml, UT_LogsPredictive12KeyTranslator.xml, UT_LogsPredictiveLatin12KeyTranslator.xml, UT_LogsPredictiveThai12KeyTranslator.xml, UT_LogsCntEntry.xml, UT_LogsCntFinder.xml ut_logsapp -noprompt,ut_logsMainWindow.xml,ut_logsRepository.xml,ut_logsViewManager.xml,ut_logsBaseView.xml,ut_logsRecentCallsView.xml,ut_logsDetailsView.xml,ut_logsMatchesView.xml,ut_logsEffectHandler.xml,ut_logsServiceHandler.xml,ut_logsPageIndicator.xml,ut_logsPageIndicatorItem.xml