--- a/logsui/logsapp/inc/logsbaseview.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/inc/logsbaseview.h Thu Jul 22 16:33:49 2010 +0100
@@ -35,6 +35,8 @@
class HbLabel;
class HbListView;
class LogsAbstractModel;
+class QDataStream;
+class HbActivityManager;
/**
*
@@ -45,7 +47,7 @@
friend class UT_LogsBaseView;
public:
-
+
virtual ~LogsBaseView();
public:
@@ -60,13 +62,18 @@
virtual void activated(bool showDialer, QVariant args);
virtual void deactivated();
virtual bool isExitAllowed();
- virtual void resetView();
+ virtual void resetView();
+ virtual void clearActivity(HbActivityManager& manager);
+ virtual QString saveActivity(QDataStream& serializedActivity, QVariantHash& metaData);
+ virtual QVariant loadActivity(
+ const QString& activityId, QDataStream& serializedActivity, QVariantHash& metaData);
+ virtual bool matchWithActivityId(const QString& activityId);
+
public slots:
virtual void handleExit();
virtual void callKeyPressed();
- void closeEmptyMenu();
signals:
@@ -131,7 +138,7 @@
/**
* Loads appropriate section from *.docml to resize list widget
*/
- void updateListSize();
+ void updateListSize( HbListView& list );
protected:
@@ -182,13 +189,17 @@
void updateDialpadCallAndMessagingActions();
bool tryMatchesViewTransition();
bool isDialpadInput() const;
+ void ensureListPositioning( HbListView& list );
+ void scrollToTopItem( HbListView* list );
+
+ void updateMenuVisibility();
+ void setMenuVisible(bool visible);
protected:
LogsAppViewId mViewId;
LogsComponentRepository& mRepository;
LogsAbstractViewManager& mViewManager;
- HbAction* mSoftKeyBackAction;
HbMenu* mShowFilterMenu; //not owned
Dialpad* mDialpad; //not owned
@@ -205,6 +216,9 @@
QSignalMapper* mCallTypeMapper;
QString mLayoutSectionName;
+
+ QStringList mActivities;
+ HbMenu* mOptionsMenu;
};
--- a/logsui/logsapp/inc/logscomponentrepository.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/inc/logscomponentrepository.h Thu Jul 22 16:33:49 2010 +0100
@@ -31,8 +31,10 @@
/**
*
*/
-class LogsComponentRepository : public HbDocumentLoader
+class LogsComponentRepository : public QObject, public HbDocumentLoader
{
+ Q_OBJECT
+
friend class UT_LogsComponentRepository;
friend class UT_LogsViewManager;
@@ -43,9 +45,9 @@
public:
- LogsRecentCallsView* recentCallsView();
- LogsDetailsView* detailsView();
- LogsMatchesView* matchesView();
+ LogsRecentCallsView* recentCallsView(bool onlyInit = false);
+ LogsDetailsView* detailsView(bool onlyInit = false);
+ LogsMatchesView* matchesView(bool onlyInit = false);
/**
* Returns dialpad. Must be always a valid pointer.
@@ -63,6 +65,10 @@
void setObjectTreeToView( LogsAppViewId viewId );
bool loadSection( LogsAppViewId viewId, const QString& sectionName );
+
+private slots:
+
+ void lazyInit();
private:
@@ -71,6 +77,10 @@
void addToolbarToObjectList( QObjectList& list );
+ QGraphicsWidget* doLoadView(
+ const QString &fileName, const QString &viewName,
+ QObjectList &viewComponents, LogsAppViewId viewId, bool onlyInit );
+
private:
LogsAbstractViewManager& mViewManager;
@@ -84,6 +94,7 @@
Dialpad* mDialpad;
DialpadKeyHandler* mDialpadKeyHandler;
LogsModel* mModel;
+ QObjectList* mCurrentObjectTree;
};
#endif // LOGSCOMPONENTREPOSITORY_H
--- a/logsui/logsapp/inc/logsdefs.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/inc/logsdefs.h Thu Jul 22 16:33:49 2010 +0100
@@ -39,6 +39,7 @@
const char logsToolbarId[] = "logs_toolbar";
const char logsButtonAddToContactsId[] = "logs_button_addtocontacts";
const char logsPageIndicatorId[] = "logs_page_indicator";
+const char logsContentId[] = "logs_content";
//action ids
const char logsCommonVideoCallMenuActionId[] = "logs_act_video_call";
@@ -80,4 +81,28 @@
const int logsContactSearchEnabled = 1;
const int logsContactSearchDisabled = 2;
+
+
+// Interface related constants
+const char logsServiceName[] = "logs";
+const char logsInterfaceName[] = "com.nokia.symbian.ILogsView";
+const char logsOperationName[] = "show(QVariantMap)";
+
+const char logsViewIndexParam[] = "view_index";
+const char logsShowDialpadParam[] = "show_dialpad";
+const char logsDialpadTextParam[] = "dialpad_text";
+
+// Activity related constants
+const char logsActivityIdViewRecent[] = "LogsViewRecent";
+const char logsActivityIdViewCalled[] = "LogsViewCalled";
+const char logsActivityIdViewReceived[] = "LogsViewReceived";
+const char logsActivityIdViewMissed[] = "LogsViewMissed";
+const char logsActivityIdViewMatches[] = "LogsViewMatches";
+const char logsActivityIdViewDetails[] = "LogsViewDetails";
+
+const char logsActivityParamShowDialpad[] = "show_dialpad"; // val type bool
+const char logsActivityParamDialpadText[] = "dialpad_text"; // val type string
+const char logsActivityParamInternalViewId[] = "view_id"; // val type int
+
+
#endif // LOGSDEFS_H
--- a/logsui/logsapp/inc/logsdetailsview.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/inc/logsdetailsview.h Thu Jul 22 16:33:49 2010 +0100
@@ -43,6 +43,9 @@
virtual void activated(bool showDialer, QVariant args);
virtual void deactivated();
+ virtual QString saveActivity(QDataStream& serializedActivity, QVariantHash& metaData);
+ virtual QVariant loadActivity(
+ const QString& activityId, QDataStream& serializedActivity, QVariantHash& metaData);
public slots:
--- a/logsui/logsapp/inc/logseffecthandler.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/inc/logseffecthandler.h Thu Jul 22 16:33:49 2010 +0100
@@ -41,13 +41,15 @@
void startDissappearAppearByFadingEffect(QObject& effectTarget);
void startDissappearAppearByMovingEffect(
- QObject& effectTarget, QObject& secondaryEffectTarget, bool dissappearToLeft, int origX);
+ QObject& effectTarget, QObject& secondaryEffectTarget, bool dissappearToLeft,
+ int origX, int secondaryOrigX);
void startMoveNotPossibleEffect(QObject& effectTarget, bool moveLeft, int origX);
signals:
void dissappearByMovingComplete();
void dissappearByFadingComplete();
+ void appearByMovingComplete();
private slots:
--- a/logsui/logsapp/inc/logsmainwindow.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/inc/logsmainwindow.h Thu Jul 22 16:33:49 2010 +0100
@@ -21,8 +21,6 @@
#include <QObject>
#include <hbmainwindow.h>
-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;
--- a/logsui/logsapp/inc/logsmatchesview.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/inc/logsmatchesview.h Thu Jul 22 16:33:49 2010 +0100
@@ -74,6 +74,7 @@
HbListView* mListView; //not owned
LogsMatchesModel* mModel; //owned
HbPushButton* mAddToContactsButton; // not owned
+ bool mAddToContactsButtonDisabled;
};
#endif // LOGSMATCHESVIEW_H
--- a/logsui/logsapp/inc/logspageindicatoritem.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/inc/logspageindicatoritem.h Thu Jul 22 16:33:49 2010 +0100
@@ -35,10 +35,14 @@
void setActive(bool active = true);
bool isActive() const;
+
+protected:
-
+ void changeEvent(QEvent * event);
+
private:
+ void updateColor();
void startAnimation();
private slots:
--- a/logsui/logsapp/inc/logsrecentcallsview.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/inc/logsrecentcallsview.h Thu Jul 22 16:33:49 2010 +0100
@@ -19,7 +19,7 @@
#include "logsfilter.h"
#include "logsbaseview.h"
-#include <QGesture>
+#include <hbscrollarea.h>
class HbListView;
class HbLabel;
@@ -52,7 +52,9 @@
virtual void activated(bool showDialer, QVariant args);
virtual void deactivated();
virtual bool isExitAllowed();
- virtual void resetView();
+ virtual QString saveActivity(QDataStream& serializedActivity, QVariantHash& metaData);
+ virtual QVariant loadActivity(
+ const QString& activityId, QDataStream& serializedActivity, QVariantHash& metaData);
public slots:
@@ -78,8 +80,8 @@
void rightFlick();
void dissappearByFadingComplete();
void dissappearByMovingComplete();
+ void appearByMovingComplete();
bool markMissedCallsSeen();
- void scrollToTopItem();
private: // from LogsBaseView
@@ -104,7 +106,8 @@
//from HbWidget
void gestureEvent(QGestureEvent *event);
- QSwipeGesture::SwipeDirection swipeAngleToDirection(int angle, int delta);
+ int getListItemTextWidth();
+
private:
@@ -122,10 +125,13 @@
bool mMoveLeftInList;
LogsEffectHandler* mEffectHandler;
int mListViewX;
+ int mEmptyListLabelX;
LogsMatchesModel* mMatchesModel;
bool mMarkingMissedAsSeen;
LogsPageIndicator* mPageIndicator;
- bool mResetted;
+ bool mFirstActivation;
+
+ HbScrollArea::ScrollBarPolicy mListScrollBarPolicy;
};
--- a/logsui/logsapp/inc/logsservicehandler.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/inc/logsservicehandler.h Thu Jul 22 16:33:49 2010 +0100
@@ -26,25 +26,25 @@
{
Q_OBJECT
public:
+
explicit LogsServiceHandler(LogsMainWindow& mainWindow);
~LogsServiceHandler();
public slots:
- int start(int activatedView, bool showDialpad);
- int startWithNum(int activatedView, bool showDialpad, QString dialpadText);
+
+ int show(const QVariantMap& params);
signals:
- void activateView(LogsServices::LogsView activatedView, bool showDialpad);
+ void activateView(LogsServices::LogsView activatedView, bool showDialpad, QString dialpadText);
void activateView(QString dialpadText);
public:
- LogsServices::LogsView currentlyActivatedView();
bool isStartedUsingService() const;
private:
- int mActivatedView;
+
LogsMainWindow& mMainWindow;
bool mIsAppStartedUsingService;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logsapp/inc/logsservicehandlerold.h Thu Jul 22 16:33:49 2010 +0100
@@ -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 LOGSSERVICEHANDLEROLD_H
+#define LOGSSERVICEHANDLEROLD_H
+
+#include <xqserviceprovider.h>
+#include <logsservices.h>
+
+class LogsMainWindow;
+
+class LogsServiceHandlerOld : public XQServiceProvider
+ {
+ Q_OBJECT
+ public:
+ explicit LogsServiceHandlerOld(LogsMainWindow& mainWindow);
+ ~LogsServiceHandlerOld();
+
+ public slots:
+ int start(int activatedView, bool showDialpad);
+ int startWithNum(int activatedView, bool showDialpad, QString dialpadText);
+
+ signals:
+
+ void activateView(LogsServices::LogsView activatedView, bool showDialpad, QString dialpadText);
+ void activateView(QString dialpadText);
+
+ public:
+
+ bool isStartedUsingService() const;
+
+ private:
+ LogsMainWindow& mMainWindow;
+ bool mIsAppStartedUsingService;
+
+ private:
+ friend class UT_LogsServiceHandler;
+ friend class UT_LogsViewManager;
+ };
+
+#endif //LOGSSERVICEHANDLEROLD_H
--- a/logsui/logsapp/inc/logsviewmanager.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/inc/logsviewmanager.h Thu Jul 22 16:33:49 2010 +0100
@@ -27,6 +27,7 @@
class HbMainWindow;
class LogsComponentRepository;
class LogsServiceHandler;
+class LogsServiceHandlerOld;
class LogsMainWindow;
class HbView;
class LogsBaseView;
@@ -48,15 +49,16 @@
* @param mainWindow
* @param service
*/
- LogsViewManager( LogsMainWindow& mainWindow, LogsServiceHandler& service );
+ LogsViewManager( LogsMainWindow& mainWindow, LogsServiceHandler& service,
+ LogsServiceHandlerOld& serviceOld );
~LogsViewManager();
public slots:
+ void changeRecentViewViaService(
+ LogsServices::LogsView view, bool showDialpad, QString dialpadText);
+ void changeMatchesViewViaService(QString dialpadText);
void changeRecentView(LogsServices::LogsView view, bool showDialpad);
- void changeMatchesView(QString dialpadText);
- void appFocusGained();
- void appFocusLost();
public: // From LogsAbstractViewManager
@@ -71,16 +73,23 @@
void proceedExit();
void handleOrientationChanged();
void completeViewActivation();
+ void saveActivity();
private:
- void initViews();
- bool doActivateView(LogsAppViewId viewId, bool showDialpad, QVariant args);
+ bool doActivateView(LogsAppViewId viewId, bool showDialpad,
+ QVariant args, const QString& dialpadText = QString());
+ bool loadActivity();
+ LogsAppViewId checkMatchesViewTransition(
+ LogsAppViewId viewId, const QString& dialpadText);
+ void handleFirstActivation();
+ LogsBaseView* createView(LogsAppViewId viewId);
private: //data
LogsMainWindow& mMainWindow;
LogsServiceHandler& mService;
+ LogsServiceHandlerOld& mServiceOld;
LogsComponentRepository* mComponentsRepository;
QList<LogsBaseView*> mViewStack;
bool mFirstActivation;
--- a/logsui/logsapp/logsapp.pro Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/logsapp.pro Thu Jul 22 16:33:49 2010 +0100
@@ -39,10 +39,11 @@
HEADERS += inc/logsdetailsview.h
HEADERS += inc/logsmatchesview.h
HEADERS += inc/logsservicehandler.h
+HEADERS += inc/logsservicehandlerold.h
HEADERS += inc/logseffecthandler.h
HEADERS += inc/logspageindicator.h
HEADERS += inc/logspageindicatoritem.h
-HEADERS += ../logsengine/logssymbianos/inc/logsforegroundwatcher.h
+HEADERS += inc/logscomponentrepository.h
SOURCES += src/main.cpp
SOURCES += src/logsmainwindow.cpp
@@ -53,10 +54,10 @@
SOURCES += src/logsdetailsview.cpp
SOURCES += src/logsmatchesview.cpp
SOURCES += src/logsservicehandler.cpp
+SOURCES += src/logsservicehandlerold.cpp
SOURCES += src/logseffecthandler.cpp
SOURCES += src/logspageindicator.cpp
SOURCES += src/logspageindicatoritem.cpp
-SOURCES += ../logsengine/logssymbianos/src/logsforegroundwatcher.cpp
symbian: {
TARGET.UID2 = 0x100039CE
--- a/logsui/logsapp/logsapp.qrc Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/logsapp.qrc Thu Jul 22 16:33:49 2010 +0100
@@ -11,5 +11,6 @@
<qresource prefix="/logslayouts" >
<file alias="hblistviewitem.css">resources/hblistviewitem.css</file>
<file alias="hblistviewitem.widgetml">resources/hblistviewitem.widgetml</file>
+ <file alias="hbgroupboxheadingwidget.css">resources/hbgroupboxheadingwidget.css</file>
</qresource>
</RCC>
--- a/logsui/logsapp/resources/detailsView.docml Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/resources/detailsView.docml Thu Jul 22 16:33:49 2010 +0100
@@ -1,39 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.7">
+<hbdocument version="1.0">
<object name="logs_act_voice_call" type="HbAction">
- <string name="iconText" value="Voice call"/>
- <string name="text" value="Voice call" locid="txt_common_menu_voice_call"/>
- <string name="toolTip" value="Voice call"/>
+ <string locid="txt_common_opt_voice_call" name="text" value="Voice call"/>
</object>
<object name="logs_act_video_call" type="HbAction">
- <string name="iconText" value="Video call"/>
- <string name="text" value="Video call" locid="txt_common_opt_video_call"/>
- <string name="toolTip" value="Video call"/>
+ <string locid="txt_common_opt_video_call" name="text" value="Video call"/>
</object>
<object name="logs_act_internet_call" type="HbAction">
- <string name="iconText" value="Internet call"/>
- <string name="text" value="Internet call" locid="txt_common_menu_internet_call"/>
- <string name="toolTip" value="Internet call"/>
+ <string locid="txt_common_opt_internet_call" name="text" value="Internet call"/>
</object>
<object name="logs_act_create_message" type="HbAction">
- <string name="iconText" value="Create message"/>
- <string name="text" value="Create message" locid="txt_common_opt_send_message"/>
- <string name="toolTip" value="Create message"/>
+ <string locid="txt_common_opt_send_message" name="text" value="Create message"/>
</object>
<object name="logs_act_add_to_contacts" type="HbAction">
- <string name="iconText" value="Add to contacts"/>
- <string name="text" value="Add to contacts" locid="txt_common_menu_add_to_contacts"/>
- <string name="toolTip" value="Add to contacts"/>
+ <string locid="txt_common_opt_add_to_contacts" name="text" value="Add to contacts"/>
</object>
<object name="logs_act_open_contact" type="HbAction">
- <string name="iconText" value="Open contact"/>
- <string name="text" value="Open contact" locid="txt_dialer_ui_menu_open_contact"/>
- <string name="toolTip" value="Open contact"/>
+ <string locid="txt_dialer_ui_opt_open_contact" name="text" value="Open contact"/>
</object>
<object name="logs_act_delete_event" type="HbAction">
- <string name="iconText" value="Delete event"/>
- <string name="text" value="Delete event" locid="txt_dialer_ui_title_delete_event"/>
- <string name="toolTip" value="Delete event"/>
+ <string locid="txt_common_opt_delete" name="text" value="Delete event"/>
</object>
<object name="logs_act_dialer" type="HbAction">
<icon iconName="qtg_mono_dialer" name="icon"/>
@@ -48,45 +34,43 @@
<string name="toolTip" value="Show"/>
</object>
<object name="logs_act_recent" type="HbAction">
- <string name="iconText" value="Recent calls"/>
- <string name="text" value="Recent calls" locid="txt_dialer_subhead_recent_calls"/>
- <string name="toolTip" value="Recent calls"/>
+ <string locid="txt_dialer_ui_list_recent" name="text" value="Recent calls"/>
</object>
<object name="logs_act_received" type="HbAction">
- <string name="iconText" value="Received calls"/>
- <string name="text" value="Received calls" locid="txt_dial_subhead_received_calls"/>
- <string name="toolTip" value="Received calls"/>
+ <string locid="txt_dialer_ui_list_received" name="text" value="Received calls"/>
</object>
<object name="logs_act_dialled" type="HbAction">
- <string name="iconText" value="Dialled calls"/>
- <string name="text" value="Dialled calls" locid="txt_dialer_subhead_dialled_calls"/>
- <string name="toolTip" value="Dialled calls"/>
+ <string locid="txt_dialer_ui_list_dialled" name="text" value="Dialled calls"/>
</object>
<object name="logs_act_missed" type="HbAction">
- <string name="iconText" value="Missed calls"/>
- <string name="text" value="Missed calls" locid="txt_dialer_subhead_missed_calls"/>
- <string name="toolTip" value="Missed calls"/>
+ <string locid="txt_dialer_ui_list_missed" name="text" value="Missed calls"/>
</object>
<widget name="logs_details_view" type="HbView">
<widget name="logs_content" role="HbView:widget" type="HbWidget">
- <widget name="logs_groupbox_remote_party_info" type="HbGroupBox">
- <string name="heading" value=""/>
- <bool name="collapsable" value="FALSE"/>
- <real name="spacing" value="0un"/>
- </widget>
- <widget name="logs_details_list_view" type="HbListView">
- <real name="z" value="2.0001"/>
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
- <real name="spacing" value="0un"/>
- </widget>
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="logs_groupbox_remote_party_info"/>
- <linearitem itemname="logs_details_list_view"/>
+ <widget name="container" type="HbWidget">
+ <widget name="logs_groupbox_remote_party_info" type="HbGroupBox">
+ <bool name="collapsable" value="FALSE"/>
+ <string name="heading"/>
+ </widget>
+ <widget name="logs_details_list_view" type="HbListView">
+ <widget name="listItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem"/>
+ </widget>
+ <real name="z" value="1"/>
+ <layout orientation="Vertical" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="logs_groupbox_remote_party_info"/>
+ <linearitem itemname="logs_details_list_view"/>
+ </layout>
+ </widget>
+ <contentsmargins bottom="expr(var(hb-param-margin-view-bottom))" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-margin-view-right))" top="expr(var(hb-param-margin-view-top))"/>
+ <layout type="anchor">
+ <anchoritem dst="container" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="container" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="container" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="container" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
</layout>
</widget>
<widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <real name="z" value="2"/>
<enums name="orientation" value="Horizontal"/>
<ref object="logs_act_contacts" role="HbToolBar:addAction"/>
<ref object="logs_act_dialer" role="HbToolBar:addAction"/>
@@ -101,58 +85,10 @@
<ref object="logs_act_open_contact" role="HbMenu:addAction"/>
<ref object="logs_act_delete_event" role="HbMenu:addAction"/>
</widget>
- <string name="title" value="Dialer"/>
+ <string locid="txt_dial_title_dialer" name="title" value="Dialer"/>
</widget>
- <section name="portrait_dialpad">
- <widget name="logs_content" role="HbView:widget" type="HbWidget">
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="expr(var(hb-param-margin-view-bottom)+54un)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="logs_groupbox_remote_party_info"/>
- <linearitem itemname="logs_details_list_view"/>
- </layout>
- </widget>
- <widget name="logs_label_empty_list" type="HbLabel">
- <rect height="26.12959" name="geometry" width="349.95" x="0.75un" y="8un"/>
- </widget>
- <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <bool name="visible" value="FALSE"/>
- </widget>
- </section>
- <section name="landscape_dialpad">
- <widget name="logs_content" role="HbView:widget" type="HbWidget">
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="expr(var(hb-param-margin-view-right)+48un)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="logs_groupbox_remote_party_info"/>
- <linearitem itemname="logs_details_list_view"/>
- </layout>
- </widget>
- <widget name="logs_label_empty_list" type="HbLabel">
- <rect height="26" name="geometry" width="312.75" x="0.75un" y="8un"/>
- </widget>
- <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <bool name="visible" value="FALSE"/>
- </widget>
- </section>
- <section name="default">
- <widget name="logs_content" role="HbView:widget" type="HbWidget">
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="logs_groupbox_remote_party_info"/>
- <linearitem itemname="logs_details_list_view"/>
- </layout>
- </widget>
- <widget name="logs_label_empty_list" type="HbLabel">
- <rect height="26.12959" name="geometry" width="349.95" x="0.75un" y="8un"/>
- </widget>
- <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <bool name="visible" value="TRUE"/>
- </widget>
- </section>
-
<!-- Context menu -->
<widget name="logs_show_filter_menu" type="HbMenu">
- <integer name="timeout" value="5000000"/> <!-- 5 seconds timeout -->
- <enums name="dismissPolicy" value="TapAnywhere"/>
<ref object="logs_act_recent" role="HbMenu:addAction"/>
<ref object="logs_act_dialled" role="HbMenu:addAction"/>
<ref object="logs_act_received" role="HbMenu:addAction"/>
@@ -169,11 +105,38 @@
<connect receiver="logs_details_view" sender="logs_act_contacts" signal="triggered(bool)" slot="openContactsApp()"/>
<connect receiver="logs_details_view" sender="logs_act_show" signal="triggered(bool)" slot="showFilterMenu()"/>
<connect receiver="logs_details_view" sender="logs_show_filter_menu" signal="triggered(HbAction*)" slot="changeFilter(HbAction*)"/>
- <metadata activeUIState="Common ui state" display="QHD portrait" unit="un">
+ <section name="portrait_dialpad">
+ <widget name="logs_label_empty_list" type="HbLabel">
+ <rect height="var(hb-param-text-height-primary)" name="geometry" width="expr(var(hb-param-screen-width)-2*var(hb-param-margin-gene-screen))" x="var(hb-param-margin-gene-screen)" y="8.5un"/>
+ </widget>
+ <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="logs_content" role="HbView:widget" type="HbWidget">
+ <contentsmargins bottom="expr(var(hb-param-screen-height)*0.55)" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-margin-view-right))" top="expr(var(hb-param-margin-view-top))"/>
+ </widget>
+ </section>
+ <section name="landscape_dialpad">
+ <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="logs_content" role="HbView:widget" type="HbWidget">
+ <contentsmargins bottom="expr(var(hb-param-margin-view-bottom))" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-screen-height)/2)" top="expr(var(hb-param-margin-view-top))"/>
+ </widget>
+ </section>
+ <section name="default">
+ <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
+ <bool name="visible" value="TRUE"/>
+ </widget>
+ <widget name="logs_content" role="HbView:widget" type="HbWidget">
+ <contentsmargins bottom="expr(var(hb-param-margin-view-bottom))" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-margin-view-right))" top="expr(var(hb-param-margin-view-top))"/>
+ </widget>
+ </section>
+ <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
<uistate name="Common ui state" sections="#common"/>
<uistate name="portrait" sections="#common portrait_dialpad"/>
<uistate name="landscape" sections="#common landscape_dialpad"/>
<uistate name="default" sections="#common default"/>
- <dummydata objectName="logs_list_view" section="#common" value="0"/>
- </metadata>
+ <dummydata objectName="logs_details_list_view" section="#common" value="app_list_template5"/>
+ </metadata>
</hbdocument>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logsapp/resources/hbgroupboxheadingwidget.css Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,9 @@
+HbGroupBoxHeadingWidget[groupBoxType="1"]::text
+{
+ right:expr(4*var(hb-param-graphic-size-secondary));
+}
+
+HbGroupBoxHeadingWidget[groupBoxType="3"]::text
+{
+ right:expr(4*var(hb-param-graphic-size-secondary));
+}
--- a/logsui/logsapp/resources/hblistviewitem.css Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/resources/hblistviewitem.css Thu Jul 22 16:33:49 2010 +0100
@@ -1,3 +1,7 @@
+HbListViewItem[layoutName="default"]{
+ layout:logs-portrait;
+}
+
HbListViewItem[layoutName="logsLandscape"]{
layout:logs-landscape;
}
@@ -6,33 +10,22 @@
layout:logs-landscape;
}
-HbListViewItem::text-1[layoutName="logsLandscape"]{
- fixed-width: 40.0un;
- text-height: var(hb-param-text-height-primary);
+HbListViewItem::text-2[layoutName="default"]{
+ max-width:-1;
+ text-height: var(hb-param-text-height-secondary);
}
-HbListViewItem::text-2[layoutName="logsLandscape"]{
-
- fixed-width: 40.0un;
- text-height: var(hb-param-text-height-secondary);
+HbListViewItem::text-1[layoutName="logsLandscape"]{
+ pref-width: expr(var(hb-param-screen-width)/2 - var(hb-param-graphic-size-primary-medium) - var(hb-param-margin-gene-left) - var(hb-param-margin-gene-middle-horizontal));
}
-HbListViewItem::text-1[layoutName="logsLandscapeDialpad"]{
- fixed-width: 38.0un;
- text-height: var(hb-param-text-height-primary);
+HbListViewItem::text-2[layoutName="logsLandscape"]{
+ max-width:-1;
+ text-height: var(hb-param-text-height-secondary);
}
HbListViewItem::text-2[layoutName="logsLandscapeDialpad"]{
- fixed-width: 0.0un;
- text-height: 0.0un;
+ max-width: 0.0un;
+ text-height: 0.0un;
}
-HbListViewItem::text-1[layoutName="default"]{
- fixed-width: 40.0un;
- text-height: var(hb-param-text-height-primary);
-}
-
-HbListViewItem::text-2[layoutName="default"]{
- fixed-width: 40.0un;
- text-height: var(hb-param-text-height-secondary);
-}
--- a/logsui/logsapp/resources/hblistviewitem.widgetml Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/resources/hblistviewitem.widgetml Thu Jul 22 16:33:49 2010 +0100
@@ -1,5 +1,45 @@
-<hbwidget version="0.1" type="listviewitem">
+<hbwidget version="0.1" type="listviewitem">
+<!-- layout-portrait -->
+ <!--
+ Required items:
+ text-1
+
+ Items from left to right:
+ <- selection icon <- icon-1 <- text-1 -> icon-2 ->
+ text-2 ->
+
+ Other:
+ selection icon: center aligned with text-1 center
+ icon-1: top aligned with text-1 top
+ icon-2: center aligned with text-1 center
+
+ text-1: connected from TOP to item TOP and BOTTOM to text-2 TOP
+ text-2: connected BOTTOM to BOTTOM
+ text-3: connected BOTTOM to text-2 BOTTOM
+ -->
+ <layout name="logs-portrait" type="mesh">
+ <meshitem src="icon-1" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" />
+ <meshitem src="icon-1" srcEdge="TOP" dst="text-1" dstEdge="TOP" />
+
+ <meshitem src="text-1" srcEdge="LEFT" dst="icon-1" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" />
+ <meshitem src="text-1" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
+ <meshitem src="text-1" srcEdge="RIGHT" dst="icon-2" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" />
+ <meshitem src="text-1" srcEdge="BOTTOM" dst="text-2" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" />
+
+ <meshitem src="text-2" srcEdge="LEFT" dst="text-1" dstEdge="LEFT" />
+ <meshitem src="text-2" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" />
+ <meshitem src="text-2" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)" />
+
+ <meshitem src="icon-2" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" />
+ <meshitem src="icon-2" srcEdge="CENTERV" dst="text-1" dstEdge="CENTERV" />
+
+ <meshitem src="multiselection-toucharea" srcEdge="CENTERH" dst="selection-icon" dstEdge="CENTERH" />
+ <meshitem src="multiselection-toucharea" srcEdge="TOP" dst="" dstEdge="TOP" />
+ <meshitem src="multiselection-toucharea" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+ </layout>
+
+
<!-- logs-landscape -->
<!--
Required items:
@@ -30,15 +70,9 @@
<meshitem src="icon-2" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/>
<meshitem src="icon-2" srcEdge="CENTERV" dst="icon-1" dstEdge="CENTERV" />
- <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
- <meshitem src="background" srcEdge="TOP" dst="" dstEdge="TOP" />
- <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
- <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
-
- <meshitem src="frame" srcEdge="LEFT" dst="" dstEdge="LEFT" />
- <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP" />
- <meshitem src="frame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
- <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+ <meshitem src="multiselection-toucharea" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+ <meshitem src="multiselection-toucharea" srcEdge="TOP" dst="" dstEdge="TOP" />
+ <meshitem src="multiselection-toucharea" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
</layout>
@@ -51,9 +85,9 @@
icon -1 -> text-1
Other:
- icon-1: connected from TOP to item TOP and BOTTOM to item BOTTOM
-
+ icon-1: connected from TOP to item TOP and BOTTOM to item BOTTOM
text-1: center aligned with icon-1 center
+ text-2 is forced not to become visible. It's size is set (0.0,0.0) in .css.
-->
<layout name="logs-landscape-dialpad" type="mesh">
<meshitem src="icon-1" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)"/>
@@ -64,15 +98,9 @@
<meshitem src="text-1" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" />
<meshitem src="text-1" srcEdge="CENTERV" dst="icon-1" dstEdge="CENTERV" />
- <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
- <meshitem src="background" srcEdge="TOP" dst="" dstEdge="TOP" />
- <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
- <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
-
- <meshitem src="frame" srcEdge="LEFT" dst="" dstEdge="LEFT" />
- <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP" />
- <meshitem src="frame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
- <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+ <meshitem src="multiselection-toucharea" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+ <meshitem src="multiselection-toucharea" srcEdge="TOP" dst="" dstEdge="TOP" />
+ <meshitem src="multiselection-toucharea" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
</layout>
</hbwidget>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logsapp/resources/logs.docml Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.1">
+ <widget name="mainView" type="HbView">
+ <widget name="groupBox" role="HbView:widget" type="HbGroupBox">
+ <real name="z" value="1"/>
+ <bool name="collapsable" value="FALSE"/>
+ <string name="heading" value=" "/>
+ </widget>
+ <string locid="Dialer" name="title" value="dialler"/>
+ </widget>
+ <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logsapp/resources/logs.splashml Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbsplash version="1">
+ <docml>logs.docml</docml>
+ <widget>mainView</widget>
+ <appuid>0x101F4CD5</appuid>
+ <tsappname>dialer</tsappname>
+</hbsplash>
--- a/logsui/logsapp/resources/matchesView.docml Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/resources/matchesView.docml Thu Jul 22 16:33:49 2010 +0100
@@ -1,19 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.7">
+<hbdocument version="1.0">
<object name="logs_act_video_call" type="HbAction">
- <string name="iconText" value="Video call"/>
- <string name="text" value="Video call" locid="txt_common_opt_video_call"/>
- <string name="toolTip" value="Video call"/>
+ <string locid="txt_common_opt_video_call" name="text" value="Video call"/>
</object>
<object name="logs_act_create_message" type="HbAction">
- <string name="iconText" value="Send message"/>
- <string name="text" value="Send message" locid="txt_common_opt_create_message"/>
- <string name="toolTip" value="Send message"/>
+ <string locid="txt_common_opt_create_message" name="text" value="Send message"/>
</object>
<object name="logs_act_contact_search" type="HbAction">
- <string name="iconText" value="Contact search"/>
- <string name="text" value="Contact search" locid="txt_dialer_ui_opt_contact_search"/>
- <string name="toolTip" value="Contact search"/>
+ <string locid="txt_dialer_ui_opt_contact_search" name="text" value="Contact search"/>
</object>
<object name="logs_act_dialer" type="HbAction">
<icon iconName="qtg_mono_dialer" name="icon"/>
@@ -28,64 +22,50 @@
<string name="toolTip" value="Show"/>
</object>
<object name="logs_act_recent" type="HbAction">
- <string name="iconText" value="Recent calls"/>
- <string name="text" value="Recent calls" locid="txt_dialer_subhead_recent_calls"/>
- <string name="toolTip" value="Recent calls"/>
+ <string locid="txt_dialer_ui_list_recent" name="text" value="Recent calls"/>
</object>
<object name="logs_act_received" type="HbAction">
- <string name="iconText" value="Received calls"/>
- <string name="text" value="Received calls" locid="txt_dial_subhead_received_calls"/>
- <string name="toolTip" value="Received calls"/>
+ <string locid="txt_dialer_ui_list_received" name="text" value="Received calls"/>
</object>
<object name="logs_act_dialled" type="HbAction">
- <string name="iconText" value="Dialled calls"/>
- <string name="text" value="Dialled calls" locid="txt_dialer_subhead_dialled_calls"/>
- <string name="toolTip" value="Dialled calls"/>
+ <string locid="txt_dialer_ui_list_dialled" name="text" value="Dialled calls"/>
</object>
<object name="logs_act_missed" type="HbAction">
- <string name="iconText" value="Missed calls"/>
- <string name="text" value="Missed calls" locid="txt_dialer_subhead_missed_calls"/>
- <string name="toolTip" value="Missed calls"/>
+ <string locid="txt_dialer_ui_list_missed" name="text" value="Missed calls"/>
</object>
<widget name="logs_matches_view" type="HbView">
<widget name="logs_content" role="HbView:widget" type="HbWidget">
- <widget name="logs_list_view" type="HbListView">
- <real name="z" value="2.0001"/>
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
- <real name="spacing" value="0un"/>
- </widget>
<widget name="logs_label_empty_list" type="HbLabel">
<enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <real name="z" value="3"/>
- <rect height="26.12959" name="geometry" width="349.95" x="0.75un" y="8.25un"/>
- <sizehint height="3.9un" type="PREFERRED" width="18.91045un"/>
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <real name="z" value="1"/>
<bool name="visible" value="FALSE"/>
- <string name="plainText" value="No matches found" locid="txt_dialer_ui_list_no_matches_found"/>
- <enums name="logicalFont" value="FontPrimary"/>
- </widget>
- <widget name="logs_groupbox_matched_calls" type="HbGroupBox">
- <string name="heading" value="Matches" locid="txt_dialer_ui_subhead_matches"/>
- <bool name="collapsable" value="FALSE"/>
- <real name="spacing" value="0un"/>
+ <string locid="txt_dialer_ui_list_no_matches_found" name="plainText" value="No matches found"/>
+ <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
</widget>
<widget name="logs_button_addtocontacts" type="HbPushButton">
- <icon iconName="qtg_mono_add_contact" name="icon"/>
- <enums name="layoutDirection" value="RightToLeft"/>
- <real name="z" value="4"/>
- <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
- <sizehint height="9.0un" type="PREFERRED" width="22.0un"/>
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
- <rect height="9.0un" name="geometry" width="22.0un" x="15.86un" y="16.71642un"/>
- </widget>
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="logs_groupbox_matched_calls"/>
- <linearitem itemname="logs_list_view"/>
- </layout>
+ <icon iconName="qtg_mono_add_to_contact" name="icon"/>
+ <real name="z" value="2"/>
+ <sizehint height="9un" type="PREFERRED" width="22un"/>
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="container" type="HbWidget">
+ <widget name="logs_groupbox_matched_calls" type="HbGroupBox">
+ <bool name="collapsable" value="FALSE"/>
+ <string locid="txt_dialer_ui_subhead_matches" name="heading" value="Matches"/>
+ </widget>
+ <widget name="logs_list_view" type="HbListView">
+ <widget name="listItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem"/>
+ </widget>
+ <real name="z" value="3"/>
+ <layout orientation="Vertical" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="logs_groupbox_matched_calls"/>
+ <linearitem itemname="logs_list_view"/>
+ </layout>
+ </widget>
+ <contentsmargins bottom="expr(var(hb-param-margin-view-bottom))" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-margin-view-right))" top="expr(var(hb-param-margin-view-top))"/>
</widget>
<widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <real name="z" value="2"/>
<enums name="orientation" value="Horizontal"/>
<ref object="logs_act_contacts" role="HbToolBar:addAction"/>
<ref object="logs_act_dialer" role="HbToolBar:addAction"/>
@@ -94,66 +74,12 @@
<widget name="logs_view_menu2" role="HbView:menu" type="HbMenu">
<ref object="logs_act_video_call" role="HbMenu:addAction"/>
<ref object="logs_act_create_message" role="HbMenu:addAction"/>
- <ref object="logs_act_contact_search" role="HbMenu:addAction"/>
- </widget>
- <string name="title" value="Dialer"/>
- </widget>
- <section name="portrait_dialpad">
- <widget name="logs_content" role="HbView:widget" type="HbWidget">
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="expr(var(hb-param-margin-view-bottom)+54un)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="logs_groupbox_matched_calls"/>
- <linearitem itemname="logs_list_view"/>
- </layout>
- </widget>
- <widget name="logs_label_empty_list" type="HbLabel">
- <rect height="26.12959" name="geometry" width="349.95" x="0.75un" y="8un"/>
- </widget>
- <widget name="logs_button_addtocontacts" type="HbPushButton">
- <rect height="9.0un" name="geometry" width="22.0un" x="15.86un" y="16.71642un"/>
- </widget>
- <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <bool name="visible" value="FALSE"/>
+ <ref object="logs_act_contact_search" role="HbMenu:addAction"/>
</widget>
- </section>
- <section name="landscape_dialpad">
- <widget name="logs_content" role="HbView:widget" type="HbWidget">
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="expr(var(hb-param-margin-view-right)+48un)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="logs_groupbox_matched_calls"/>
- <linearitem itemname="logs_list_view"/>
- </layout>
- </widget>
- <widget name="logs_label_empty_list" type="HbLabel">
- <rect height="26" name="geometry" width="312.75" x="0.75un" y="8un"/>
- </widget>
- <widget name="logs_button_addtocontacts" type="HbPushButton">
- <rect height="9.0un" name="geometry" width="22.0un" x="12.88un" y="16.71642un"/>
- </widget>
- <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <bool name="visible" value="FALSE"/>
- </widget>
- </section>
- <section name="default">
- <widget name="logs_content" role="HbView:widget" type="HbWidget">
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="logs_groupbox_matched_calls"/>
- <linearitem itemname="logs_list_view"/>
- </layout>
- </widget>
- <widget name="logs_label_empty_list" type="HbLabel">
- <rect height="26.12959" name="geometry" width="349.95" x="0.75un" y="8un"/>
- </widget>
- <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <bool name="visible" value="TRUE"/>
- </widget>
- </section>
-
+ <string locid="txt_dial_title_dialer" name="title" value="Dialer"/>
+ </widget>
<!-- Context menu -->
<widget name="logs_show_filter_menu" type="HbMenu">
- <integer name="timeout" value="5000000"/> <!-- 5 seconds timeout -->
- <enums name="dismissPolicy" value="TapAnywhere"/>
<ref object="logs_act_recent" role="HbMenu:addAction"/>
<ref object="logs_act_dialled" role="HbMenu:addAction"/>
<ref object="logs_act_received" role="HbMenu:addAction"/>
@@ -167,7 +93,64 @@
<connect receiver="logs_matches_view" sender="logs_button_addtocontacts" signal="clicked()" slot="saveNumberInDialpadToContacts()"/>
<connect receiver="logs_matches_view" sender="logs_act_show" signal="triggered(bool)" slot="showFilterMenu()"/>
<connect receiver="logs_matches_view" sender="logs_show_filter_menu" signal="triggered(HbAction*)" slot="changeFilter(HbAction*)"/>
- <metadata activeUIState="Common ui state" display="QHD portrait" unit="un">
+ <section name="portrait_dialpad">
+ <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="logs_content" role="HbView:widget" type="HbWidget">
+ <contentsmargins bottom="expr(var(hb-param-screen-height)*0.55)" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-margin-view-right))" top="expr(var(hb-param-margin-view-top))"/>
+ <layout type="anchor">
+ <anchoritem dst="logs_button_addtocontacts" dstEdge="TOP" spacing="15un" src="" srcEdge="TOP"/>
+ <anchoritem dst="logs_button_addtocontacts" dstEdge="CENTERH" spacing="0un" src="" srcEdge="CENTERH"/>
+ <anchoritem dst="container" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="container" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="container" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="container" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-screen) )" src="" srcEdge="LEFT"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="TOP" spacing="8.5un" src="" srcEdge="TOP"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-screen) )" src="" srcEdge="RIGHT"/>
+ </layout>
+ </widget>
+ </section>
+ <section name="landscape_dialpad">
+ <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="logs_content" role="HbView:widget" type="HbWidget">
+ <contentsmargins bottom="expr(var(hb-param-margin-view-bottom))" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-screen-height)/2)" top="expr(var(hb-param-margin-view-top))"/>
+ <layout type="anchor">
+ <anchoritem dst="logs_button_addtocontacts" dstEdge="TOP" spacing="19un" src="" srcEdge="TOP"/>
+ <anchoritem dst="logs_button_addtocontacts" dstEdge="CENTERH" spacing="0un" src="" srcEdge="CENTERH"/>
+ <anchoritem dst="container" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="container" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="container" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="container" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-screen) )" src="" srcEdge="LEFT"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="TOP" spacing="8.5un" src="" srcEdge="TOP"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-screen) )" src="" srcEdge="RIGHT"/>
+ </layout>
+ </widget>
+ </section>
+ <section name="default">
+ <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
+ <bool name="visible" value="TRUE"/>
+ </widget>
+ <widget name="logs_content" role="HbView:widget" type="HbWidget">
+ <contentsmargins bottom="expr(var(hb-param-margin-view-bottom))" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-margin-view-right))" top="expr(var(hb-param-margin-view-top))"/>
+ <layout type="anchor">
+ <anchoritem dst="logs_button_addtocontacts" dstEdge="TOP" spacing="19un" src="" srcEdge="TOP"/>
+ <anchoritem dst="logs_button_addtocontacts" dstEdge="CENTERH" spacing="0un" src="" srcEdge="CENTERH"/>
+ <anchoritem dst="container" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="container" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="container" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="container" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-screen) )" src="" srcEdge="LEFT"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="TOP" spacing="8.5un" src="" srcEdge="TOP"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-screen) )" src="" srcEdge="RIGHT"/>
+ </layout>
+ </widget>
+ </section>
+ <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
<uistate name="Common ui state" sections="#common"/>
<uistate name="portrait" sections="#common portrait_dialpad"/>
<uistate name="landscape" sections="#common landscape_dialpad"/>
--- a/logsui/logsapp/resources/recentCallsView.docml Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/resources/recentCallsView.docml Thu Jul 22 16:33:49 2010 +0100
@@ -1,31 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.7">
+<hbdocument version="1.0">
<object name="logs_act_video_call" type="HbAction">
- <string name="iconText" value="Video call"/>
- <string name="text" value="Video call" locid="txt_common_opt_video_call"/>
- <string name="toolTip" value="Video call"/>
+ <string locid="txt_common_opt_video_call" name="text" value="Video call"/>
</object>
<object name="logs_act_create_message" type="HbAction">
- <string name="iconText" value="Send message"/>
- <string name="text" value="Send message" locid="txt_common_opt_create_message"/>
- <string name="toolTip" value="Send message"/>
+ <string locid="txt_common_opt_create_message" name="text" value="Send message"/>
</object>
<object name="logs_act_add_to_contacts" type="HbAction">
- <string name="iconText" value="Add to contacts"/>
- <string name="text" value="Add to contacts" locid="txt_common_menu_add_to_contacts"/>
- <string name="toolTip" value="Add to contacts"/>
+ <string locid="txt_common_opt_add_to_contacts" name="text" value="Add to contacts"/>
</object>
<object name="logs_act_clear_list" type="HbAction">
- <string name="iconText" value="Clear list"/>
- <string name="text" value="Clear list" locid="txt_dialer_ui_opt_clear_list"/>
- <string name="toolTip" value="Clear list"/>
+ <string locid="txt_dialer_ui_opt_clear_list" name="text" value="Clear list"/>
</object>
<object name="logs_act_contact_search" type="HbAction">
- <string name="iconText" value="Contact search"/>
- <string name="text" value="Contact search" locid="txt_dialer_ui_opt_contact_search"/>
- <string name="toolTip" value="Contact search"/>
+ <string locid="txt_dialer_ui_opt_contact_search" name="text" value="Contact search"/>
</object>
-
<object name="logs_act_dialer" type="HbAction">
<icon iconName="qtg_mono_dialer" name="icon"/>
<string name="toolTip" value="Dialer"/>
@@ -39,74 +28,72 @@
<string name="toolTip" value="Show"/>
</object>
<object name="logs_act_recent" type="HbAction">
- <string name="iconText" value="Recent calls"/>
- <string name="text" value="Recent calls" locid="txt_dialer_subhead_recent_calls"/>
- <string name="toolTip" value="Recent calls"/>
+ <string locid="txt_dialer_ui_list_recent" name="text" value="Recent calls"/>
<string name="checkable" value="TRUE"/>
</object>
<object name="logs_act_received" type="HbAction">
- <string name="iconText" value="Received calls"/>
- <string name="text" value="Received calls" locid="txt_dial_subhead_received_calls"/>
- <string name="toolTip" value="Received calls"/>
+ <string locid="txt_dialer_ui_list_received" name="text" value="Received calls"/>
<string name="checkable" value="TRUE"/>
</object>
<object name="logs_act_dialled" type="HbAction">
- <string name="iconText" value="Dialled calls"/>
- <string name="text" value="Dialled calls" locid="txt_dialer_subhead_dialled_calls"/>
- <string name="toolTip" value="Dialled calls"/>
+ <string locid="txt_dialer_ui_list_dialled" name="text" value="Dialled calls"/>
<string name="checkable" value="TRUE"/>
</object>
<object name="logs_act_missed" type="HbAction">
- <string name="iconText" value="Missed calls"/>
- <string name="text" value="Missed calls" locid="txt_dialer_subhead_missed_calls"/>
- <string name="toolTip" value="Missed calls"/>
+ <string locid="txt_dialer_ui_list_missed" name="text" value="Missed calls"/>
<string name="checkable" value="TRUE"/>
</object>
<widget name="logs_recent_calls_view" type="HbView">
<widget name="logs_content" role="HbView:widget" type="HbWidget">
- <widget name="logs_list_view" type="HbListView">
- <real name="z" value="2.0001"/>
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
- <real name="spacing" value="0un"/>
- </widget>
<widget name="logs_label_empty_list" type="HbLabel">
<enums name="alignment" value="AlignVCenter|AlignHCenter"/>
- <real name="z" value="3"/>
- <rect height="26.12959" name="geometry" width="349.95" x="0.75un" y="8.25un"/>
- <sizehint height="3.9un" type="PREFERRED" width="18.91045un"/>
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <real name="z" value="1"/>
<bool name="visible" value="FALSE"/>
- <string name="plainText" value="No history of calls" locid="txt_dialer_ui_list_no_history_of_calls"/>
- <enums name="logicalFont" value="FontPrimary"/>
+ <string locid="txt_dialer_ui_list_no_history_of_calls" name="plainText" value="No history of calls"/>
+ <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
</widget>
- <widget name="qroupbox_container" type="HbWidget">
- <widget name="logs_groupbox_recent_calls" type="HbGroupBox">
- <string name="heading" value="Recent calls"/>
- <bool name="collapsable" value="FALSE"/>
- <real name="spacing" value="0un"/>
+ <widget name="container" type="HbWidget">
+ <widget name="qroupbox_container" type="HbWidget">
+ <widget name="logs_groupbox_recent_calls" type="HbGroupBox">
+ <real name="z" value="1"/>
+ <bool name="collapsable" value="FALSE"/>
+ </widget>
+ <widget name="logs_page_indicator" type="LogsPageIndicator">
+ <real name="z" value="2"/>
+ <sizehint height="var(hb-param-graphic-size-secondary)" type="PREFERRED" width="expr(4*var(hb-param-graphic-size-secondary))"/>
+ </widget>
+ <real name="z" value="0"/>
+ <layout type="anchor">
+ <anchoritem dst="logs_groupbox_recent_calls" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="logs_groupbox_recent_calls" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="logs_groupbox_recent_calls" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="logs_groupbox_recent_calls" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="logs_page_indicator" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="logs_page_indicator" dstEdge="CENTERV" spacing="0un" src="" srcEdge="CENTERV"/>
+ </layout>
</widget>
- <widget name="logs_page_indicator" type="LogsPageIndicator">
- <real name="z" value="3"/>
- <sizehint type="PREFERRED" height="var(hb-param-graphic-size-secondary)" width="expr(4*var(hb-param-graphic-size-secondary))"/>
+ <widget name="logs_list_view" type="HbListView">
+ <widget name="listItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem"/>
</widget>
<real name="z" value="2"/>
- <layout type="anchor" widget="qroupbox_container">
- <anchoritem dst="logs_groupbox_recent_calls" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
- <anchoritem dst="logs_groupbox_recent_calls" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="logs_groupbox_recent_calls" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
- <anchoritem dst="logs_groupbox_recent_calls" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
- <anchoritem dst="logs_page_indicator" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
- <anchoritem dst="logs_page_indicator" dstEdge="CENTERV" spacing="0un" src="" srcEdge="CENTERV"/>
+ <layout orientation="Vertical" type="linear">
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ <linearitem itemname="qroupbox_container"/>
+ <linearitem itemname="logs_list_view"/>
</layout>
</widget>
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="qroupbox_container"/>
- <linearitem itemname="logs_list_view"/>
+ <contentsmargins bottom="expr(var(hb-param-margin-view-bottom))" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-margin-view-right))" top="expr(var(hb-param-margin-view-top))"/>
+ <layout type="anchor">
+ <anchoritem dst="container" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+ <anchoritem dst="container" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+ <anchoritem dst="container" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+ <anchoritem dst="container" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-screen))" src="" srcEdge="LEFT"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="TOP" spacing="8.5un" src="" srcEdge="TOP"/>
+ <anchoritem dst="logs_label_empty_list" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-screen))" src="" srcEdge="RIGHT"/>
</layout>
</widget>
<widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <real name="z" value="2"/>
<enums name="orientation" value="Horizontal"/>
<ref object="logs_act_contacts" role="HbToolBar:addAction"/>
<ref object="logs_act_dialer" role="HbToolBar:addAction"/>
@@ -119,75 +106,15 @@
<ref object="logs_act_clear_list" role="HbMenu:addAction"/>
<ref object="logs_act_contact_search" role="HbMenu:addAction"/>
</widget>
- <string name="title" value="Dialer"/>
+ <string locid="txt_dial_title_dialer" name="title" value="Dialer"/>
</widget>
- <section name="portrait_dialpad">
- <widget name="logs_content" role="HbView:widget" type="HbWidget">
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="expr(var(hb-param-margin-view-bottom)+54un)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="qroupbox_container"/>
- <linearitem itemname="logs_list_view"/>
- </layout>
- </widget>
- <widget name="logs_label_empty_list" type="HbLabel">
- <rect height="26.12959" name="geometry" width="349.95" x="0.75un" y="8un"/>
- </widget>
- <widget name="logs_page_indicator" type="LogsPageIndicator">
- <sizehint type="PREFERRED" width="expr(4*var(hb-param-graphic-size-secondary))"/>
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
- </widget>
- <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <bool name="visible" value="FALSE"/>
- </widget>
- </section>
- <section name="landscape_dialpad">
- <widget name="logs_content" role="HbView:widget" type="HbWidget">
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="expr(var(hb-param-margin-view-right)+48un)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="qroupbox_container"/>
- <linearitem itemname="logs_list_view"/>
- </layout>
- </widget>
- <widget name="logs_label_empty_list" type="HbLabel">
- <rect height="26" name="geometry" width="312.75" x="0.75un" y="8un"/>
- </widget>
- <widget name="logs_page_indicator" type="LogsPageIndicator">
- <sizehint type="PREFERRED" width="expr(4*var(hb-param-graphic-size-secondary)+0.75un)"/>
- <contentsmargins bottom="0un" left="0un" right="0.75un" top="0un"/>
- </widget>
- <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <bool name="visible" value="FALSE"/>
- </widget>
- </section>
- <section name="default">
- <widget name="logs_content" role="HbView:widget" type="HbWidget">
- <layout orientation="Vertical" type="linear">
- <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
- <linearitem itemname="qroupbox_container"/>
- <linearitem itemname="logs_list_view"/>
- </layout>
- </widget>
- <widget name="logs_label_empty_list" type="HbLabel">
- <rect height="26.12959" name="geometry" width="349.95" x="0.75un" y="8un"/>
- </widget>
- <widget name="logs_page_indicator" type="LogsPageIndicator">
- <sizehint type="PREFERRED" width="expr(4*var(hb-param-graphic-size-secondary))"/>
- <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
- </widget>
- <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
- <bool name="visible" value="TRUE"/>
- </widget>
- </section>
-
<!-- Context menu -->
<widget name="logs_show_filter_menu" type="HbMenu">
- <integer name="timeout" value="5000000"/> <!-- 5 seconds timeout -->
- <enums name="dismissPolicy" value="TapAnywhere"/>
<ref object="logs_act_recent" role="HbMenu:addAction"/>
<ref object="logs_act_dialled" role="HbMenu:addAction"/>
<ref object="logs_act_received" role="HbMenu:addAction"/>
<ref object="logs_act_missed" role="HbMenu:addAction"/>
- </widget>
+ </widget>
<connect receiver="logs_recent_calls_view" sender="logs_act_video_call" signal="triggered(bool)" slot="videoCallToCurrentNum()"/>
<connect receiver="logs_recent_calls_view" sender="logs_act_create_message" signal="triggered(bool)" slot="sendMessageToCurrentNum()"/>
<connect receiver="logs_recent_calls_view" sender="logs_act_add_to_contacts" signal="triggered(bool)" slot="addToContacts()"/>
@@ -197,7 +124,43 @@
<connect receiver="logs_recent_calls_view" sender="logs_act_contacts" signal="triggered(bool)" slot="openContactsApp()"/>
<connect receiver="logs_recent_calls_view" sender="logs_act_show" signal="triggered(bool)" slot="showFilterMenu()"/>
<connect receiver="logs_recent_calls_view" sender="logs_show_filter_menu" signal="triggered(HbAction*)" slot="changeFilter(HbAction*)"/>
- <metadata activeUIState="Common ui state" display="QHD portrait" unit="un">
+ <section name="portrait_dialpad">
+ <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="logs_content" role="HbView:widget" type="HbWidget">
+ <contentsmargins bottom="expr(var(hb-param-screen-height)*0.55)" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-margin-view-right))" top="expr(var(hb-param-margin-view-top))"/>
+ </widget>
+ <widget name="logs_page_indicator" type="LogsPageIndicator">
+ <sizehint type="PREFERRED" width="expr(4*var(hb-param-graphic-size-secondary))"/>
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ </widget>
+ </section>
+ <section name="landscape_dialpad">
+ <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
+ <bool name="visible" value="FALSE"/>
+ </widget>
+ <widget name="logs_content" role="HbView:widget" type="HbWidget">
+ <contentsmargins bottom="expr(var(hb-param-margin-view-bottom))" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-screen-height)/2)" top="expr(var(hb-param-margin-view-top))"/>
+ </widget>
+ <widget name="logs_page_indicator" type="LogsPageIndicator">
+ <sizehint type="PREFERRED" width="expr(4*var(hb-param-graphic-size-secondary)+0.75un)"/>
+ <contentsmargins bottom="0un" left="0un" right="0.75un" top="0un"/>
+ </widget>
+ </section>
+ <section name="default">
+ <widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
+ <bool name="visible" value="TRUE"/>
+ </widget>
+ <widget name="logs_content" role="HbView:widget" type="HbWidget">
+ <contentsmargins bottom="expr(var(hb-param-margin-view-bottom))" left="expr(var(hb-param-margin-view-left))" right="expr(var(hb-param-margin-view-right))" top="expr(var(hb-param-margin-view-top))"/>
+ </widget>
+ <widget name="logs_page_indicator" type="LogsPageIndicator">
+ <sizehint type="PREFERRED" width="expr(4*var(hb-param-graphic-size-secondary))"/>
+ <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+ </widget>
+ </section>
+ <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
<uistate name="Common ui state" sections="#common"/>
<uistate name="portrait" sections="#common portrait_dialpad"/>
<uistate name="landscape" sections="#common landscape_dialpad"/>
--- a/logsui/logsapp/service_conf.xml Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/service_conf.xml Thu Jul 22 16:33:49 2010 +0100
@@ -1,7 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
-<service name="com.nokia.services.logsservices" filepath="must-not-be-empty" >
- <description>Logs services</description>
- <interface name="starter" version="1.0" capabilities="">
- <description>Starter interface</description>
+<service>
+ <name>logs</name>
+ <filepath>No path</filepath>
+ <description>Logs service</description>
+ <interface>
+ <name>com.nokia.symbian.ILogsView</name>
+ <version>1.0</version>
+ <description>Interface to open a view of logs application</description>
</interface>
-</service>
+ <interface>
+ <name>starter</name>
+ <version>1.0</version>
+ <description>Deprecated logs starter interface</description>
+ <customproperty key="deprecatedsn">com.nokia.services.logsservices</customproperty>
+ </interface>
+</service>
\ No newline at end of file
--- a/logsui/logsapp/src/logsbaseview.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/src/logsbaseview.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -42,14 +42,15 @@
#include <hblistview.h>
#include <QGraphicsLinearLayout>
#include <hbpushbutton.h>
-
+#include <hbactivitymanager.h>
+#include <hbmodeliterator.h>
+#include <hbscrollbar.h>
Q_DECLARE_METATYPE(LogsCall*)
Q_DECLARE_METATYPE(LogsMessage*)
Q_DECLARE_METATYPE(LogsContact*)
Q_DECLARE_METATYPE(LogsDetailsModel*)
-const int contextMenuTimeout = 5000000; //5 secs
// -----------------------------------------------------------------------------
//
@@ -70,14 +71,15 @@
mMessage(0),
mContact(0),
mDetailsModel(0),
- mCallTypeMapper(0)
+ mCallTypeMapper(0),
+ mOptionsMenu(0)
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::LogsBaseView()" );
+
+ setNavigationAction(new HbAction(Hb::BackNaviAction, this));
+ connect(navigationAction(), SIGNAL(triggered()), this,
+ SLOT(handleBackSoftkey()));
- mSoftKeyBackAction = new HbAction(Hb::BackNaviAction, this);
- connect(mSoftKeyBackAction, SIGNAL(triggered()), this,
- SLOT(handleBackSoftkey()));
-
mDialpad = mRepository.dialpad();
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::LogsBaseView()" );
@@ -96,6 +98,7 @@
delete mContact;
delete mDetailsModel;
delete mCallTypeMapper;
+ delete mOptionsMenu;
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::~LogsBaseView()" );
}
@@ -136,6 +139,51 @@
//
// -----------------------------------------------------------------------------
//
+void LogsBaseView::clearActivity(HbActivityManager& manager)
+{
+ foreach ( const QString& activity, mActivities ){
+ manager.removeActivity(activity);
+ }
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QString LogsBaseView::saveActivity(
+ QDataStream& serializedActivity, QVariantHash& metaData)
+{
+ Q_UNUSED( serializedActivity );
+ Q_UNUSED( metaData );
+ return mActivities.isEmpty() ? QString() : mActivities.at(0);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QVariant LogsBaseView::loadActivity(
+ const QString& activityId, QDataStream& serializedActivity, QVariantHash& metaData)
+{
+ Q_UNUSED( activityId );
+ Q_UNUSED( serializedActivity );
+ Q_UNUSED( metaData );
+ return QVariant();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+bool LogsBaseView::matchWithActivityId(const QString& activityId)
+{
+ return mActivities.contains(activityId);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
void LogsBaseView::activated(bool showDialer, QVariant args)
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::activated()" );
@@ -154,10 +202,6 @@
connect( &mDialpad->editor(), SIGNAL( contentsChanged() ), this,
SLOT( dialpadEditorTextChanged() ) );
- if ( navigationAction() != mSoftKeyBackAction ) {
- setNavigationAction(mSoftKeyBackAction);
- }
-
if (showDialer && !mDialpad->isOpen()) {
openDialpad();
}
@@ -237,8 +281,6 @@
mInitialized = true;
initFilterMenu();
addActionNamesToMap();
- connect(menu(), SIGNAL(aboutToShow()), this,
- SLOT(closeEmptyMenu()), Qt::QueuedConnection);
}
// -----------------------------------------------------------------------------
@@ -295,7 +337,7 @@
listView()->scrollTo( topIndex );
listView()->setCurrentIndex( topIndex, QItemSelectionModel::Select );
initiateCallback(topIndex);
- }
+ }
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::callKeyPressed()" );
}
@@ -325,32 +367,17 @@
}
// -----------------------------------------------------------------------------
-// LogsBaseView::closeEmptyMenu()
-// -----------------------------------------------------------------------------
-//
-void LogsBaseView::closeEmptyMenu()
-{
- bool visibleActionsExist = false;
- foreach (QAction* action, menu()->actions()) {
- if (action->isVisible()) {
- visibleActionsExist = true ;
- }
- }
-
- if (!visibleActionsExist) {
- menu()->close();
- }
-}
-// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
void LogsBaseView::openDialpad()
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::openDialpad()" );
+
updateCallButton();
setDialpadPosition();
mDialpad->openDialpad();
+
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::openDialpad()" );
}
@@ -361,13 +388,12 @@
void LogsBaseView::openContactsApp()
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::openContactsApp()" );
-
- // Need to do request in async manner, otherwise new phonebook ui process
- // will be started due bug(?) in highway.
- XQServiceRequest snd("com.nokia.services.phonebookappservices.Launch","launch()", false);
+ XQServiceRequest snd("com.nokia.services.phonebookappservices.Launch","launch()");
+ XQRequestInfo info;
+ info.setForeground(true);
+ snd.setInfo(info);
int retValue;
snd.send(retValue);
-
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::openContactsApp()" );
}
@@ -378,25 +404,21 @@
void LogsBaseView::setDialpadPosition()
{
HbMainWindow& window = mViewManager.mainWindow();
- // layoutrect broken, fix will be in MCL wk14, use workaround meanwhile
- //QRectF screenRect = window.layoutRect();
- QRectF screenRect = (window.orientation() == Qt::Horizontal) ?
- QRectF(0,0,640,360) : QRectF(0,0,360,640);
-
+ QRectF screenRect = window.layoutRect();
LOGS_QDEBUG_2( "logs [UI] -> LogsBaseView::setDialpadPosition(), screenRect:",
screenRect );
if (window.orientation() == Qt::Horizontal) {
// dialpad takes half of the screen width
mDialpad->setPos(QPointF(screenRect.width()/2,
- this->scenePos().y()));
+ scenePos().y()));
mDialpad->setPreferredSize(screenRect.width()/2,
- (screenRect.height()-scenePos().y()));
+ (screenRect.height()-scenePos().y()));
} else {
- // dialpad takes 65% of the screen height
+ // dialpad takes 55% of the screen height
qreal screenHeight = screenRect.height();
- mDialpad->setPos(QPointF(0, screenHeight/2.25));
+ mDialpad->setPos(QPointF(0, screenHeight*0.45));
mDialpad->setPreferredSize(screenRect.width(),
- screenHeight-screenHeight/2.25);
+ screenHeight*0.55);
}
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::setDialpadPosition()" );
}
@@ -498,7 +520,6 @@
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::showListItemMenu()" );
HbMenu* itemContextMenu = new HbMenu();
itemContextMenu->setDismissPolicy(HbMenu::TapAnywhere);
- itemContextMenu->setTimeout(contextMenuTimeout);
itemContextMenu->setAttribute(Qt::WA_DeleteOnClose);
updateListItemData(item->modelIndex());
@@ -510,17 +531,6 @@
if (itemContextMenu->actions().count() > 0) {
itemContextMenu->setPreferredPos(coords,HbPopup::TopLeftCorner);
itemContextMenu->open();
- //TODO:
- //the hack below is needed since otherwise listbox will get mouse event
- //and "activated" signal will be emitted (=>initiateCallback() called)
- //Remove it, when something is done in platform code for that
- if (scene()) {
- QGraphicsItem *item = scene()->mouseGrabberItem();
- if (item) {
- LOGS_QDEBUG( "logs [UI] -> LogsBaseView::showListItemMenu() ungrabbing the mouse" );
- item->ungrabMouse();
- }
- }
}
}
@@ -715,15 +725,15 @@
new HbLabel(hbTrId("txt_dial_title_add_to_contacts"), popup));
popup->setAttribute(Qt::WA_DeleteOnClose);
popup->setTimeout( HbPopup::NoTimeout );
- popup->setSecondaryAction(
- new HbAction(hbTrId("txt_dial_button_cancel"), popup));
+ popup->addAction(
+ 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()));
@@ -731,7 +741,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()),
@@ -1006,7 +1016,7 @@
// Loads appropriate section from *.docml to resize list widget
// -----------------------------------------------------------------------------
//
-void LogsBaseView::updateListSize()
+void LogsBaseView::updateListSize( HbListView& list )
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::updateListSize()" );
QString newSection( logsViewDefaultSection );
@@ -1022,10 +1032,13 @@
newSection = QString( logsViewDefaultSection );
}
- if (newSection != mLayoutSectionName) {
- mLayoutSectionName = newSection;
- LOGS_QDEBUG_2( "logs [UI] loading new section: ", newSection );
- mRepository.loadSection( viewId(), newSection );
+ bool sectionChanged( mLayoutSectionName != newSection );
+ mLayoutSectionName = newSection;
+ LOGS_QDEBUG_2( "logs [UI] loading new section: ", newSection );
+ mRepository.loadSection( viewId(), newSection );
+
+ if ( sectionChanged ){
+ ensureListPositioning( list );
}
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::updateListSize()" );
@@ -1037,7 +1050,7 @@
//
void LogsBaseView::handleOrientationChanged()
{
- LOGS_QDEBUG( "logs [UI] -> LogsBaseView::handleOrientationChanged()!" );
+ LOGS_QDEBUG( "logs [UI] -> LogsBaseView::handleOrientationChanged()" );
setDialpadPosition();
updateWidgetsSizeAndLayout();
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::handleOrientationChanged()");
@@ -1061,20 +1074,28 @@
void LogsBaseView::askConfirmation( QString heading , QString text,
QObject* receiver, const char* okSlot, const char* cancelSlot )
{
+ LOGS_QDEBUG( "logs [UI] -> LogsBaseView::askConfirmation()" );
HbMessageBox* note = new HbMessageBox(text, HbMessageBox::MessageTypeQuestion);
note->setAttribute(Qt::WA_DeleteOnClose);
- note->setHeadingWidget(new HbLabel( heading ));
- //note->setText( text );
- note->setPrimaryAction(new HbAction(hbTrId("txt_common_button_ok"), note));
- note->setSecondaryAction(new HbAction(hbTrId("txt_common_button_cancel"), note));
-
- if (receiver && okSlot) {
- connect(note->primaryAction(), SIGNAL(triggered()), receiver, okSlot);
+ note->setHeadingWidget(new HbLabel(heading));
+ note->setDismissPolicy(HbPopup::TapOutside);
+
+ if (note->actions().count() > 0 && note->actions().at(0)) {
+ note->actions().at(0)->setText(hbTrId("txt_common_button_ok"));
+
+ if (receiver && okSlot) {
+ connect(note->actions().at(0), SIGNAL(triggered()), receiver, okSlot);
+ }
}
- if (receiver && cancelSlot) {
- connect(note->secondaryAction(), SIGNAL(triggered()), receiver, cancelSlot);
+ if (note->actions().count() > 1 && note->actions().at(1)) {
+ note->actions().at(1)->setText(hbTrId("txt_common_button_cancel"));
+
+ if (receiver && cancelSlot) {
+ connect(note->actions().at(1), SIGNAL(triggered()), receiver, cancelSlot);
+ }
}
note->open();
+ LOGS_QDEBUG( "logs [UI] <- LogsBaseView::askConfirmation()" );
}
// -----------------------------------------------------------------------------
@@ -1090,11 +1111,9 @@
if ( isContactSearchPermanentlyDisabled() ){
contactSearchAction->setVisible(false);
} else if ( isContactSearchEnabled() ){
- contactSearchAction->setIconText("Contact search off");
contactSearchAction->setText(hbTrId("txt_dialer_ui_opt_contact_search_off"));
contactSearchAction->setVisible(mDialpad->isOpen());
} else {
- contactSearchAction->setIconText("Contact search on");
contactSearchAction->setText(hbTrId("txt_dialer_ui_opt_contact_search_on"));
contactSearchAction->setVisible(mDialpad->isOpen());
}
@@ -1168,3 +1187,87 @@
return ( mDialpad->isOpen() && !mDialpad->editor().text().isEmpty() );
}
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsBaseView::ensureListPositioning( HbListView& list )
+{
+ LOGS_QDEBUG( "logs [UI] -> LogsBaseView::ensureListPositioning()" );
+
+ HbWidget* content =
+ qobject_cast<HbWidget*>( mRepository.findWidget( logsContentId ) );
+ QList<HbAbstractViewItem *> visibleItems = list.visibleItems();
+ if ( content && visibleItems.count() > 0 ){
+ LOGS_QDEBUG_2( "logs [UI] contentsRect:", content->contentsRect() );
+ QRectF rect = content->contentsRect();
+ rect.adjust( 0, list.pos().y(), 0, -list.pos().y() );
+ LOGS_QDEBUG_2( "logs [UI] listRect:", rect );
+ list.setGeometry(rect);
+
+ HbScrollArea::ScrollBarPolicy prevPolicy = list.verticalScrollBarPolicy();
+ list.setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff);
+ list.setVerticalScrollBarPolicy(prevPolicy);
+
+ qreal itemHeight = visibleItems.at(0)->size().height();
+ HbModelIterator* modelIt = list.modelIterator();
+ if ( modelIt && itemHeight > 0 ) {
+ int maxVisibleItems = rect.height() / itemHeight;
+ LOGS_QDEBUG_2( "logs [UI] max visible items:", maxVisibleItems );
+ if ( modelIt->indexCount() <= maxVisibleItems ){
+ // All items can fit the rect reserved for the list, force them to fit
+ list.ensureVisible(QPointF(0,0));
+ } else if ( visibleItems.count() < maxVisibleItems ) {
+ // All items cannot fit the rect reserved, force to reserve whole
+ // area so that current index is tried to be centered
+ list.scrollTo(list.currentIndex(), HbAbstractItemView::PositionAtCenter);
+ }
+ }
+ }
+ LOGS_QDEBUG( "logs [UI] <- LogsBaseView::ensureListPositioning()" );
+}
+
+// -----------------------------------------------------------------------------
+// LogsBaseView::scrollToTopItem
+// -----------------------------------------------------------------------------
+//
+void LogsBaseView::scrollToTopItem( HbListView* list )
+{
+ LOGS_QDEBUG( "logs [UI] -> LogsBaseView::scrollToTopItem()" );
+
+ if ( list && list->verticalScrollBar() ){
+ list->verticalScrollBar()->setValue(0.0);
+ }
+
+ LOGS_QDEBUG( "logs [UI] <- LogsBaseView::scrollToTopItem()" );
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsBaseView::updateMenuVisibility()
+{
+ bool visibleActionsExist = false;
+ HbMenu* optionsMenu = mOptionsMenu ? mOptionsMenu : menu();
+ foreach (QAction* action, optionsMenu->actions()) {
+ if (action->isVisible()) {
+ visibleActionsExist = true;
+ }
+ }
+ setMenuVisible(visibleActionsExist);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsBaseView::setMenuVisible(bool visible)
+{
+ if (!visible && !mOptionsMenu) {
+ mOptionsMenu = takeMenu();
+ } else if (visible && mOptionsMenu) {
+ setMenu(mOptionsMenu);
+ mOptionsMenu = 0;
+ }
+}
--- a/logsui/logsapp/src/logscomponentrepository.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/src/logscomponentrepository.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -29,23 +29,30 @@
#include <dialpad.h>
#include <dialpadkeyhandler.h>
#include <hbtoolbar.h>
+#include <hbmainwindow.h>
+#include <QTimer>
+
+const int logsRepositoryLazyInitTimerMsec = 3000;
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
LogsComponentRepository::LogsComponentRepository(LogsAbstractViewManager& viewManager)
- : HbDocumentLoader(),
+ : QObject(),
+ HbDocumentLoader(),
mViewManager(viewManager),
mRecentCallsView(0),
mDetailsView(0),
mMatchesView(0),
mDialpad(0),
- mDialpadKeyHandler(0)
+ mDialpadKeyHandler(0),
+ mCurrentObjectTree(0)
{
- bool resourceControl = true;
- mModel = new LogsModel(LogsModel::LogsRecentModel, resourceControl);
+ mModel = new LogsModel(LogsModel::LogsRecentModel, ETrue);
+ QTimer::singleShot(logsRepositoryLazyInitTimerMsec, this, SLOT(lazyInit()));
}
+
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
@@ -85,22 +92,16 @@
//
// -----------------------------------------------------------------------------
//
-LogsRecentCallsView* LogsComponentRepository::recentCallsView()
+LogsRecentCallsView* LogsComponentRepository::recentCallsView(bool onlyInit)
{
LOGS_QDEBUG( "logs [UI] -> LogsComponentRepository::recentCallsView()" );
- setObjectTreeToView( LogsRecentViewId );
if ( !mRecentCallsView ) {
- bool ok = false;
- mRecentViewComponents = load( logsRecentCallsViewFile, &ok );
- if ( ok ) {
- mRecentCallsView = qobject_cast<LogsRecentCallsView*>
- ( findWidget(logsRecentCallsViewId) );
-
- addToolbarToObjectList(mRecentViewComponents);
- } else {
- LOGS_QCRITICAL( "logs [UI] XML loading failed..." );
- }
+ mRecentCallsView = qobject_cast<LogsRecentCallsView*>(doLoadView(
+ logsRecentCallsViewFile, logsRecentCallsViewId,
+ mRecentViewComponents, LogsRecentViewId, onlyInit));
+ } else if ( !onlyInit ){
+ setObjectTreeToView( LogsRecentViewId );
}
LOGS_QDEBUG( "logs [UI] <- LogsComponentRepository::recentCallsView()" );
@@ -111,23 +112,18 @@
//
// -----------------------------------------------------------------------------
//
-LogsDetailsView* LogsComponentRepository::detailsView()
+LogsDetailsView* LogsComponentRepository::detailsView(bool onlyInit)
{
- LOGS_QDEBUG( "logs [UI] -> LogsComponentRepository::detailsView()" );
- setObjectTreeToView( LogsDetailsViewId );
-
+ LOGS_QDEBUG( "logs [UI] -> LogsComponentRepository::detailsView()" );
+
if ( !mDetailsView ) {
- bool ok = false;
- mDetailsViewComponents = load( logsDetailsViewFile, &ok );
- if ( ok ) {
- mDetailsView = qobject_cast<LogsDetailsView*>
- ( findWidget(logsDetailsViewId) );
-
- addToolbarToObjectList(mDetailsViewComponents);
- } else {
- LOGS_QCRITICAL( "logs [UI] XML loading failed..." );
- }
+ mDetailsView = qobject_cast<LogsDetailsView*>(doLoadView(
+ logsDetailsViewFile, logsDetailsViewId,
+ mDetailsViewComponents, LogsDetailsViewId, onlyInit));
+ } else if ( !onlyInit ){
+ setObjectTreeToView( LogsDetailsViewId );
}
+
LOGS_QDEBUG( "logs [UI] -> LogsComponentRepository::detailsView()" );
return mDetailsView;
}
@@ -136,22 +132,16 @@
//
// -----------------------------------------------------------------------------
//
-LogsMatchesView* LogsComponentRepository::matchesView()
+LogsMatchesView* LogsComponentRepository::matchesView(bool onlyInit)
{
LOGS_QDEBUG( "logs [UI] -> LogsComponentRepository::matchedCallsView()" );
- setObjectTreeToView( LogsMatchesViewId );
if ( !mMatchesView ) {
- bool ok = false;
- mMatchesViewComponents = load( logsMatchedCallsViewFile, &ok );
- if ( ok ) {
- mMatchesView = qobject_cast<LogsMatchesView*>
- ( findWidget(logsMatchesViewId) );
-
- addToolbarToObjectList(mMatchesViewComponents);
- } else {
- LOGS_QCRITICAL( "logs [UI] XML loading failed..." );
- }
+ mMatchesView = qobject_cast<LogsMatchesView*>(doLoadView(
+ logsMatchedCallsViewFile, logsMatchesViewId,
+ mMatchesViewComponents, LogsMatchesViewId, onlyInit));
+ } else if ( !onlyInit ){
+ setObjectTreeToView( LogsMatchesViewId );
}
LOGS_QDEBUG( "logs [UI] <- LogsComponentRepository::matchedCallsView()" );
@@ -188,12 +178,17 @@
void LogsComponentRepository::setObjectTreeToView( LogsAppViewId viewId )
{
reset();
+ QObjectList* objTree = 0;
if ( viewId == LogsRecentViewId ) {
- setObjectTree( mRecentViewComponents );
+ objTree = &mRecentViewComponents;
} else if ( viewId == LogsDetailsViewId ) {
- setObjectTree( mDetailsViewComponents );
+ objTree = &mDetailsViewComponents;
} else if ( viewId == LogsMatchesViewId ) {
- setObjectTree( mMatchesViewComponents );
+ objTree = &mMatchesViewComponents;
+ }
+ if ( objTree ){
+ setObjectTree( *objTree );
+ mCurrentObjectTree = objTree;
}
}
@@ -259,3 +254,43 @@
return ok;
}
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsComponentRepository::lazyInit()
+{
+ mModel->refreshData();
+ recentCallsView(true);
+ detailsView(true);
+ matchesView(true);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QGraphicsWidget* LogsComponentRepository::doLoadView(
+ const QString &fileName, const QString &viewName,
+ QObjectList& viewComponents, LogsAppViewId viewId, bool onlyInit)
+{
+ QObjectList* prevObjectTree = mCurrentObjectTree;
+ setObjectTreeToView( viewId );
+
+ QGraphicsWidget* view = 0;
+ bool ok = false;
+ viewComponents = load( fileName, &ok );
+ if ( ok ) {
+ view = findWidget(viewName);
+ addToolbarToObjectList(viewComponents);
+ } else {
+ LOGS_QCRITICAL( "logs [UI] XML loading failed..." );
+ }
+
+ if ( onlyInit && prevObjectTree ){
+ LOGS_QDEBUG( "logs [UI] set back previous object tree" )
+ mCurrentObjectTree = prevObjectTree;
+ setObjectTree( *mCurrentObjectTree );
+ }
+ return view;
+}
--- a/logsui/logsapp/src/logsdetailsview.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/src/logsdetailsview.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -23,6 +23,7 @@
#include "logsabstractviewmanager.h"
#include "logsdefs.h"
#include "logscontact.h"
+#include "logsmodel.h"
//SYSTEM
#include <hblistview.h>
@@ -50,6 +51,8 @@
//TODO: taking away due to toolbar bug. If toolbar visibility changes on view
//activation, there will be a crash due to previous view effect is playing
//addViewSwitchingEffects();
+
+ mActivities.append( logsActivityIdViewDetails );
}
// -----------------------------------------------------------------------------
@@ -94,6 +97,8 @@
updateMenu();
+ scrollToTopItem(mListView);
+
LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::activated()" );
}
@@ -113,15 +118,44 @@
}
// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QString LogsDetailsView::saveActivity(
+ QDataStream& serializedActivity, QVariantHash& metaData)
+{
+ if ( mDetailsModel ){
+ mDetailsModel->getLogsEvent().serialize(serializedActivity);
+ }
+ return LogsBaseView::saveActivity(serializedActivity, metaData);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QVariant LogsDetailsView::loadActivity(
+ const QString& activityId, QDataStream& serializedActivity, QVariantHash& metaData)
+{
+ Q_UNUSED( activityId );
+ Q_UNUSED( metaData );
+ LogsEvent event(serializedActivity);
+ LogsDetailsModel* details = mRepository.model()->logsDetailsModel(event);
+ return qVariantFromValue( details );
+}
+
+// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
void LogsDetailsView::callKeyPressed()
{
LOGS_QDEBUG( "logs [UI] -> LogsDetailsView::callKeyPressed()" );
+
if ( !tryCallToDialpadNumber() && mCall ){
mCall->initiateCallback();
}
+
LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::callKeyPressed()" );
}
@@ -358,7 +392,7 @@
if ( mListView ) {
updateMenu();
updateListLayoutName(*mListView, true);
- updateListSize();
+ updateListSize(*mListView);
}
LOGS_QDEBUG( "logs [UI] <- LogsDetailsView::updateWidgetsSizeAndLayout()" );
}
--- a/logsui/logsapp/src/logseffecthandler.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/src/logseffecthandler.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -31,6 +31,7 @@
const int logsMoveNotPossibleAmount = 30;
const int logsDissappearByMovingIndex = 0;
+const int logsPauseBetweenDissappearAndAppearIndex = 1;
const int logsAppearByMovingIndex = 2;
// -----------------------------------------------------------------------------
@@ -72,6 +73,7 @@
connect(mMoveGroup, SIGNAL(currentAnimationChanged(QAbstractAnimation *)),
this, SLOT( moveAnimationChanged(QAbstractAnimation *)));
+ connect(mMoveGroup, SIGNAL(finished()), this, SIGNAL(appearByMovingComplete()) );
connect(mFadeGroup, SIGNAL(currentAnimationChanged(QAbstractAnimation *)),
this, SLOT( fadeAnimationChanged(QAbstractAnimation *)));
@@ -101,7 +103,8 @@
//
void LogsEffectHandler::moveAnimationChanged(QAbstractAnimation *currentAnimation)
{
- if ( mMoveGroup->indexOfAnimation(currentAnimation) == 1 ) {
+ int indexOfAnimation = mMoveGroup->indexOfAnimation(currentAnimation);
+ if (indexOfAnimation == logsPauseBetweenDissappearAndAppearIndex ) {
emit dissappearByMovingComplete();
}
}
@@ -112,7 +115,8 @@
//
void LogsEffectHandler::fadeAnimationChanged(QAbstractAnimation *currentAnimation)
{
- if ( mFadeGroup->indexOfAnimation(currentAnimation) == 1 ) {
+ int indexOfAnimation = mFadeGroup->indexOfAnimation(currentAnimation);
+ if ( indexOfAnimation == logsPauseBetweenDissappearAndAppearIndex ) {
emit dissappearByFadingComplete();
}
}
@@ -137,12 +141,13 @@
//
void LogsEffectHandler::startDissappearAppearByMovingEffect(
QObject& effectTarget, QObject& secondaryEffectTarget,
- bool dissappearToLeft, int origX)
+ bool dissappearToLeft, int origX, int secondaryOrigX)
{
doStartDissappearAppearByMovingEffect(
*mMoveGroup, effectTarget, dissappearToLeft, origX);
+
doStartDissappearAppearByMovingEffect(
- *mMoveGroup2, secondaryEffectTarget, dissappearToLeft, origX);
+ *mMoveGroup2, secondaryEffectTarget, dissappearToLeft, secondaryOrigX);
}
// -----------------------------------------------------------------------------
--- a/logsui/logsapp/src/logsmainwindow.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/src/logsmainwindow.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -17,7 +17,6 @@
#include "logsmainwindow.h"
#include "logslogger.h"
-#include "logsforegroundwatcher.h"
#include <QKeyEvent>
#include <xqserviceutil.h>
@@ -27,12 +26,6 @@
//
LogsMainWindow::LogsMainWindow() : HbMainWindow(), mForeground(false)
{
- if ( viewport() ){
- viewport()->grabGesture(Qt::SwipeGesture);
- }
- mWatcher = new LogsForegroundWatcher(this);
- connect( mWatcher, SIGNAL(losingForeground()), this, SIGNAL(appFocusLost()) );
- connect( mWatcher, SIGNAL(gainingForeground()), this, SIGNAL(appFocusGained()) );
}
// -----------------------------------------------------------------------------
@@ -41,9 +34,6 @@
//
LogsMainWindow::~LogsMainWindow()
{
- if ( viewport() ){
- viewport()->ungrabGesture(Qt::SwipeGesture);
- }
}
// -----------------------------------------------------------------------------
--- a/logsui/logsapp/src/logsmatchesview.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/src/logsmatchesview.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -45,9 +45,12 @@
: LogsBaseView(LogsMatchesViewId, repository, viewManager),
mListView(0),
mModel(0),
- mAddToContactsButton(0)
+ mAddToContactsButton(0),
+ mAddToContactsButtonDisabled(false)
{
LOGS_QDEBUG( "logs [UI] <-> LogsMatchesView::LogsMatchesView()" );
+
+ mActivities.append( logsActivityIdViewMatches );
}
// -----------------------------------------------------------------------------
@@ -67,7 +70,10 @@
//
void LogsMatchesView::activated(bool showDialer, QVariant args)
{
- //base class handling first
+ // Disable add to contacts button handling while view is activated
+ // to avoid unnecessary quick appear/dissappear of it.
+ mAddToContactsButtonDisabled = true;
+
LogsBaseView::activated(showDialer, args);
LogsMatchesModel* model = qVariantValue<LogsMatchesModel*>(args);
@@ -75,6 +81,10 @@
dialpadEditorTextChanged();
activateEmptyListIndicator(mModel);
+
+ scrollToTopItem(mListView);
+
+ mAddToContactsButtonDisabled = false;
}
// -----------------------------------------------------------------------------
@@ -188,8 +198,9 @@
void LogsMatchesView::handleBackSoftkey()
{
LOGS_QDEBUG( "logs [UI] -> LogsMatchesView::::handleBackSoftkey()" );
-
+ mDialpad->editor().blockSignals(true);
mDialpad->editor().setText(QString());
+ mDialpad->editor().blockSignals(false);
if (mDialpad->isOpen()){
LOGS_QDEBUG( "logs [UI] -> LogsMatchesView::::handleBackSoftkey() closeDialpad" );
@@ -199,7 +210,7 @@
mDialpad->closeDialpad();
mDialpad->blockSignals(false);
}
-
+
LogsBaseView::handleBackSoftkey();
LOGS_QDEBUG( "logs [UI] <- LogsMatchesView::::handleBackSoftkey()" );
@@ -211,16 +222,18 @@
//
void LogsMatchesView::dialpadEditorTextChanged()
{
+ LOGS_QDEBUG( "logs [UI] -> LogsMatchesView::::dialpadEditorTextChanged()" );
updateCallButton();
updateMenu();
QString pattern = mDialpad->editor().text();
if ( pattern.isEmpty() ){
- // Treat empty input field same was as back press
+ // Treat empty input field same way as back press
LogsBaseView::handleBackSoftkey();
} else if ( mModel ) {
mModel->logsMatches( pattern );
}
+ LOGS_QDEBUG_2( "logs [UI] <- LogsMatchesView::::dialpadEditorTextChanged(), text: ", pattern );
}
// -----------------------------------------------------------------------------
@@ -255,7 +268,7 @@
if ( mListView ) {
updateMenu();
updateListLayoutName(*mListView);
- updateListSize();
+ updateListSize(*mListView);
}
LOGS_QDEBUG( "logs [UI] <- LogsMatchesView::updateWidgetsSizeAndLayout()" );
}
@@ -293,9 +306,9 @@
{
LOGS_QDEBUG( "logs [UI] -> LogsMatchesView::updateMenu()" );
- updateDialpadCallAndMessagingActions();
-
+ updateDialpadCallAndMessagingActions();
updateContactSearchAction();
+ updateMenuVisibility();
LOGS_QDEBUG( "logs [UI] <- LogsMatchesView::updateMenu()" );
}
@@ -309,6 +322,7 @@
if (mAddToContactsButton) {
LOGS_QDEBUG( "logs [UI] <-> LogsMatchesView::updateAddContactButton()" );
bool matchesFound(model() && (model()->rowCount() > 0));
- mAddToContactsButton->setVisible(!matchesFound && isDialpadInput());
+ mAddToContactsButton->setVisible(
+ !mAddToContactsButtonDisabled && !matchesFound && isDialpadInput() );
}
}
--- a/logsui/logsapp/src/logspageindicatoritem.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/src/logspageindicatoritem.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -17,12 +17,14 @@
#include <QGraphicsColorizeEffect>
#include <QPropertyAnimation>
-
+#include <hbcolorscheme.h>
+#include <hbevent.h>
#include "logspageindicatoritem.h"
+#include "logslogger.h"
-
-const char logsNormalIconName[] = "qtg_graf_hspage_normal";//"qtg_mono_tab_passive";//
-const char logsHighlightIconName[] = "qtg_graf_hspage_highlight";//"qtg_mono_tab_active";//
+const char logsNormalIconName[] = "qtg_mono_tab_passive";
+const char logsHighlightIconName[] = "qtg_mono_tab_active";
+const char logsIconColor[] = "qtc_viewtitle_normal"; //groupbox text color
const int logsEffectDurationInMs = 1000;
@@ -40,6 +42,9 @@
setIcon(HbIcon(logsNormalIconName));
}
+ setFlags(HbIcon::Colorized);
+ updateColor();
+
QGraphicsColorizeEffect *effect = new QGraphicsColorizeEffect;
effect->setColor(Qt::white);
effect->setStrength(0);
@@ -68,6 +73,7 @@
startAnimation();
} else {
setIcon(HbIcon(logsNormalIconName));
+ updateColor();
}
}
}
@@ -85,6 +91,32 @@
//
// -----------------------------------------------------------------------------
//
+void LogsPageIndicatorItem::changeEvent(QEvent * event)
+{
+ if (event->type() == HbEvent::ThemeChanged) {
+ LOGS_QDEBUG( "logs [UI] LogsPageIndicatorItem::changeEvent(), themeChanged" );
+ updateColor();
+ }
+ HbIconItem::changeEvent(event);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsPageIndicatorItem::updateColor()
+{
+ QColor col = HbColorScheme::color(logsIconColor);
+ if (col.isValid() && (color() != col) ) {
+ setColor(col);
+ LOGS_QDEBUG_2( "logs [UI] LogsPageIndicatorItem::updateColor(), color: ", col );
+ }
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
void LogsPageIndicatorItem::startAnimation()
{
graphicsEffect()->setEnabled(true);
@@ -105,4 +137,5 @@
void LogsPageIndicatorItem::animationFinished()
{
graphicsEffect()->setEnabled(false);
+ updateColor();
}
--- a/logsui/logsapp/src/logsrecentcallsview.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/src/logsrecentcallsview.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -42,12 +42,13 @@
#include <hbgroupbox.h>
#include <hbmessagebox.h>
#include <hbmainwindow.h>
+#include <hbswipegesture.h>
#include <QTimer>
+#include <hbactivitymanager.h>
Q_DECLARE_METATYPE(LogsMatchesModel*)
const int logsMissedCallsMarkingDelayMs = 1000;
-const int logsSwipeAngleDelta = 30; // angle is from 0 to 360
// -----------------------------------------------------------------------------
// LogsRecentCallsView::LogsRecentCallsView
@@ -64,10 +65,12 @@
mMoveLeftInList(false),
mEffectHandler(0),
mListViewX(0),
+ mEmptyListLabelX(0),
mMatchesModel(0),
mMarkingMissedAsSeen(false),
mPageIndicator(0),
- mResetted(false)
+ mFirstActivation(true),
+ mListScrollBarPolicy(HbScrollArea::ScrollBarAutoHide)
{
LOGS_QDEBUG( "logs [UI] <-> LogsRecentCallsView::LogsRecentCallsView()" );
mModel = mRepository.model();
@@ -75,6 +78,13 @@
//TODO: taking away due to toolbar bug. If toolbar visibility changes on view
//activation, there will be a crash due to previous view effect is playing
//addViewSwitchingEffects();
+
+ // Important to add in the same order as mCurrentView enums as correct
+ // activity id is taken directly from the array based on the enum
+ mActivities.append( logsActivityIdViewRecent );
+ mActivities.append( logsActivityIdViewReceived );
+ mActivities.append( logsActivityIdViewCalled );
+ mActivities.append( logsActivityIdViewMissed );
}
// -----------------------------------------------------------------------------
@@ -105,7 +115,11 @@
// base class handling first
LogsBaseView::activated(showDialer, args);
- LogsServices::LogsView view = static_cast<LogsServices::LogsView>( args.toInt() );
+ int internalViewId = args.toInt();
+ if ( internalViewId < 0 || internalViewId > LogsServices::ViewMissed ){
+ internalViewId = LogsServices::ViewAll;
+ }
+ LogsServices::LogsView view = static_cast<LogsServices::LogsView>( internalViewId );
// View update is needed when we activate view for the first time (!mFilter)
// or if view has to be changed
@@ -115,14 +129,13 @@
activateEmptyListIndicator(mFilter);
mPageIndicator->setActiveItemIndex(mConversionMap.value(mCurrentView));
+
+ mFirstActivation = false;
- if ( mResetted ){
- // After reset, first data addition should cause scrolling to topitem
- connect( mFilter, SIGNAL(rowsInserted(const QModelIndex&,int,int)),
- this, SLOT(scrollToTopItem()) );
- mResetted = false;
+ if (mEmptyListLabel) {
+ mEmptyListLabelX = mEmptyListLabel->pos().x();
}
-
+
LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::activated()" );
}
@@ -161,15 +174,31 @@
//
// -----------------------------------------------------------------------------
//
-void LogsRecentCallsView::resetView()
+QString LogsRecentCallsView::saveActivity(
+ QDataStream& serializedActivity, QVariantHash& metaData)
{
- LOGS_QDEBUG( "logs [UI] -> LogsRecentCallsView::resetView()" );
- LogsBaseView::resetView();
- mResetted = true;
- LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::resetView()" );
+ Q_UNUSED( serializedActivity );
+ Q_UNUSED( metaData );
+ if ( mCurrentView >= 0 && mCurrentView < mActivities.count() ){
+ return mActivities.at( mCurrentView );
+ }
+ return QString();
}
// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QVariant LogsRecentCallsView::loadActivity(
+ const QString& activityId, QDataStream& serializedActivity, QVariantHash& metaData)
+{
+ Q_UNUSED( serializedActivity );
+ Q_UNUSED( metaData );
+ return mActivities.indexOf(activityId);
+}
+
+
+// -----------------------------------------------------------------------------
// LogsRecentCallsView::initView
// -----------------------------------------------------------------------------
//
@@ -190,7 +219,8 @@
this, SLOT(dissappearByMovingComplete()));
connect(mEffectHandler, SIGNAL(dissappearByFadingComplete()),
this, SLOT(dissappearByFadingComplete()));
-
+ connect(mEffectHandler, SIGNAL(appearByMovingComplete()),
+ this, SLOT(appearByMovingComplete()));
mPageIndicator = qobject_cast<LogsPageIndicator*>
(mRepository.findWidget(logsPageIndicatorId));
@@ -412,12 +442,13 @@
this,
SLOT(showListItemMenu(HbAbstractViewItem*, const QPointF&)));
- mListView->setScrollingStyle(HbScrollArea::PanOrFlick);
mListView->setFrictionEnabled(true);
mListViewX = mListView->pos().x();
grabGesture(Qt::SwipeGesture);
+
+ mListScrollBarPolicy = mListView->verticalScrollBarPolicy();
LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::initListWidget() " );
}
@@ -442,7 +473,7 @@
mListView->setModel( mFilter );//ownership not transferred
- scrollToTopItem();
+ scrollToTopItem(mListView);
activateEmptyListIndicator(mFilter);
@@ -514,55 +545,25 @@
{
QGesture* gesture = event->gesture(Qt::SwipeGesture);
if (gesture) {
- QSwipeGesture* swipe = static_cast<QSwipeGesture *>(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<HbSwipeGesture *>(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
// -----------------------------------------------------------------------------
//
@@ -577,7 +578,8 @@
if (model() && model()->rowCount() > 0) {
mEffectHandler->startMoveNotPossibleEffect(*mListView, false, mListViewX);
} else {
- mEffectHandler->startMoveNotPossibleEffect(*mEmptyListLabel, false, mListViewX);
+ mEffectHandler->startMoveNotPossibleEffect(*mEmptyListLabel,
+ false, mEmptyListLabelX);
}
}
LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::leftFlick()" );
@@ -598,7 +600,8 @@
if (model() && model()->rowCount() > 0) {
mEffectHandler->startMoveNotPossibleEffect(*mListView, true, mListViewX);
} else {
- mEffectHandler->startMoveNotPossibleEffect(*mEmptyListLabel, true, mListViewX);
+ mEffectHandler->startMoveNotPossibleEffect(*mEmptyListLabel,
+ true, mEmptyListLabelX);
}
}
LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::rightFlick()" );
@@ -621,11 +624,13 @@
}
mMoveLeftInList = mConversionMap.value(view) < mConversionMap.value(mCurrentView);
-
mAppearingView = view;
+ // Disable scrollbar while moving the list for more nice looks
+ mListView->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff);
mEffectHandler->startDissappearAppearByFadingEffect(*mViewName);
mEffectHandler->startDissappearAppearByMovingEffect(
- *mListView, *mEmptyListLabel, !mMoveLeftInList, mListViewX);
+ *mListView, *mEmptyListLabel, !mMoveLeftInList,
+ mListViewX, mEmptyListLabelX);
mPageIndicator->setActiveItemIndex(mConversionMap.value(mAppearingView));
@@ -655,11 +660,26 @@
{
LOGS_QDEBUG( "logs [UI] -> LogsRecentCallsView::dissappearByMovingComplete()" )
- updateView( mAppearingView );
+ updateView( mAppearingView );
LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::dissappearByMovingComplete()" )
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsRecentCallsView::appearByMovingComplete()
+{
+ LOGS_QDEBUG( "logs [UI] -> LogsRecentCallsView::appearByMovingComplete()" )
+
+ // Restore scrollbar which was hidden when animation started
+ mListView->setVerticalScrollBarPolicy(mListScrollBarPolicy);
+
+ LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::appearByMovingComplete()" )
+}
+
// -----------------------------------------------------------------------------
// LogsRecentCallsView::updateMenu
// -----------------------------------------------------------------------------
@@ -681,6 +701,8 @@
updateDialpadCallAndMessagingActions();
updateContactSearchAction();
+ updateMenuVisibility();
+
LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::updateMenu()" );
}
@@ -705,23 +727,50 @@
if ( mListView ) {
updateMenu();
updateListLayoutName(*mListView);
- updateListSize();
- HbDeviceProfile deviceProf;
+ updateListSize(*mListView);
LogsConfigurationParams param;
- QString testString = mListView->layoutName();
- //note: ListItemTextWidth values are currently hardcoded and
- //they are taken from hblistviewitem.css "text-1" field
- if (mListView->layoutName() == logsListLandscapeDialpadLayout) {
- param.setListItemTextWidth( 38 * deviceProf.unitValue() );
- } else {
- param.setListItemTextWidth( 40 * deviceProf.unitValue() );
- }
+ param.setListItemTextWidth( getListItemTextWidth() );
mModel->updateConfiguration(param);
}
LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::updateWidgetsSizeAndLayout()" );
}
// -----------------------------------------------------------------------------
+// LogsRecentCallsView::getListItemTextWidth
+// -----------------------------------------------------------------------------
+//
+int LogsRecentCallsView::getListItemTextWidth()
+{
+ LOGS_QDEBUG( "logs [UI] -> LogsRecentCallsView::getListItemTextWidth()" );
+
+ qreal width = 0.0;
+ QRectF screenRect = mViewManager.mainWindow().layoutRect();
+ LOGS_QDEBUG_2( "logs [UI] screenRect:", screenRect );
+
+ // Cannot use hb-param-screen-width in expressions currently due bug in layoutrect
+ qreal modifier = 0.0;
+ QString expr;
+ if (mListView->layoutName() == QLatin1String(logsListDefaultLayout)) {
+ expr = "expr(var(hb-param-graphic-size-primary-medium) + var(hb-param-margin-gene-left) ";
+ expr += "+ var(hb-param-margin-gene-right) + var(hb-param-margin-gene-middle-horizontal))";
+ width = screenRect.width();
+ } else {
+ expr = "expr(var(hb-param-graphic-size-primary-medium) + var(hb-param-margin-gene-left) ";
+ expr += "+ var(hb-param-margin-gene-right))";
+ width = screenRect.width() / 2;
+ }
+
+ if ( expr.isEmpty() || !style()->parameter(expr, modifier) ){
+ LOGS_QDEBUG( "logs [UI] No expression or incorrect expression" );
+ }
+ width -= modifier;
+
+ LOGS_QDEBUG_2( "logs [UI] <- LogsRecentCallsView::getListItemTextWidth(): ", width );
+ return qRound(width);
+}
+
+
+// -----------------------------------------------------------------------------
// LogsRecentCallsView::updateCallButton
// If dialpad contains text or there is items in list, call button is enabled
// -----------------------------------------------------------------------------
@@ -741,7 +790,7 @@
//
void LogsRecentCallsView::handleMissedCallsMarking()
{
- if ( mFilter && !mMarkingMissedAsSeen && !mResetted &&
+ if ( mFilter && !mMarkingMissedAsSeen && !mFirstActivation &&
( mFilter->filterType() == LogsFilter::Missed ||
mFilter->filterType() == LogsFilter::All ) ){
// Don't care if timer would be already running, slot's implementation
@@ -766,18 +815,3 @@
}
return mMarkingMissedAsSeen;
}
-
-// -----------------------------------------------------------------------------
-// LogsRecentCallsView::scrollToTopItem
-// -----------------------------------------------------------------------------
-//
-void LogsRecentCallsView::scrollToTopItem()
-{
- LOGS_QDEBUG( "logs [UI] -> LogsRecentCallsView::scrollToTopItem()" );
- disconnect( mFilter, SIGNAL(rowsInserted(const QModelIndex&,int,int)),
- this, SLOT(scrollToTopItem()));
- if ( mFilter && mFilter->hasIndex(0,0) ) {
- mListView->scrollTo( mFilter->index(0,0) );
- }
- LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::scrollToTopItem()" );
-}
--- a/logsui/logsapp/src/logsservicehandler.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/src/logsservicehandler.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -17,21 +17,21 @@
//USER
#include "logsservicehandler.h"
#include "logslogger.h"
+#include "logsdefs.h"
#include "logsmainwindow.h"
#include <xqserviceutil.h>
//SYSTEM
// -----------------------------------------------------------------------------
-// LogsService::LogsService
+// LogsServiceHandler::LogsServiceHandler
// -----------------------------------------------------------------------------
//
LogsServiceHandler::LogsServiceHandler(LogsMainWindow& mainWindow)
- : XQServiceProvider(QLatin1String("com.nokia.services.logsservices.starter"),0),
- mActivatedView(0),
+ : XQServiceProvider(QLatin1String("logs.com.nokia.symbian.ILogsView"),0),
mMainWindow(mainWindow)
{
- LOGS_QDEBUG( "logs [UI] -> LogsServiceHandler::LogsServiceHandler()" )
+ LOGS_QDEBUG( "logs [UI] -> LogsServiceHandler::LogsServiceHandler(), ILogsView" )
publishAll();
mIsAppStartedUsingService = XQServiceUtil::isService();
@@ -51,67 +51,44 @@
}
// -----------------------------------------------------------------------------
-// LogsServiceHandler::start
+// LogsServiceHandler::show
// -----------------------------------------------------------------------------
//
-int LogsServiceHandler::start(int activatedView, bool showDialpad)
+int LogsServiceHandler::show(const QVariantMap& params)
{
- LOGS_QDEBUG_2( "logs [UI] -> LogsServiceHandler::start(), view:", activatedView )
+ LOGS_QDEBUG( "logs [UI] -> LogsServiceHandler::show()" )
+ int activatedView = params.value(logsViewIndexParam,
+ QVariant((int)LogsServices::ViewAll)).toInt();
+ bool showDialpad = params.value(logsShowDialpadParam,
+ QVariant(false)).toBool();
+ QString dialpadText = params.value(logsDialpadTextParam,
+ QVariant(QString())).toString();
+
+ LOGS_QDEBUG_2( "logs [UI] activatedView:", activatedView )
+ LOGS_QDEBUG_2( "logs [UI] showDialpad:", showDialpad )
+ LOGS_QDEBUG_2( "logs [UI] dialpadText:", dialpadText )
if ( activatedView < LogsServices::ViewAll ||
activatedView > LogsServices::ViewMissed ){
- LOGS_QDEBUG( "logs [UI] <- LogsServiceHandler::start(), incorrect view" )
+ LOGS_QDEBUG( "logs [UI] <- LogsServiceHandler::show(), incorrect view" )
return -1;
}
+
mIsAppStartedUsingService = true;
- mActivatedView = activatedView;
LOGS_QDEBUG( "logs [UI] Bring app to foreground" )
mMainWindow.bringAppToForeground();
- emit activateView((LogsServices::LogsView)mActivatedView, showDialpad);
-
- LOGS_QDEBUG( "logs [UI] <- LogsServiceHandler::start()" )
+ if (!dialpadText.isEmpty()) {
+ emit activateView(dialpadText);
+ } else {
+ emit activateView((LogsServices::LogsView)activatedView, showDialpad, dialpadText);
+ }
+ LOGS_QDEBUG( "logs [UI] <- LogsServiceHandler::show()" )
return 0;
}
// -----------------------------------------------------------------------------
-// LogsServiceHandler::startWithNum
-// -----------------------------------------------------------------------------
-//
-int LogsServiceHandler::startWithNum(int activatedView, bool showDialpad, QString dialpadText)
-{
- LOGS_QDEBUG_2( "logs [UI] -> LogsServiceHandler::startWithNum(), view:", activatedView )
-
- Q_UNUSED(showDialpad);
-
- if ( activatedView < LogsServices::ViewAll ||
- activatedView > LogsServices::ViewMissed ){
- LOGS_QDEBUG( "logs [UI] <- LogsServiceHandler::startWithNum(), incorrect view" )
- return -1;
- }
- mIsAppStartedUsingService = true;
- mActivatedView = activatedView;
-
- LOGS_QDEBUG( "logs [UI] Bring app to foreground" )
- mMainWindow.bringAppToForeground();
-
- emit activateView(dialpadText);
-
- LOGS_QDEBUG( "logs [UI] <- LogsServiceHandler::startWithNum()" )
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-// LogsServiceHandler::currentlyActivatedView
-// -----------------------------------------------------------------------------
-//
-LogsServices::LogsView LogsServiceHandler::currentlyActivatedView()
-{
- return (LogsServices::LogsView)mActivatedView;
-}
-
-// -----------------------------------------------------------------------------
// LogsServiceHandler::isStartedUsingService
// -----------------------------------------------------------------------------
//
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logsapp/src/logsservicehandlerold.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,112 @@
+/*
+* 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:
+*
+*/
+//USER
+#include "logsservicehandlerold.h"
+#include "logslogger.h"
+#include "logsmainwindow.h"
+#include <xqserviceutil.h>
+
+//SYSTEM
+
+// -----------------------------------------------------------------------------
+// LogsServiceHandlerOld::LogsServiceHandlerOld
+// deprecated Use "logs.com.nokia.symbian.ILogsView" interface and
+// "show(int,bool,QString)" operation instead
+// -----------------------------------------------------------------------------
+//
+LogsServiceHandlerOld::LogsServiceHandlerOld(LogsMainWindow& mainWindow)
+ : XQServiceProvider(QLatin1String("com.nokia.services.logsservices.starter"),0),
+ mMainWindow(mainWindow)
+{
+ LOGS_QDEBUG( "logs [UI] -> LogsServiceHandlerOld::LogsServiceHandlerOld()" )
+
+ publishAll();
+ mIsAppStartedUsingService = XQServiceUtil::isService();
+
+ LOGS_QDEBUG_2(
+ "logs [UI] <- LogsServiceHandlerOld::LogsServiceHandlerOld(), is service",
+ mIsAppStartedUsingService )
+}
+
+// -----------------------------------------------------------------------------
+// LogsServiceHandlerOld::~LogsServiceHandlerOld
+// -----------------------------------------------------------------------------
+//
+LogsServiceHandlerOld::~LogsServiceHandlerOld()
+{
+ LOGS_QDEBUG( "logs [UI] <-> LogsServiceHandlerOld::~LogsServiceHandlerOld()" )
+}
+
+// -----------------------------------------------------------------------------
+// LogsServiceHandlerOld::start
+// -----------------------------------------------------------------------------
+//
+int LogsServiceHandlerOld::start(int activatedView, bool showDialpad)
+{
+ LOGS_QDEBUG_2( "logs [UI] -> LogsServiceHandlerOld::start(), view:", activatedView )
+
+ if ( activatedView < LogsServices::ViewAll ||
+ activatedView > LogsServices::ViewMissed ){
+ LOGS_QDEBUG( "logs [UI] <- LogsServiceHandlerOld::start(), incorrect view" )
+ return -1;
+ }
+ mIsAppStartedUsingService = true;
+
+ LOGS_QDEBUG( "logs [UI] Bring app to foreground" )
+ mMainWindow.bringAppToForeground();
+
+ emit activateView((LogsServices::LogsView)activatedView, showDialpad, QString());
+
+ LOGS_QDEBUG( "logs [UI] <- LogsServiceHandlerOld::start()" )
+ return 0;
+}
+
+// -----------------------------------------------------------------------------
+// LogsServiceHandlerOld::startWithNum
+// -----------------------------------------------------------------------------
+//
+int LogsServiceHandlerOld::startWithNum(int activatedView, bool showDialpad, QString dialpadText)
+{
+ LOGS_QDEBUG_2( "logs [UI] -> LogsServiceHandlerOld::startWithNum(), view:", activatedView )
+
+ Q_UNUSED(showDialpad);
+
+ if ( activatedView < LogsServices::ViewAll ||
+ activatedView > LogsServices::ViewMissed ){
+ LOGS_QDEBUG( "logs [UI] <- LogsServiceHandlerOld::startWithNum(), incorrect view" )
+ return -1;
+ }
+ mIsAppStartedUsingService = true;
+
+ LOGS_QDEBUG( "logs [UI] Bring app to foreground" )
+ mMainWindow.bringAppToForeground();
+
+ emit activateView(dialpadText);
+
+ LOGS_QDEBUG( "logs [UI] <- LogsServiceHandlerOld::startWithNum()" )
+ return 0;
+}
+
+// -----------------------------------------------------------------------------
+// LogsServiceHandlerOld::isStartedUsingService
+// -----------------------------------------------------------------------------
+//
+bool LogsServiceHandlerOld::isStartedUsingService() const
+{
+ return mIsAppStartedUsingService;
+}
+
--- a/logsui/logsapp/src/logsviewmanager.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/src/logsviewmanager.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -24,6 +24,7 @@
#include "logsdefs.h"
#include "logslogger.h"
#include "logsservicehandler.h"
+#include "logsservicehandlerold.h"
#include "logsmainwindow.h"
//SYSTEM
@@ -33,14 +34,18 @@
#include <QApplication>
#include <hblineedit.h>
#include <dialpad.h>
+#include <hbactivitymanager.h>
+#include <hbapplication.h>
// -----------------------------------------------------------------------------
// LogsViewManager::LogsViewManager
// -----------------------------------------------------------------------------
//
LogsViewManager::LogsViewManager(
- LogsMainWindow& mainWindow, LogsServiceHandler& service ) :
- QObject( 0 ), mMainWindow( mainWindow ), mService( service ),
+ LogsMainWindow& mainWindow, LogsServiceHandler& service,
+ LogsServiceHandlerOld& serviceOld ) :
+ QObject( 0 ), mMainWindow( mainWindow ),
+ mService( service ), mServiceOld( serviceOld ),
mFirstActivation(true), mViewActivationShowDialpad(false)
{
LOGS_QDEBUG( "logs [UI] -> LogsViewManager::LogsViewManager()" );
@@ -51,16 +56,22 @@
this, SLOT(handleOrientationChanged()) );
mComponentsRepository = new LogsComponentRepository(*this);
- initViews();
- connect( &mService, SIGNAL( activateView(LogsServices::LogsView, bool) ),
- this, SLOT( changeRecentView(LogsServices::LogsView, bool) ) );
+ connect( &mService, SIGNAL( activateView(LogsServices::LogsView, bool, QString) ),
+ this, SLOT( changeRecentViewViaService(LogsServices::LogsView, bool, QString) ) );
connect( &mService, SIGNAL( activateView(QString) ),
- this, SLOT( changeMatchesView(QString) ));
+ this, SLOT( changeMatchesViewViaService(QString) ));
+
+ connect( &mServiceOld, SIGNAL( activateView(LogsServices::LogsView, bool, QString) ),
+ this, SLOT( changeRecentViewViaService(LogsServices::LogsView, bool, QString) ) );
+
+ connect( &mServiceOld, SIGNAL( activateView(QString) ),
+ this, SLOT( changeMatchesViewViaService(QString) ));
- connect( &mMainWindow, SIGNAL(appFocusGained()), this, SLOT(appFocusGained()) );
- connect( &mMainWindow, SIGNAL(appFocusLost()), this, SLOT(appFocusLost()) );
+ QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(saveActivity()));
+
+ handleFirstActivation();
LOGS_QDEBUG( "logs [UI] <- LogsViewManager::LogsViewManager()" );
}
@@ -80,105 +91,40 @@
}
// -----------------------------------------------------------------------------
-// LogsViewManager::initViews
+// LogsViewManager::changeRecentViewViaService
// -----------------------------------------------------------------------------
//
-void LogsViewManager::initViews()
+void LogsViewManager::changeRecentViewViaService(
+ LogsServices::LogsView view, bool showDialpad, QString dialpadText)
{
- LOGS_QDEBUG( "logs [UI] -> LogsViewManager::initViews()" );
-
- // Disable view switching as otherwise flick gestures change
- // views which is not desired.
- //Deprecated:
- //mMainWindow.setViewSwitchingEnabled(false);
-
- // Don't activate any view, app focus gaining or service request
- // will cause view activation
- //
- LogsRecentCallsView* view = mComponentsRepository->recentCallsView();
- Q_ASSERT_X(view != 0, "logs [UI] ", "recentCallsView not found!");
- LOGS_QDEBUG( "logs [UI] adding view" );
- mViewStack.append(view);
- mMainWindow.addView(view);
-
- LogsDetailsView* detailsView = mComponentsRepository->detailsView();
- mViewStack.append(detailsView);
- mMainWindow.addView(detailsView);
-
- LogsMatchesView* matchesView = mComponentsRepository->matchesView();
- mViewStack.append(matchesView);
- mMainWindow.addView(matchesView);
+ mComponentsRepository->dialpad()->editor().setText(dialpadText);
+ changeRecentView(view, showDialpad);
+}
- LOGS_QDEBUG( "logs [UI] <- LogsViewManager::initViews()" );
+// -----------------------------------------------------------------------------
+// LogsViewManager::changeMatchesViewViaService
+// -----------------------------------------------------------------------------
+//
+void LogsViewManager::changeMatchesViewViaService(QString dialpadText)
+{
+ LOGS_QDEBUG( "logs [UI] -> LogsViewManager::changeMatchesView()" );
+ mComponentsRepository->dialpad()->editor().setText(dialpadText);
+ doActivateView(LogsMatchesViewId, true, QVariant());
+ LOGS_QDEBUG( "logs [UI] <- LogsViewManager::changeMatchesView()" );
}
// -----------------------------------------------------------------------------
// LogsViewManager::changeRecentView
// -----------------------------------------------------------------------------
//
-void LogsViewManager::changeRecentView(LogsServices::LogsView view, bool showDialpad)
+void LogsViewManager::changeRecentView(
+ LogsServices::LogsView view, bool showDialpad)
{
QVariant args(view);
doActivateView(LogsRecentViewId, showDialpad, args);
}
// -----------------------------------------------------------------------------
-// LogsViewManager::changeMatchesView
-// -----------------------------------------------------------------------------
-//
-void LogsViewManager::changeMatchesView(QString dialpadText)
-{
- LOGS_QDEBUG( "logs [UI] -> LogsViewManager::changeMatchesView()" );
- Dialpad* dialpad = mComponentsRepository->dialpad();
- dialpad->editor().setText(dialpadText);
- LogsModel* model = mComponentsRepository->model();
- if ( model && model->predictiveSearchStatus() == logsContactSearchEnabled ){
- LOGS_QDEBUG( "logs [UI] contact search enabled, go to macthes view" );
- doActivateView(LogsMatchesViewId, true, QVariant());
- } else {
- LOGS_QDEBUG( "logs [UI] contact search disabled, go to recent view" );
- doActivateView(LogsRecentViewId, true, QVariant());
- }
- LOGS_QDEBUG( "logs [UI] <- LogsViewManager::changeMatchesView()" );
-}
-
-// -----------------------------------------------------------------------------
-// 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()) );
- }
-
- if ( mFirstActivation && !mService.isStartedUsingService() ){
- changeRecentView( mService.currentlyActivatedView(), false );
- mMainWindow.bringAppToForeground();
- }
-
- mComponentsRepository->model()->refreshData();
-
- 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
// -----------------------------------------------------------------------------
//
@@ -186,7 +132,7 @@
{
LOGS_QDEBUG( "logs [UI] -> LogsViewManager::proceedExit()" );
- mComponentsRepository->model()->compressData();
+ qApp->quit();
LOGS_QDEBUG( "logs [UI] <- LogsViewManager::proceedExit()" );
}
@@ -232,10 +178,6 @@
// Fake exit by sending app to background
mMainWindow.sendAppToBackground();
-
- // Set application to default state (recent calls and no dialpad)
- activateView( LogsRecentViewId, false, QVariant() );
- mComponentsRepository->recentCallsView()->resetView();
bool exitAllowed( true );
foreach ( LogsBaseView* view, mViewStack ){
@@ -262,10 +204,9 @@
//
bool LogsViewManager::activatePreviousView()
{
- if ( mViewStack.count() < 2 ){
- return false;
- }
- return doActivateView(mViewStack.at(1)->viewId(), false, QVariant());
+ LogsAppViewId viewId = ( mViewStack.count() > 1 ) ?
+ mViewStack.at(1)->viewId() : LogsRecentViewId;
+ return doActivateView(viewId, false, QVariant());
}
// -----------------------------------------------------------------------------
@@ -276,7 +217,7 @@
// -----------------------------------------------------------------------------
//
bool LogsViewManager::doActivateView(
- LogsAppViewId viewId, bool showDialpad, QVariant args)
+ LogsAppViewId viewId, bool showDialpad, QVariant args, const QString& dialpadText)
{
LOGS_QDEBUG( "logs [UI] -> LogsViewManager::doActivateView()" );
@@ -284,12 +225,18 @@
LogsBaseView* newView = 0;
LogsBaseView* oldView = mViewStack.count() > 0 ? mViewStack.at(0) : 0;
+ viewId = checkMatchesViewTransition(viewId, dialpadText);
+
for ( int i = 0; i < mViewStack.count(); ++i ){
if ( mViewStack.at(i)->viewId() == viewId ){
newView = mViewStack.takeAt(i);
}
}
+ if ( !newView ){
+ newView = createView(viewId);
+ }
+
if ( oldView && newView && oldView != newView ){
oldView->deactivated();
disconnect( &mMainWindow, SIGNAL( callKeyPressed() ), oldView, 0 );
@@ -298,6 +245,9 @@
if ( newView ){
mViewStack.insert(0, newView);
mMainWindow.setCurrentView(newView);
+ //Setting mainwindow interactive to enable user input during
+ //view switching animation.
+ mMainWindow.setInteractive(true);
mViewActivationArgs = args;
mViewActivationShowDialpad = showDialpad;
completeViewActivation();
@@ -342,3 +292,171 @@
QMetaObject::invokeMethod(mMainWindow.currentView(), "handleOrientationChanged");
LOGS_QDEBUG( "logs [UI] <- LogsViewManager::handleOrientationChanged()" );
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsViewManager::saveActivity()
+{
+ LOGS_QDEBUG( "logs [UI] -> LogsViewManager::saveActivity()" );
+
+ if ( mViewStack.count() == 0 ){
+ return;
+ }
+
+ HbActivityManager* activityManager = static_cast<HbApplication*>(qApp)->activityManager();
+ foreach ( LogsBaseView* view, mViewStack ){
+ view->clearActivity(*activityManager);
+ }
+
+ QVariantHash metaData;
+
+ LOGS_QDEBUG( "logs [UI] Start taking screenshot" );
+ QImage* img = new QImage(mMainWindow.rect().size(), QImage::Format_ARGB32_Premultiplied);
+ QPainter p( img );
+ // Use render instead of QPixmap::grabWidget as otherwise screenshot
+ // may become empty.
+ mMainWindow.render( &p, mMainWindow.rect(), mMainWindow.rect() );
+ metaData.insert("screenshot", QPixmap::fromImage(*img));
+ delete img;
+ LOGS_QDEBUG( "logs [UI] End taking screenshot" );
+
+ QByteArray serializedActivity;
+ QDataStream stream(&serializedActivity, QIODevice::WriteOnly | QIODevice::Append);
+
+ metaData.insert(
+ logsActivityParamInternalViewId, mViewStack.at(0)->viewId() );
+ metaData.insert(
+ logsActivityParamShowDialpad, mComponentsRepository->dialpad()->isOpen() );
+ metaData.insert(
+ logsActivityParamDialpadText, mComponentsRepository->dialpad()->editor().text() );
+ QString activityId = mViewStack.at(0)->saveActivity(stream, metaData);
+
+ // add the activity to the activity manager
+ bool ok = activityManager->addActivity(activityId, serializedActivity, metaData);
+ if ( !ok ){
+ LOGS_QDEBUG( "logs [UI] activity adding failed" );
+ }
+ LOGS_QDEBUG( "logs [UI] <- LogsViewManager::saveActivity()" );
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+bool LogsViewManager::loadActivity()
+{
+ LOGS_QDEBUG( "logs [UI] -> LogsViewManager::loadActivity()" );
+ bool loaded = false;
+ HbApplication* hbApp = static_cast<HbApplication*>(qApp);
+ QString activityId = hbApp->activateId();
+ LOGS_QDEBUG_2( "logs [UI] activity id:", activityId );
+ bool ok = hbApp->activityManager()->waitActivity();
+ if ( !ok ){
+ LOGS_QDEBUG( "logs [UI] Activity reschedule failed" );
+ }
+
+ LogsBaseView* matchingView = 0;
+ for ( int i = 0; i < mViewStack.count() && !matchingView; i++ ){
+ if ( mViewStack.at(i)->matchWithActivityId(activityId) ){
+ matchingView = mViewStack.at(i);
+ }
+ }
+
+ QList<QVariantHash> allParams = hbApp->activityManager()->activities();
+ QVariantHash params = allParams.isEmpty() ? QVariantHash() : allParams.at(0);
+ LOGS_QDEBUG_2( "logs [UI] Activity params", params );
+
+ if ( !matchingView ){
+ // Try if creating such view is possible
+ int viewId = params.value(logsActivityParamInternalViewId).toInt();
+ matchingView = createView(static_cast<LogsAppViewId>(viewId));
+ }
+
+ if ( matchingView ){
+ // Should have only one param hash in the list, use first always
+ QList<QVariantHash> allParams = hbApp->activityManager()->activities();
+ QVariantHash params = allParams.isEmpty() ? QVariantHash() : allParams.at(0);
+ LOGS_QDEBUG_2( "logs [UI] Activity params", params );
+ bool showDialpad = params.value(logsActivityParamShowDialpad).toBool();
+ QString dialpadText = params.value(logsActivityParamDialpadText).toString();
+
+ QByteArray serializedActivity = hbApp->activateData().toByteArray();
+ QDataStream stream(&serializedActivity, QIODevice::ReadOnly);
+
+ QVariant args = matchingView->loadActivity(activityId, stream, params);
+ loaded = doActivateView( matchingView->viewId(), showDialpad, args, dialpadText );
+ }
+ LOGS_QDEBUG_2( "logs [UI] <- LogsViewManager::loadActivity() loaded:", loaded );
+ return loaded;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+LogsAppViewId LogsViewManager::checkMatchesViewTransition(
+ LogsAppViewId viewId, const QString& dialpadText)
+{
+ if ( !dialpadText.isEmpty() ){
+ mComponentsRepository->dialpad()->editor().setText(dialpadText);
+ }
+
+ if ( viewId == LogsMatchesViewId ){
+ LogsModel* model = mComponentsRepository->model();
+ if ( model && model->predictiveSearchStatus() != logsContactSearchEnabled ){
+ LOGS_QDEBUG( "logs [UI] contact search disabled, go to recent view" );
+ viewId = LogsRecentViewId;
+ }
+ }
+ return viewId;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsViewManager::handleFirstActivation()
+{
+ LOGS_QDEBUG( "logs [UI] -> LogsViewManager::handleFirstActivation()" );
+ bool useSavedActivity( static_cast<HbApplication*>(qApp)->activateReason() ==
+ Hb::ActivationReasonActivity );
+
+ if ( useSavedActivity && loadActivity() ){
+ LOGS_QDEBUG( "logs [UI] loaded saved activity" );
+ mMainWindow.bringAppToForeground();
+ } else if ( mFirstActivation && !mService.isStartedUsingService() &&
+ !mServiceOld.isStartedUsingService()) {
+ changeRecentView( LogsServices::ViewAll, false );
+ mMainWindow.bringAppToForeground();
+ }
+
+ // Clear previously stored activations
+
+ HbActivityManager* activityManager = static_cast<HbApplication*>(qApp)->activityManager();
+ foreach ( LogsBaseView* view, mViewStack ){
+ view->clearActivity(*activityManager);
+ }
+ LOGS_QDEBUG( "logs [UI] <- LogsViewManager::handleFirstActivation()" );
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+LogsBaseView* LogsViewManager::createView(LogsAppViewId viewId)
+{
+ LogsBaseView* newView = 0;
+ if ( viewId == LogsRecentViewId ){
+ newView = mComponentsRepository->recentCallsView();
+ mMainWindow.addView(newView);
+ } else if ( viewId == LogsMatchesViewId ) {
+ newView = mComponentsRepository->matchesView();
+ mMainWindow.addView(newView);
+ } else if ( viewId == LogsDetailsViewId ) {
+ newView = mComponentsRepository->detailsView();
+ mMainWindow.addView(newView);
+ }
+ return newView;
+}
--- a/logsui/logsapp/src/main.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/src/main.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -18,6 +18,7 @@
#include "logsmainwindow.h"
#include "logsviewmanager.h"
#include "logsservicehandler.h"
+#include "logsservicehandlerold.h"
#include "logslogger.h"
#include "logsdefs.h"
@@ -26,39 +27,16 @@
#include <hbmainwindow.h>
#include <hbapplication.h>
#include <hbstyleloader.h>
-#include <QTranslator>
+#include <hbtranslator.h>
int main(int argc, char *argv[])
{
LOGS_QDEBUG( "logs [UI] -> main()" )
- HbApplication app(argc, argv);
+ HbApplication app(argc, argv, Hb::NoSplash);
LogsMainWindow window;
-
- QString lang = QLocale::system().name();
- QString path = "z:/resource/qt/translations/";
- //Load common translator
- QTranslator commontranslator;
- bool returncode = false;
- LOGS_QDEBUG("logs [UI] loading common strings translator");
- returncode = commontranslator.load( path + "common_" + lang);
- if (returncode==false) {
- LOGS_QDEBUG("logs [UI] unable to open file: " + path + "common_" + lang);
- } else {
- app.installTranslator(&commontranslator);
- }
-
- //Load application-specific translator
- QTranslator translator;
- LOGS_QDEBUG("logs [UI] loading application strings translator");
- LOGS_QDEBUG("logs [UI] translation filename dialer_" + lang);
- returncode = translator.load( path + "dialer_" + lang);
- if (returncode==false) {
- LOGS_QDEBUG( "logs [UI] .qm file not found from " + path);
- } else {
- LOGS_QDEBUG( "logs [UI] .qm loaded successfully from " + path);
- app.installTranslator(&translator);
- }
+ HbTranslator translator("dialer");
+ translator.loadCommon();
HbStyleLoader::registerFilePath(":/logslayouts");
@@ -67,7 +45,8 @@
// This can cause problem of service request not coming through if
// HbApplication creation takes long time.
LogsServiceHandler service(window);
- LogsViewManager viewManager(window, service);
+ LogsServiceHandlerOld serviceOld(window);
+ LogsViewManager viewManager(window, service, serviceOld);
// Don't show window yet as app might be started at background
int err = app.exec();
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsbaseview.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsbaseview.h Thu Jul 22 16:33:49 2010 +0100
@@ -67,7 +67,8 @@
void testInitiateCallback();
void testShowListItemMenu();
void testPopulateListItemMenu();
- void testCloseEmptyMenu();
+ void testUpdateMenuVisibility();
+ void testSetMenuVisible();
void testSaveContact();
void testUpdateCall();
void testUpdateMessage();
@@ -85,6 +86,11 @@
void testDeleteEvent();
void testDeleteEventOkAnswer();
void testAskConfirmation();
+ void testMatchWithActivityId();
+ void testSaveActivity();
+ void testLoadActivity();
+ void testClearActivity();
+ void testEnsureListPositioning();
private:
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logscomponentrepository.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logscomponentrepository.h Thu Jul 22 16:33:49 2010 +0100
@@ -56,6 +56,7 @@
void testDialpad();
void testLoadSection();
void testAddToolbarToObjectList();
+ void testLazyInit();
private:
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsdetailsview.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsdetailsview.h Thu Jul 22 16:33:49 2010 +0100
@@ -65,6 +65,8 @@
void testUpdateWidgetsSizeAndLayout();
void testDialpadEditorTextChanged();
void testSendMessage();
+ void testSaveActivity();
+ void testLoadActivity();
private:
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logspageindicatoritem.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logspageindicatoritem.h Thu Jul 22 16:33:49 2010 +0100
@@ -48,6 +48,8 @@
void testConstructorDestructor();
void testSetActive();
+ void testChangeEvent();
+ void testUpdateColor();
void testAnimationFinnished();
private:
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsrecentcallsview.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsrecentcallsview.h Thu Jul 22 16:33:49 2010 +0100
@@ -54,7 +54,6 @@
void testInitView();
void testActivated();
void testDeactivated();
- void testResetView();
void testInitListWidget();
void testUpdateFilter();
void testUpdateViewName();
@@ -65,7 +64,6 @@
void testOpenDialpad();
void testDialpadEditorTextChanged();
void testGestureEvent();
- void testSwipeAngleToDirection();
void testViewChangeByFlicking();
void testModel();
void testShowListItemMenu();
@@ -77,12 +75,15 @@
void testActivateEmptyListIndicator();
void testUpdateMenu();
void testUpdateWidgetsSizeAndLayout();
+ void testGetListItemTextWidth();
void testDialpadClosed();
void testClearList();
void testClearListOkAnswer();
void testIsExitAllowed();
void testContactSearch();
void testDialpadOpened();
+ void testSaveActivity();
+ void testLoadActivity();
private: //helper functions
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsservicehandler.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsservicehandler.h Thu Jul 22 16:33:49 2010 +0100
@@ -21,6 +21,7 @@
#include <QObject>
class LogsServiceHandler;
+class LogsServiceHandlerOld;
class LogsViewManager;
class LogsMainWindow;
@@ -51,12 +52,17 @@
private slots: //test methods
void testConstructor();
+ //test functions for old service handler
void testStart();
void testStartWithNum();
+ //test functions for new service handler
+ void testShow();
+
private:
LogsServiceHandler* mService;
+ LogsServiceHandlerOld* mServiceOld;
LogsMainWindow* mMainWindow;
LogsViewManager* mLogsViewManager;
};
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsviewmanager.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsviewmanager.h Thu Jul 22 16:33:49 2010 +0100
@@ -23,6 +23,8 @@
class HbMainWindow;
class LogsViewManager;
class LogsMainWindow;
+class LogsServiceHandler;
+class LogsServiceHandlerOld;
class UT_LogsViewManager : public QObject
{
@@ -51,16 +53,21 @@
void testConstructorDestructor();
void testActivateView();
void testchangeMatchesView();
+ void testchangeRecentView();
void testExitApplication();
- void testAppFocusGained();
void testStartingWithService();
void testHandleOrientationChanged();
void testCompleteViewActivation();
+ void testSaveActivity();
+ void testLoadActivity();
private:
LogsMainWindow* mMainWindow;
LogsViewManager* mLogsViewManager;
+
+ LogsServiceHandler* mService;
+ LogsServiceHandlerOld* mServiceOld;
};
#endif //UT_LOGSVIEWMANAGER_H
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsdetailsmodel.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsdetailsmodel.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -87,6 +87,16 @@
}
// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+LogsEvent LogsDetailsModel::getLogsEvent() const
+{
+ return *mEvent;
+}
+
+
+// -----------------------------------------------------------------------------
// LogsDetailsModel::rowCount
// From QAbstractListModel
// -----------------------------------------------------------------------------
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsdetailsmodel.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsdetailsmodel.h Thu Jul 22 16:33:49 2010 +0100
@@ -44,6 +44,7 @@
~LogsDetailsModel();
void clearEvent();
void getNumberToClipboard();
+ LogsEvent getLogsEvent() const;
public: // From QAbstractItemModel
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsevent.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsevent.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -86,6 +86,27 @@
}
// ----------------------------------------------------------------------------
+//
+// ----------------------------------------------------------------------------
+//
+LogsEvent::LogsEvent( QDataStream& serializedEvent )
+{
+ serializedEvent >> mLogId;
+ mLogsEventData = 0;
+}
+
+// ----------------------------------------------------------------------------
+//
+// ----------------------------------------------------------------------------
+//
+bool LogsEvent::serialize( QDataStream& serializeDestination )
+{
+ serializeDestination << mLogId;
+
+ return true;
+}
+
+// ----------------------------------------------------------------------------
// LogsEvent::initializeEventL
// ----------------------------------------------------------------------------
//
@@ -243,9 +264,11 @@
// LogsEvent::setEventType
// ----------------------------------------------------------------------------
//
-void LogsEvent::setEventType( LogsEventType eventType )
+bool LogsEvent::setEventType( LogsEventType eventType )
{
+ bool changed( mEventType != eventType );
mEventType = eventType;
+ return changed;
}
// ----------------------------------------------------------------------------
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsevent.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsevent.h Thu Jul 22 16:33:49 2010 +0100
@@ -27,6 +27,7 @@
class LogsEventData;
class LogsEventStrings;
class CLogEvent;
+class QDataStream;
// CLASS DECLARATION
@@ -181,6 +182,10 @@
*/
QString getNumberForCalling();
+ LogsEvent( QDataStream& serializedEvent );
+
+ bool serialize( QDataStream& serializeDestination );
+
private:
bool setTime( const QDateTime& time );
@@ -193,7 +198,7 @@
void setEventUid( int uid );
- void setEventType( LogsEventType aEventType );
+ bool setEventType( LogsEventType aEventType );
void setLogsEventData( LogsEventData* logsEventData );
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsforegroundwatcher.cpp Fri Jun 11 16:24:14 2010 +0100
+++ /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();
-}
-
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsforegroundwatcher.h Fri Jun 11 16:24:14 2010 +0100
+++ /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 <QObject>
-
-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
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmatchesmodel.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmatchesmodel.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -34,7 +34,7 @@
{
LOGS_QDEBUG( "logs [ENG] -> LogsMatchesModel::LogsMatchesModel()" )
mDbConnector = &dbConnector;
- mLastCall = QString();
+ mLastCall = QString("constructor");
mTextData.append( "firstitem" );
LOGS_QDEBUG( "logs [ENG] <- LogsMatchesModel::LogsMatchesModel()" )
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmodel.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmodel.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -87,6 +87,15 @@
}
// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+LogsDetailsModel* LogsModel::logsDetailsModel(LogsEvent& event)
+{
+ return new LogsDetailsModel();
+}
+
+// -----------------------------------------------------------------------------
// LogsModel::markEventsSeen
// -----------------------------------------------------------------------------
//
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmodel.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmodel.h Thu Jul 22 16:33:49 2010 +0100
@@ -24,6 +24,7 @@
class LogsMatchesModel;
class LogsConfigurationParams;
+class LogsDetailsModel;
/**
*
@@ -58,6 +59,7 @@
int refreshData();
int compressData();
int updateConfiguration(LogsConfigurationParams& params);
+ LogsDetailsModel* logsDetailsModel(LogsEvent& event);
public: // From QAbstractItemModel
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsbaseview.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsbaseview.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -38,6 +38,8 @@
#include <hblistviewitem.h>
#include <hblistview.h>
#include <QStringListModel>
+#include <hbapplication.h>
+#include <hbactivitymanager.h>
void UT_LogsBaseView::initTestCase()
{
@@ -69,7 +71,6 @@
void UT_LogsBaseView::testConstructor()
{
QVERIFY( mBaseView );
- QVERIFY( mBaseView->mSoftKeyBackAction );
QVERIFY( !mBaseView->mShowFilterMenu );
QVERIFY( !mBaseView->mInitialized );
QVERIFY( mBaseView->mActionMap.isEmpty() );
@@ -79,6 +80,7 @@
QVERIFY( !mBaseView->mMessage );
QVERIFY( !mBaseView->mContact );
QVERIFY( !mBaseView->mCallTypeMapper );
+ QVERIFY( !mBaseView->mOptionsMenu );
}
void UT_LogsBaseView::testActivated()
@@ -272,30 +274,71 @@
QVERIFY( HbStubHelper::widgetActionsCount() == 5 );
}
-
-
-void UT_LogsBaseView::testCloseEmptyMenu()
+void UT_LogsBaseView::testUpdateMenuVisibility()
{
- LogsRecentCallsView* view = mRepository->recentCallsView();
-
- //visible actions exist
- QVERIFY( view->menu()->actions().count() > 0 );
- HbStubHelper::setWidgetOpen(true);
- view->closeEmptyMenu();
- QVERIFY(HbStubHelper::isWidgetOpen());
+ HbMenu* menu = new HbMenu;
+ HbAction* action = menu->addAction("action1");
+ mBaseView->setMenu(menu);
- //no visible actions
- foreach (QAction* action, view->menu()->actions()) {
- action->setVisible(false);
- }
- view->closeEmptyMenu();
- QVERIFY(!HbStubHelper::isWidgetOpen());
+ // No visible actions in menu => menu is replaced by empty one
+ QVERIFY(!mBaseView->mOptionsMenu);
+ QVERIFY(!mBaseView->menu()->isEmpty());
+ action->setVisible(false);
+ mBaseView->updateMenuVisibility();
+ QVERIFY(mBaseView->menu()->isEmpty());
+ QVERIFY(mBaseView->mOptionsMenu == menu);
+ QVERIFY(mBaseView->menu() != menu);
+
+ // Visible action exists => restoring the menu
+ action->setVisible(true);
+ QVERIFY(mBaseView->mOptionsMenu);
+ mBaseView->updateMenuVisibility();
+ QVERIFY(!mBaseView->menu()->isEmpty());
+ QVERIFY(!mBaseView->mOptionsMenu);
+ QVERIFY(mBaseView->menu() == menu);
+
+ // Menu has no actions => menu is replaced by empty one
+ mBaseView->setMenu(0);
+ menu = mBaseView->menu();
+ QVERIFY(!mBaseView->mOptionsMenu);
+ QVERIFY(mBaseView->menu()->isEmpty());
+ mBaseView->updateMenuVisibility();
+ QVERIFY(mBaseView->menu()->isEmpty());
+ QVERIFY(mBaseView->mOptionsMenu == menu);
+ QVERIFY(mBaseView->menu() != menu);
+}
+
+void UT_LogsBaseView::testSetMenuVisible()
+{
+ HbMenu* menu = new HbMenu;
+ menu->addAction("action1");
+ mBaseView->setMenu(menu);
- //no actions
- HbStubHelper::setWidgetOpen(true);
- view->menu()->actions().clear();
- view->closeEmptyMenu();
- QVERIFY(!HbStubHelper::isWidgetOpen());
+ // Hiding menu, view menu is replaced by empty menu
+ QVERIFY(!mBaseView->mOptionsMenu);
+ QVERIFY(!mBaseView->menu()->isEmpty());
+ mBaseView->setMenuVisible(false);
+ QVERIFY(mBaseView->menu()->isEmpty());
+ QVERIFY(mBaseView->mOptionsMenu == menu);
+ QVERIFY(mBaseView->menu() != menu);
+
+ // Trying to hide again, nothing happens
+ mBaseView->setMenuVisible(false);
+ QVERIFY(mBaseView->menu()->isEmpty());
+ QVERIFY(mBaseView->mOptionsMenu == menu);
+ QVERIFY(mBaseView->menu() != menu);
+
+ // Showing menu, original menu is restored
+ mBaseView->setMenuVisible(true);
+ QVERIFY(!mBaseView->menu()->isEmpty());
+ QVERIFY(!mBaseView->mOptionsMenu);
+ QVERIFY(mBaseView->menu() == menu);
+
+ // Showing again, nothing happen
+ mBaseView->setMenuVisible(true);
+ QVERIFY(!mBaseView->menu()->isEmpty());
+ QVERIFY(!mBaseView->mOptionsMenu);
+ QVERIFY(mBaseView->menu() == menu);
}
void UT_LogsBaseView::testSaveContact()
@@ -408,23 +451,24 @@
mBaseView->mLayoutSectionName = "dummy";
//default section is loaded
+ HbListView view;
mBaseView->mViewManager.mainWindow().setOrientation( Qt::Vertical );
mBaseView->mDialpad->closeDialpad();
- mBaseView->updateListSize();
+ mBaseView->updateListSize(view);
QVERIFY( mBaseView->mLayoutSectionName == logsViewDefaultSection );
//same section again, not loaded
- mBaseView->updateListSize();
+ mBaseView->updateListSize(view);
QVERIFY( mBaseView->mLayoutSectionName == logsViewDefaultSection );
//portrait with dialpad
mBaseView->mDialpad->openDialpad();
- mBaseView->updateListSize();
+ mBaseView->updateListSize(view);
QVERIFY( mBaseView->mLayoutSectionName == logsViewPortraitDialpadSection );
//landscape with dialpad
mBaseView->mViewManager.mainWindow().setOrientation( Qt::Horizontal );
- mBaseView->updateListSize();
+ mBaseView->updateListSize(view);
QVERIFY( mBaseView->mLayoutSectionName == logsViewLandscapeDialpadSection );
}
@@ -529,6 +573,116 @@
// Receiver and slots specified
HbStubHelper::reset();
mBaseView->askConfirmation(QLatin1String("heading"), QLatin1String("text"), this,
- SLOT(""), SLOT(""));
+ SLOT("dummy()"), SLOT("dummy()"));
QVERIFY( HbStubHelper::dialogShown() );
}
+
+void UT_LogsBaseView::testMatchWithActivityId()
+{
+ QVERIFY( !mBaseView->matchWithActivityId(QString("")) );
+ QVERIFY( !mBaseView->matchWithActivityId(QString("somedummy")) );
+ mBaseView->mActivities.append( "testActivity1" );
+ mBaseView->mActivities.append( "testActivity2" );
+ QVERIFY( !mBaseView->matchWithActivityId(QString("")) );
+ QVERIFY( !mBaseView->matchWithActivityId(QString("somedummy")) );
+ QVERIFY( mBaseView->matchWithActivityId(QString("testActivity2")) );
+}
+
+void UT_LogsBaseView::testSaveActivity()
+{
+ QDataStream serializedActivity;
+ QVariantHash metaData;
+ QVERIFY( mBaseView->saveActivity(serializedActivity, metaData).isEmpty() );
+ mBaseView->mActivities.append( "testActivity1" );
+ QVERIFY( mBaseView->saveActivity(serializedActivity, metaData) == QString("testActivity1") );
+}
+
+void UT_LogsBaseView::testLoadActivity()
+{
+ QDataStream serializedActivity;
+ QVariantHash metaData;
+ QVERIFY( mBaseView->loadActivity(QString("dummy"), serializedActivity, metaData).isNull() );
+}
+
+void UT_LogsBaseView::testClearActivity()
+{
+ HbStubHelper::reset();
+ HbActivityManager* manager = static_cast<HbApplication*>(qApp)->activityManager();
+ manager->addActivity("someact", QVariant(), QVariantHash());
+ QCOMPARE( manager->activities().count(), 1 );
+ mBaseView->mActivities.append( "testActivity1" );
+ mBaseView->clearActivity(*manager);
+ QCOMPARE( manager->activities().count(), 0 );
+}
+
+void UT_LogsBaseView::testEnsureListPositioning()
+{
+ HbStubHelper::reset();
+ HbListView list;
+ QStringList itemTexts;
+ itemTexts.append( "foo1" );
+ itemTexts.append( "foo2" );
+ QStringListModel model;
+ model.setStringList(itemTexts);
+
+ itemTexts.append( "foo3" );
+ itemTexts.append( "foo4" );
+ QStringListModel model2;
+ model2.setStringList(itemTexts);
+
+ list.setModel(&model);
+
+ // No content found, nop
+ mBaseView->ensureListPositioning(list);
+ QVERIFY( !HbStubHelper::listEnsureVisibleCalled() );
+ QVERIFY( !HbStubHelper::listScrollToCalled() );
+
+ // Content found, no visible items, nop
+ mRepository->recentCallsView();
+ mBaseView->activated(false, QVariant());
+ mBaseView->ensureListPositioning(list);
+ QVERIFY( !HbStubHelper::listEnsureVisibleCalled() );
+ QVERIFY( !HbStubHelper::listScrollToCalled() );
+
+ // Content found and visible items which can fit the screen, height of item zero, nop
+ HbWidget* content =
+ qobject_cast<HbWidget*>( mRepository->findWidget( logsContentId ) );
+ content->setContentsMargins(0,0,0,0);
+ content->setGeometry( QRectF(0,0,100,200) );
+
+ HbListViewItem* item = new HbListViewItem;
+ HbStubHelper::listItems().append(item);
+ HbListViewItem* item2 = new HbListViewItem;
+ HbStubHelper::listItems().append(item2);
+ mBaseView->ensureListPositioning(list);
+ QVERIFY( !HbStubHelper::listEnsureVisibleCalled() );
+ QVERIFY( !HbStubHelper::listScrollToCalled() );
+
+ // Screen is already filled with items, nop
+ list.setModel(&model2);
+ HbListViewItem* item3 = new HbListViewItem;
+ HbStubHelper::listItems().append(item3);
+ item->setGeometry(QRectF(0,0,100,100));
+ item2->setGeometry(QRectF(0,0,100,100));
+ item3->setGeometry(QRectF(0,0,100,100));
+ mBaseView->ensureListPositioning(list);
+ QVERIFY( !HbStubHelper::listEnsureVisibleCalled() );
+ QVERIFY( !HbStubHelper::listScrollToCalled() );
+
+ // Content found and visible items which can fit the screen, all items ensured visible
+ list.setModel(&model);
+ delete HbStubHelper::listItems().takeLast();
+ mBaseView->ensureListPositioning(list);
+ QVERIFY( HbStubHelper::listEnsureVisibleCalled() );
+ QVERIFY( !HbStubHelper::listScrollToCalled() );
+
+ // Content found and more visible items which can fit the screen and currently screen
+ // is not full of items, ensure that area is filled by scrolling
+ list.setModel(&model2);
+ list.setCurrentIndex(model2.index(0,0));
+ delete HbStubHelper::listItems().takeLast();
+ mBaseView->ensureListPositioning(list);
+ QVERIFY( HbStubHelper::listEnsureVisibleCalled() );
+ QVERIFY( HbStubHelper::listScrollToCalled() );
+
+}
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logscomponentrepository.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logscomponentrepository.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -151,3 +151,19 @@
QVERIFY( mRepository->mRecentViewComponents.at(0)->objectName() == logsToolbarId );
delete view;
}
+
+void UT_LogsComponentRepository::testLazyInit()
+{
+ QObjectList dummyObjList;
+ mRepository->mCurrentObjectTree = &dummyObjList;
+ QVERIFY( !mRepository->mRecentCallsView );
+ QVERIFY( !mRepository->mDetailsView );
+ QVERIFY( !mRepository->mMatchesView );
+ QVERIFY( !mRepository->model()->mRefreshCalled );
+ mRepository->lazyInit();
+ QVERIFY( mRepository->mRecentCallsView );
+ QVERIFY( mRepository->mDetailsView );
+ QVERIFY( mRepository->mMatchesView );
+ QVERIFY( mRepository->model()->mRefreshCalled );
+ QVERIFY( mRepository->mCurrentObjectTree == &dummyObjList );
+}
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsdetailsview.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsdetailsview.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -68,9 +68,9 @@
void UT_LogsDetailsView::testConstructor()
{
QVERIFY(mDetailsView);
- QVERIFY(mDetailsView->mSoftKeyBackAction);
QVERIFY(mDetailsView->viewId() == LogsDetailsViewId );
QVERIFY(!mDetailsView->mDetailsModel);
+ QCOMPARE( mDetailsView->mActivities.at(0), QString(logsActivityIdViewDetails) );
}
void UT_LogsDetailsView::testActivated()
@@ -339,3 +339,33 @@
QVERIFY( !LogsMessage::isDefaultMessageSent() );
QVERIFY( LogsMessage::isMessageSent() );
}
+
+void UT_LogsDetailsView::testSaveActivity()
+{
+ QByteArray serializedActivity;
+ int sizeBefore = serializedActivity.size();
+ QDataStream stream(&serializedActivity, QIODevice::WriteOnly | QIODevice::Append);
+ QVariantHash metaData;
+ QVERIFY( mDetailsView->saveActivity(stream, metaData) == QString(logsActivityIdViewDetails) );
+ QVERIFY(serializedActivity.size() == sizeBefore); // Event not serialized as no model
+
+ mDetailsView->mDetailsModel = new LogsDetailsModel();
+ mDetailsView->mDetailsModel->mEvent = new LogsEvent;
+ QVERIFY( mDetailsView->saveActivity(stream, metaData) == QString(logsActivityIdViewDetails) );
+ QVERIFY(serializedActivity.size() > sizeBefore); // Event serialized
+
+}
+
+void UT_LogsDetailsView::testLoadActivity()
+{
+ QByteArray serializedActivity;
+ QDataStream stream(&serializedActivity, QIODevice::ReadWrite | QIODevice::Append);
+ LogsEvent event;
+ event.serialize(stream);
+ QVariantHash metaData;
+ QVariant args = mDetailsView->loadActivity(QString(logsActivityIdViewDetails), stream, metaData);
+ QVERIFY( !args.isNull() );
+ LogsDetailsModel* model = qVariantValue<LogsDetailsModel*>(args);
+ QVERIFY( model != 0 );
+ delete model;
+}
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logseffecthandler.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logseffecthandler.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -77,7 +77,7 @@
void UT_LogsEffectHandler::testStartDissappearAppearByMovingEffect()
{
QVERIFY( mEffect->mMoveGroup->state() == QAbstractAnimation::Stopped );
- mEffect->startDissappearAppearByMovingEffect(*mLabel, *mLabel2, false, 0);
+ mEffect->startDissappearAppearByMovingEffect(*mLabel, *mLabel2, false, 0, 0);
QVERIFY( mEffect->mMoveGroup->state() == QAbstractAnimation::Running );
QVERIFY( mEffect->mMoveGroup2->state() == QAbstractAnimation::Running );
@@ -90,7 +90,7 @@
QVERIFY(spy.count() == 1 );
// When effect is running and new effect is requested, previous effect is stopped
- mEffect->startDissappearAppearByMovingEffect(*mLabel, *mLabel2, true, 0);
+ mEffect->startDissappearAppearByMovingEffect(*mLabel, *mLabel2, true, 0, 0);
}
void UT_LogsEffectHandler::testStartMoveNotPossibleEffect()
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsmatchesview.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsmatchesview.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -70,13 +70,14 @@
QVERIFY( mMatchesView->mActionMap.count() == 0 );
QVERIFY( mMatchesView->mLayoutSectionName == "" );
QVERIFY( !mMatchesView->mAddToContactsButton );
+ QCOMPARE( mMatchesView->mActivities.at(0), QString(logsActivityIdViewMatches) );
}
void UT_LogsMatchesView::testActivated()
{
//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 );
@@ -89,6 +90,7 @@
QVERIFY( mMatchesView->mListView->layoutName() == logsListDefaultLayout );
QVERIFY( mMatchesView->mLayoutSectionName == logsViewDefaultSection );
QVERIFY( mMatchesView->mAddToContactsButton );
+ QVERIFY( !mMatchesView->mAddToContactsButton->isVisible() );
//activate once again, model recreated
mMatchesView->mViewManager.mainWindow().setOrientation( Qt::Horizontal );
@@ -100,27 +102,33 @@
QVERIFY( mMatchesView->mActionMap.count() == 4 );
QVERIFY( mMatchesView->mListView->layoutName() == logsListLandscapeDialpadLayout );
QVERIFY( mMatchesView->mLayoutSectionName == logsViewLandscapeDialpadSection );
+ QVERIFY( !mMatchesView->mAddToContactsButton->isVisible() );
//Pass model as input arg
LogsDbConnector* dbConnector = 0;
LogsMatchesModel* model1 = new LogsMatchesModel(*dbConnector);
+ model1->resetLastCall();
QVariant arg = qVariantFromValue( model1 );
mMatchesView->activated( true, arg );
QVERIFY( mMatchesView->mListView );
- QVERIFY( mMatchesView->mModel == model1 );
+ QVERIFY( mMatchesView->mModel == model1 );
+ QVERIFY( mMatchesView->mModel->mLastCall.isEmpty() );
LogsMatchesModel* model2 = new LogsMatchesModel(*dbConnector);
+ model2->resetLastCall();
QVariant arg2 = qVariantFromValue( model2 );
mMatchesView->activated( true, arg2 );
QVERIFY( mMatchesView->mListView );
QVERIFY( mMatchesView->mModel == model2 );
+ QVERIFY( mMatchesView->mModel->mLastCall.isEmpty() );
+ QVERIFY( !mMatchesView->mAddToContactsButton->isVisible() );
// After passing model as input arg, do not pass model
mMatchesView->activated( true,QVariant() );
QVERIFY( mMatchesView->mListView );
QVERIFY( mMatchesView->mModel );
- QVERIFY( mMatchesView->mModel != model1 );
- QVERIFY( mMatchesView->mModel != model2 );
+ QVERIFY( mMatchesView->mModel->mLastCall == QLatin1String("constructor") );
+ delete view;
}
@@ -236,17 +244,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();
@@ -254,21 +263,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;
@@ -278,10 +284,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()
@@ -300,7 +303,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();
@@ -327,14 +330,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);
@@ -345,8 +350,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()
@@ -365,6 +369,12 @@
QVERIFY( mMatchesView->mEmptyListLabel->isVisible() );
QVERIFY( mMatchesView->mAddToContactsButton->isVisible() );
+
+ mMatchesView->mAddToContactsButtonDisabled = true;
+ mMatchesView->updateEmptyListWidgetsVisibility();
+ QVERIFY( mMatchesView->mEmptyListLabel->isVisible() );
+ QVERIFY( !mMatchesView->mAddToContactsButton->isVisible() );
+
delete mMatchesView->mEmptyListLabel;
mMatchesView->mEmptyListLabel = 0;
delete mMatchesView->mAddToContactsButton;
@@ -429,7 +439,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;
}
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logspageindicatoritem.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logspageindicatoritem.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -18,10 +18,13 @@
//USER
#include "ut_logspageindicatoritem.h"
#include "logspageindicatoritem.h"
+#include "hbstubs_helper.h"
//SYSTEM
#include <QtTest/QtTest>
#include <QGraphicsColorizeEffect>
+#include <hbcolorscheme.h>
+#include <hbevent.h>
void UT_LogsPageIndicatorItem::initTestCase()
{
@@ -46,6 +49,7 @@
{
QVERIFY(!mIndicatorItem->mIsActive);
QVERIFY(mIndicatorItem->graphicsEffect());
+ QVERIFY(mIndicatorItem->color() == QColor(Qt::white));
delete mIndicatorItem;
mIndicatorItem = 0;
@@ -73,6 +77,43 @@
QVERIFY(mIndicatorItem->graphicsEffect()->isEnabled());
}
+void UT_LogsPageIndicatorItem::testChangeEvent()
+{
+ QColor whiteCol(Qt::white);
+ QColor redCol(Qt::red);
+
+ // theme changed event, color is updated
+ HbStubHelper::setColorScheme(redCol);
+ QVERIFY(mIndicatorItem->color() == whiteCol);
+ HbEvent event(HbEvent::ThemeChanged);
+ mIndicatorItem->event(&event);
+ QVERIFY(mIndicatorItem->color() == redCol);
+
+ // some other event, color is not updated
+ HbStubHelper::setColorScheme(whiteCol);
+ HbEvent event2(HbEvent::DeviceProfileChanged);
+ mIndicatorItem->event(&event2);
+ QVERIFY(mIndicatorItem->color() == redCol);
+}
+
+void UT_LogsPageIndicatorItem::testUpdateColor()
+{
+ QColor whiteCol(Qt::white);
+ QColor redCol(Qt::red);
+ QColor invalidCol(QColor::Invalid);
+
+ // color updated successfully
+ QVERIFY(mIndicatorItem->color() == whiteCol);
+ HbStubHelper::setColorScheme(redCol);
+ mIndicatorItem->updateColor();
+ QVERIFY(mIndicatorItem->color() == redCol);
+
+ // color couldn't be updated
+ HbStubHelper::setColorScheme(invalidCol);
+ mIndicatorItem->updateColor();
+ QVERIFY(mIndicatorItem->color() == redCol);
+}
+
void UT_LogsPageIndicatorItem::testAnimationFinnished()
{
QVERIFY(mIndicatorItem->graphicsEffect());
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsrecentcallsview.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsrecentcallsview.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -32,7 +32,7 @@
//SYSTEM
#include <QtTest/QtTest>
-#include <QGesture>
+#include <hbswipegesture.h>
#include <hbmainwindow.h>
#include <hblistview.h>
#include <hblabel.h>
@@ -94,6 +94,11 @@
QVERIFY( mRecentCallsView->mCurrentView == LogsServices::ViewAll );
QVERIFY( mRecentCallsView->viewId() == LogsRecentViewId );
QVERIFY( mRecentCallsView->mLayoutSectionName == "" );
+ QCOMPARE( mRecentCallsView->mActivities.at(LogsServices::ViewAll), QString(logsActivityIdViewRecent) );
+ QCOMPARE( mRecentCallsView->mActivities.at(LogsServices::ViewReceived), QString(logsActivityIdViewReceived) );
+ QCOMPARE( mRecentCallsView->mActivities.at(LogsServices::ViewCalled), QString(logsActivityIdViewCalled) );
+ QCOMPARE( mRecentCallsView->mActivities.at(LogsServices::ViewMissed), QString(logsActivityIdViewMissed) );
+
}
void UT_LogsRecentCallsView::testInitView()
@@ -145,14 +150,14 @@
view->mViewManager.mainWindow().setOrientation( Qt::Horizontal );
view->mDialpad->editor().setText( QString("hello") );
- view->mResetted = true;
+ view->mFirstActivation = true;
view->activated(false, QVariant(LogsServices::ViewAll));
QVERIFY( view->mFilter->filterType() == LogsFilter::All );
VERIFY_CHECKED_ACTION( view, logsShowFilterRecentMenuActionId )
QVERIFY( !view->mDialpad->editor().text().isEmpty() );
QVERIFY( view->mListView->layoutName() == logsListLandscapeLayout );
QVERIFY( view->mLayoutSectionName == logsViewDefaultSection );
- QVERIFY( !view->mResetted );
+ QVERIFY( !view->mFirstActivation );
}
void UT_LogsRecentCallsView::testDeactivated()
@@ -160,14 +165,6 @@
mRecentCallsView->deactivated();
}
-void UT_LogsRecentCallsView::testResetView()
-{
- // Opened dialpad is closed and text in it is cleared
- QVERIFY( !mRecentCallsView->mResetted );
- mRecentCallsView->resetView();
- QVERIFY( mRecentCallsView->mResetted );
-}
-
void UT_LogsRecentCallsView::testInitListWidget()
{
//TODO:Q_ASSERT_X
@@ -204,6 +201,7 @@
mRecentCallsView->mListView = 0;
//filter is updated with a new one, missed calls marking as seen is started (by timer)
+ mRecentCallsView->mFirstActivation = false;
QVERIFY( mRecentCallsView->mFilter );
mRecentCallsView->mListView = new HbListView();
mRecentCallsView->updateFilter(LogsFilter::Missed);
@@ -214,9 +212,9 @@
mRecentCallsView->mListView = 0;
//filter is updated with a new one, missed calls marking as seen is not started
- //as view was resetted
+ //as this is first view activation
HbStubHelper::reset();
- mRecentCallsView->mResetted = true;
+ mRecentCallsView->mFirstActivation = true;
mRecentCallsView->mListView = new HbListView();
mRecentCallsView->updateFilter(LogsFilter::Missed);
QVERIFY( mRecentCallsView->mFilter );
@@ -253,11 +251,15 @@
HbAction* action = new HbAction();
action->setObjectName(logsShowFilterMissedMenuActionId);
mRecentCallsView->changeFilter(action);
+ // Scrollbar is disbaled while changing the list and is restored when appearByMoving slot is called
+ QVERIFY( mRecentCallsView->mListView->verticalScrollBarPolicy() == HbScrollArea::ScrollBarAlwaysOff );
// Because of effects, filter is not changed immediately, simulate effect completion
QVERIFY( mRecentCallsView->mAppearingView == LogsServices::ViewMissed );
mRecentCallsView->dissappearByMovingComplete();
- QVERIFY( mRecentCallsView->mFilter->filterType() == LogsFilter::Missed );
+ QVERIFY( mRecentCallsView->mFilter->filterType() == LogsFilter::Missed );
+ mRecentCallsView->appearByMovingComplete();
+ QVERIFY( mRecentCallsView->mListView->verticalScrollBarPolicy() != HbScrollArea::ScrollBarAlwaysOff );
delete action;
delete mRecentCallsView->mListView;
@@ -395,9 +397,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<QGesture*> list;
QGestureEvent event(list);
event.ignore(Qt::SwipeGesture);
@@ -406,7 +407,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);
@@ -416,86 +418,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
@@ -743,8 +695,8 @@
view->mViewManager.mainWindow().setOrientation( Qt::Vertical );
view->mDialpad->closeDialpad();
view->mListView = &list;
- view->mListView->setLayoutName("dummy");
- view->mLayoutSectionName = "dummy";
+ view->mListView->setLayoutName(QLatin1String("dummy"));
+ view->mLayoutSectionName = QLatin1String("dummy");
view->updateWidgetsSizeAndLayout();
QVERIFY( view->mListView->layoutName() == logsListDefaultLayout );
QVERIFY( view->mLayoutSectionName == logsViewDefaultSection );
@@ -755,12 +707,39 @@
// When dialpad is opened and has input, menu content is different
view->mDialpad->openDialpad();
- QString hello("hello");
+ QLatin1String hello("hello");
view->mDialpad->editor().setText( hello );
view->updateWidgetsSizeAndLayout();
QVERIFY(action && action->isVisible());
}
+
+void UT_LogsRecentCallsView::testGetListItemTextWidth()
+{
+ mRecentCallsView->mListView = new HbListView();
+
+ mRecentCallsView->mViewManager.mainWindow().setOrientation( Qt::Vertical );
+
+ // Default layout
+ mRecentCallsView->mListView->setLayoutName(
+ QLatin1String(logsListDefaultLayout));
+ QCOMPARE( mRecentCallsView->getListItemTextWidth(), 200 );
+
+ // Landscape layout
+ mRecentCallsView->mViewManager.mainWindow().setOrientation( Qt::Horizontal );
+ mRecentCallsView->mListView->setLayoutName(
+ QLatin1String(logsListLandscapeLayout));
+ QCOMPARE( mRecentCallsView->getListItemTextWidth(), 206 );
+
+ // Landscape with dialpad layout
+ mRecentCallsView->mListView->setLayoutName(
+ QLatin1String(logsListLandscapeDialpadLayout));
+ QCOMPARE( mRecentCallsView->getListItemTextWidth(), 206 );
+
+ delete mRecentCallsView->mListView;
+ mRecentCallsView->mListView = 0;
+}
+
void UT_LogsRecentCallsView::testDialpadClosed()
{
HbListView list;
@@ -904,3 +883,28 @@
mRecentCallsView->dialpadOpened();
QVERIFY( mViewManager->mViewId == LogsUnknownViewId );
}
+
+void UT_LogsRecentCallsView::testSaveActivity()
+{
+ QByteArray serializedActivity;
+ QDataStream stream(&serializedActivity, QIODevice::WriteOnly | QIODevice::Append);
+ QVariantHash metaData;
+ mRecentCallsView->mCurrentView = LogsServices::ViewMissed;
+ QVERIFY( mRecentCallsView->saveActivity(stream, metaData) == QString(logsActivityIdViewMissed) );
+ mRecentCallsView->mCurrentView = LogsServices::ViewAll;
+ QVERIFY( mRecentCallsView->saveActivity(stream, metaData) == QString(logsActivityIdViewRecent) );
+
+}
+
+void UT_LogsRecentCallsView::testLoadActivity()
+{
+ QByteArray serializedActivity;
+ QDataStream stream(&serializedActivity, QIODevice::ReadOnly);
+ QVariantHash metaData;
+ QVariant args = mRecentCallsView->loadActivity(QString(logsActivityIdViewCalled), stream, metaData);
+ QVERIFY( !args.isNull() );
+ QVERIFY( args.toInt() == LogsServices::ViewCalled );
+ QVariant args2 = mRecentCallsView->loadActivity(QString(logsActivityIdViewMissed), stream, metaData);
+ QVERIFY( !args2.isNull() );
+ QVERIFY( args2.toInt() == LogsServices::ViewMissed);
+}
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsservicehandler.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsservicehandler.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -18,12 +18,14 @@
//USER
#include "ut_logsservicehandler.h"
#include "logsservicehandler.h"
+#include "logsservicehandlerold.h"
#include "qthighway_stub_helper.h"
#include "ut_logsviewmanager.h"
#include "logsviewmanager.h"
#include "logsmainwindow.h"
#include "logscomponentrepository.h"
#include "logsmatchesview.h"
+#include "logsdefs.h"
//SYSTEM
#include <QtTest/QtTest>
@@ -43,8 +45,9 @@
{
mMainWindow = new LogsMainWindow();
mService = new LogsServiceHandler(*mMainWindow);
+ mServiceOld = new LogsServiceHandlerOld(*mMainWindow);
- mLogsViewManager = new LogsViewManager(*mMainWindow, *mService);
+ mLogsViewManager = new LogsViewManager(*mMainWindow, *mService, *mServiceOld);
}
@@ -52,6 +55,8 @@
{
delete mService;
mService = 0;
+ delete mServiceOld;
+ mServiceOld = 0;
delete mMainWindow;
mMainWindow = 0;
delete mLogsViewManager;
@@ -65,43 +70,101 @@
QVERIFY( mService );
QVERIFY( !mService->mIsAppStartedUsingService );
QVERIFY( !mService->isStartedUsingService() );
+
+ QVERIFY( mServiceOld );
+ QVERIFY( !mServiceOld->mIsAppStartedUsingService );
+ QVERIFY( !mServiceOld->isStartedUsingService() );
+
QtHighwayStubHelper::setIsService(true);
LogsServiceHandler serviceHandler(*mMainWindow);
QVERIFY( serviceHandler.mIsAppStartedUsingService );
QVERIFY( serviceHandler.isStartedUsingService() );
+ LogsServiceHandlerOld serviceHandlerOld(*mMainWindow);
+ QVERIFY( serviceHandlerOld.mIsAppStartedUsingService );
+ QVERIFY( serviceHandlerOld.isStartedUsingService() );
}
void UT_LogsServiceHandler::testStart()
{
qRegisterMetaType< LogsServices::LogsView >("LogsServices::LogsView");
- QSignalSpy spy(mService, SIGNAL(activateView(LogsServices::LogsView, bool)));
+ QSignalSpy spy(mServiceOld, SIGNAL(activateView(LogsServices::LogsView, bool, QString)));
// Wrong view
- QVERIFY( mService->start( 9999, true ) != 0 );
+ QVERIFY( mServiceOld->start( 9999, true ) != 0 );
QVERIFY( spy.count() == 0 );
// Correct view
- mService->mMainWindow.mForeground = false;
- QVERIFY( mService->start( (int)LogsServices::ViewReceived, true ) == 0 );
+ mServiceOld->mMainWindow.mForeground = false;
+ QVERIFY( mServiceOld->start( (int)LogsServices::ViewReceived, true ) == 0 );
QVERIFY( spy.count() == 1 );
LogsServices::LogsView view =
qvariant_cast< LogsServices::LogsView >(spy.at(0).at(0));
QVERIFY( view == LogsServices::ViewReceived );
- QVERIFY( mService->currentlyActivatedView() == LogsServices::ViewReceived );
- QVERIFY( mService->mMainWindow.mForeground );
+ QVERIFY( mServiceOld->mMainWindow.mForeground );
}
void UT_LogsServiceHandler::testStartWithNum()
{
qRegisterMetaType< LogsServices::LogsView >("LogsServices::LogsView");
- QSignalSpy spy2(mService, SIGNAL(activateView(QString)));
+ QSignalSpy spy2(mServiceOld, SIGNAL(activateView(QString)));
- mService->mMainWindow.mForeground = false;
- QVERIFY( mService->startWithNum( (int)LogsServices::ViewReceived, true,
+ mServiceOld->mMainWindow.mForeground = false;
+ QVERIFY( mServiceOld->startWithNum( (int)LogsServices::ViewReceived, true,
QString("+123456") ) == 0 );
QVERIFY( spy2.count() == 1 );
QVERIFY( spy2.at(0).at(0).toString() == QString("+123456"));
- QVERIFY( mService->mMainWindow.mForeground );
+ QVERIFY( mServiceOld->mMainWindow.mForeground );
}
+
+void UT_LogsServiceHandler::testShow()
+{
+ qRegisterMetaType< LogsServices::LogsView >("LogsServices::LogsView");
+ QSignalSpy spy(mService, SIGNAL(activateView(LogsServices::LogsView, bool, QString)));
+ QSignalSpy spy2(mService, SIGNAL(activateView(QString)));
+ QVariantMap map;
+
+ // Wrong view
+ map.insert(logsViewIndexParam, QVariant(9999));
+ QVERIFY( mService->show(map) != 0 );
+ QVERIFY( spy.count() == 0 );
+ QVERIFY( spy2.count() == 0 );
+
+ // Correct view, dialpad text is empty
+ map.clear();
+ map.insert(logsViewIndexParam, QVariant((int)LogsServices::ViewReceived));
+ mService->mMainWindow.mForeground = false;
+ QVERIFY( mService->show(map) == 0 );
+ QVERIFY( spy.count() == 1 );
+ QVERIFY( spy2.count() == 0 );
+ LogsServices::LogsView view =
+ qvariant_cast< LogsServices::LogsView >(spy.at(0).at(0));
+ QVERIFY( view == LogsServices::ViewReceived );
+ QVERIFY( mServiceOld->mMainWindow.mForeground );
+
+ // Correct view, dialpad text not empty
+ spy.clear();
+ map.clear();
+ map.insert(logsViewIndexParam, QVariant((int)LogsServices::ViewReceived));
+ map.insert(logsDialpadTextParam, QVariant(QString("+123456")));
+ mService->mMainWindow.mForeground = false;
+ QVERIFY( mService->show(map) == 0 );
+ QVERIFY( spy.count() == 0 );
+ QVERIFY( spy2.count() == 1 );
+ QVERIFY( spy2.at(0).at(0).toString() == QString("+123456"));
+ QVERIFY( mServiceOld->mMainWindow.mForeground );
+
+ // Some completly dummy parameters or no params at all
+ spy.clear();
+ spy2.clear();
+ map.clear();
+ map.insert("dummy_param", QVariant(666));
+ mService->mMainWindow.mForeground = false;
+ QVERIFY( mService->show(map) == 0 );
+ QVERIFY( spy.count() == 1 );
+ QVERIFY( spy2.count() == 0 );
+ view = qvariant_cast< LogsServices::LogsView >(spy.at(0).at(0));
+ QVERIFY( view == LogsServices::ViewAll );
+ QVERIFY( mServiceOld->mMainWindow.mForeground );
+}
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsviewmanager.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsviewmanager.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -19,6 +19,7 @@
#include "ut_logsviewmanager.h"
#include "logsviewmanager.h"
#include "logsservicehandler.h"
+#include "logsservicehandlerold.h"
#include "logsmainwindow.h"
#include "logscomponentrepository.h"
#include "logsrecentcallsview.h"
@@ -31,10 +32,11 @@
#include <QtTest/QtTest>
#include <HbView.h>
#include <hbapplication.h>
+#include <hbactivitymanager.h>
+#include <dialpad.h>
void UT_LogsViewManager::initTestCase()
{
- //mMainWindow = new LogsMainWindow();
}
void UT_LogsViewManager::cleanupTestCase()
@@ -45,14 +47,19 @@
void UT_LogsViewManager::init()
{
mMainWindow = new LogsMainWindow();
- LogsServiceHandler* service = new LogsServiceHandler(*mMainWindow);
- mLogsViewManager = new LogsViewManager(*mMainWindow, *service);
+ mService = new LogsServiceHandler(*mMainWindow);
+ mServiceOld = new LogsServiceHandlerOld(*mMainWindow);
+ mLogsViewManager = new LogsViewManager(*mMainWindow, *mService, *mServiceOld);
}
void UT_LogsViewManager::cleanup()
{
delete mLogsViewManager;
mLogsViewManager = 0;
+ delete mService;
+ mService = 0;
+ delete mServiceOld;
+ mServiceOld = 0;
delete mMainWindow;
mMainWindow = 0;
}
@@ -61,28 +68,39 @@
{
QVERIFY( mLogsViewManager );
QVERIFY( mLogsViewManager->mComponentsRepository );
- QVERIFY( mLogsViewManager->mMainWindow.viewCount() == 3 );
- QVERIFY( mLogsViewManager->mMainWindow.currentView() == 0 );
- QVERIFY( mLogsViewManager->mViewStack.count() == 3 );
+ QVERIFY( mLogsViewManager->mMainWindow.views().count() == 1 );
+ QVERIFY( mLogsViewManager->mMainWindow.currentView() != 0 );
+ QVERIFY( static_cast<LogsBaseView*>( mLogsViewManager->mMainWindow.currentView() )->viewId() == LogsRecentViewId );
+ QVERIFY( mLogsViewManager->mViewStack.count() == 1 );
delete mLogsViewManager;
mLogsViewManager = 0;
- //TODO: removeView deprecated => this will fail
- //QVERIFY( mMainWindow->viewCount() == 0 );
+
+ // Contructor when activity restoring started the app
+ delete mMainWindow;
+ mMainWindow = 0;
+ mMainWindow = new LogsMainWindow();
+ HbStubHelper::setActivityReason(Hb::ActivationReasonActivity);
+ mLogsViewManager = new LogsViewManager(*mMainWindow, *mService, *mServiceOld);
+ QVERIFY( mLogsViewManager->mComponentsRepository );
+ QVERIFY( static_cast<LogsBaseView*>( mLogsViewManager->mMainWindow.currentView() )->viewId() == LogsRecentViewId );
+ QVERIFY( mLogsViewManager->mViewStack.count() == 1 );
+ HbStubHelper::reset();
}
+
void UT_LogsViewManager::testActivateView()
{
// Activate already active view
QVERIFY( mLogsViewManager->activateView(LogsRecentViewId) );
QVERIFY( mLogsViewManager->activateView(LogsRecentViewId) );
- QVERIFY( mLogsViewManager->mMainWindow.viewCount() == 3 );
+ QCOMPARE( mLogsViewManager->mMainWindow.views().count(), 1 );
QVERIFY( mLogsViewManager->mMainWindow.currentView() ==
mLogsViewManager->mComponentsRepository->recentCallsView() );
// Activate other view
QVERIFY( mLogsViewManager->activateView(LogsDetailsViewId) );
- QVERIFY( mLogsViewManager->mMainWindow.viewCount() == 3 );
+ QVERIFY( mLogsViewManager->mMainWindow.views().count() == 2 );
QVERIFY( mLogsViewManager->mMainWindow.currentView() ==
mLogsViewManager->mComponentsRepository->detailsView() );
QVERIFY( mLogsViewManager->mViewStack.at(0) ==
@@ -90,7 +108,7 @@
// Try to activate unknown view
QVERIFY( !mLogsViewManager->activateView(LogsUnknownViewId) );
- QVERIFY( mLogsViewManager->mMainWindow.viewCount() == 3 );
+ QVERIFY( mLogsViewManager->mMainWindow.views().count() == 2 );
QVERIFY( mLogsViewManager->mMainWindow.currentView() ==
mLogsViewManager->mComponentsRepository->detailsView() );
QVERIFY( mLogsViewManager->mViewStack.at(0) ==
@@ -98,7 +116,7 @@
// Go back to previous view
QVERIFY( mLogsViewManager->activatePreviousView() );
- QVERIFY( mLogsViewManager->mMainWindow.viewCount() == 3 );
+ QVERIFY( mLogsViewManager->mMainWindow.views().count() == 2 );
QVERIFY( mLogsViewManager->mMainWindow.currentView() ==
mLogsViewManager->mComponentsRepository->recentCallsView() );
QVERIFY( mLogsViewManager->mViewStack.at(0) ==
@@ -108,15 +126,32 @@
void UT_LogsViewManager::testchangeMatchesView()
{
//Open Matches view, dialpad visible with predefined number
- mLogsViewManager->changeMatchesView(QString("+123456"));
+ mLogsViewManager->changeMatchesViewViaService(QString("+123456"));
QVERIFY( mLogsViewManager->mMainWindow.currentView() ==
mLogsViewManager->mComponentsRepository->matchesView() );
// Contact search disabled, go to recent calls view instead
mLogsViewManager->mComponentsRepository->mModel->mPredectiveSearchStatus = 0;
- mLogsViewManager->changeMatchesView(QString("+123456777"));
+ QString dialString("+123456777");
+ mLogsViewManager->changeMatchesViewViaService(dialString);
QVERIFY( mLogsViewManager->mMainWindow.currentView() ==
mLogsViewManager->mComponentsRepository->recentCallsView() );
+ QVERIFY( mLogsViewManager->mComponentsRepository->mDialpad->mLineEdit->text() == dialString );
+}
+
+void UT_LogsViewManager::testchangeRecentView()
+{
+ QString dialString("+123456777");
+ mLogsViewManager->changeRecentViewViaService(LogsServices::ViewCalled, false, dialString);
+ QVERIFY( mLogsViewManager->mMainWindow.currentView() ==
+ mLogsViewManager->mComponentsRepository->recentCallsView() );
+ QVERIFY( mLogsViewManager->mComponentsRepository->mDialpad->mLineEdit->text() == dialString );
+
+ // Empty string clears dialpad input
+ mLogsViewManager->changeRecentViewViaService(LogsServices::ViewCalled, false, "");
+ QVERIFY( mLogsViewManager->mMainWindow.currentView() ==
+ mLogsViewManager->mComponentsRepository->recentCallsView() );
+ QVERIFY( mLogsViewManager->mComponentsRepository->mDialpad->mLineEdit->text().isEmpty() );
}
void UT_LogsViewManager::testExitApplication()
@@ -126,7 +161,7 @@
mLogsViewManager->mComponentsRepository->model()->mCompressCalled = false;
mLogsViewManager->mMainWindow.mForeground = true;
mLogsViewManager->exitApplication();
- QVERIFY( mLogsViewManager->mComponentsRepository->model()->mCompressCalled );
+ QVERIFY( HbStubHelper::quitCalled() );
QVERIFY( !mLogsViewManager->mMainWindow.isForeground() );
// Exit not yet possible, app sent only to bg
@@ -135,19 +170,13 @@
mLogsViewManager->mComponentsRepository->recentCallsView()->mMarkingMissedAsSeen = true;
HbStubHelper::reset();
mLogsViewManager->exitApplication();
- QVERIFY( !mLogsViewManager->mComponentsRepository->model()->mCompressCalled );
+ QVERIFY( !HbStubHelper::quitCalled() );
QVERIFY( !mLogsViewManager->mMainWindow.isForeground() );
// Simulate view allowing exit after denying it first
mLogsViewManager->mComponentsRepository->recentCallsView()->mMarkingMissedAsSeen = false;
mLogsViewManager->proceedExit();
- QVERIFY( mLogsViewManager->mComponentsRepository->model()->mCompressCalled );
-}
-
-void UT_LogsViewManager::testAppFocusGained()
-{
- mLogsViewManager->appFocusGained();
- // Nothing to verify
+ QVERIFY( HbStubHelper::quitCalled() );
}
void UT_LogsViewManager::testStartingWithService()
@@ -157,12 +186,13 @@
LogsMainWindow window;
window.setCurrentView(0); // clear stub static data
LogsServiceHandler service(*mMainWindow);
+ LogsServiceHandlerOld serviceOld(*mMainWindow);
service.mIsAppStartedUsingService = true;
- LogsViewManager vm(window, service);
+ LogsViewManager vm(window, service, serviceOld);
QVERIFY( vm.mComponentsRepository );
- QVERIFY( vm.mMainWindow.viewCount() == 3 );
+ QVERIFY( vm.mMainWindow.views().count() == 0 );
QVERIFY( vm.mMainWindow.currentView() == 0 );
- QVERIFY( vm.mViewStack.count() == 3 );
+ QVERIFY( vm.mViewStack.count() == 0 );
}
void UT_LogsViewManager::testHandleOrientationChanged()
@@ -174,7 +204,7 @@
{
// On first activation, wait that view has painted itself once
// before completing activation
- QVERIFY(mLogsViewManager->mFirstActivation);
+ mLogsViewManager->mFirstActivation = true;
mLogsViewManager->activateView(LogsRecentViewId, true, QVariant());
QVERIFY(!mLogsViewManager->mFirstActivation);
QVERIFY(mLogsViewManager->mViewActivationShowDialpad);
@@ -182,3 +212,70 @@
mLogsViewManager->completeViewActivation(); // Simulate paint completion (viewReady signal)
QVERIFY(mLogsViewManager->mComponentsRepository->model()->mMissedCallsCounterCleared);
}
+
+void UT_LogsViewManager::testSaveActivity()
+{
+ mLogsViewManager->activateView(LogsRecentViewId, false, QVariant());
+ HbStubHelper::setActivityReason(Hb::ActivationReasonActivity);
+ HbApplication* hbApp = static_cast<HbApplication*>(qApp);
+ HbActivityManager* manager = hbApp->activityManager();
+ QCOMPARE( manager->activities().count(), 0 );
+ mLogsViewManager->saveActivity();
+ QCOMPARE( manager->activities().count(), 1 );
+ QVERIFY( !manager->activities().at(0).value(logsActivityParamShowDialpad).toBool() );
+ QVERIFY( manager->activities().at(0).value(logsActivityParamDialpadText).toString().isEmpty() );
+ QCOMPARE( manager->activities().at(0).value(logsActivityParamInternalViewId).toInt(), (int)LogsRecentViewId );
+
+ // Make sure that only one activity is reported
+ mLogsViewManager->mComponentsRepository->dialpad()->mIsOpen = true;
+ mLogsViewManager->mComponentsRepository->dialpad()->mLineEdit->setText("12345");
+ mLogsViewManager->saveActivity();
+ QCOMPARE( manager->activities().count(), 1 );
+ QVERIFY( manager->activities().at(0).value(logsActivityParamShowDialpad).toBool() );
+ QCOMPARE( manager->activities().at(0).value(logsActivityParamDialpadText).toString(), QString("12345") );
+ QCOMPARE( manager->activities().at(0).value(logsActivityParamInternalViewId).toInt(), (int)LogsMatchesViewId );
+
+ // No views, nothing to save
+ mLogsViewManager->mViewStack.clear();
+ mLogsViewManager->saveActivity();
+ QCOMPARE( manager->activities().count(), 1 );
+}
+
+void UT_LogsViewManager::testLoadActivity()
+{
+ mLogsViewManager->mComponentsRepository->mModel->mPredectiveSearchStatus = 1;
+ HbStubHelper::setActivityReason(Hb::ActivationReasonActivity);
+ HbApplication* hbApp = static_cast<HbApplication*>(qApp);
+ HbActivityManager* manager = hbApp->activityManager();
+
+ // View activity loaded, no dialpad shown, nor text in it
+ HbStubHelper::setActivityId(logsActivityIdViewRecent);
+ mLogsViewManager->mComponentsRepository->dialpad()->mIsOpen = false;
+ mLogsViewManager->mComponentsRepository->dialpad()->mLineEdit->setText("");
+ QVariantHash params;
+ params.insert(logsActivityParamShowDialpad, false);
+ params.insert(logsActivityParamDialpadText, QString(""));
+ params.insert(logsActivityParamInternalViewId, LogsRecentViewId);
+ manager->addActivity(QString(), QVariant(), params);
+ QVERIFY( mLogsViewManager->loadActivity() );
+ QVERIFY( static_cast<LogsBaseView*>( mLogsViewManager->mMainWindow.currentView() )->viewId() == LogsRecentViewId );
+ QVERIFY( !mLogsViewManager->mComponentsRepository->dialpad()->mIsOpen );
+ QCOMPARE( mLogsViewManager->mComponentsRepository->dialpad()->mLineEdit->text(), QString("") );
+
+ // Other activity loaded, show dialpad with text
+ HbStubHelper::setActivityId(logsActivityIdViewMatches);
+ manager->removeActivity(QString());
+ QVariantHash params2;
+ params2.insert(logsActivityParamShowDialpad, true);
+ params2.insert(logsActivityParamDialpadText, QString("33333"));
+ params.insert(logsActivityParamInternalViewId, LogsMatchesViewId);
+ manager->addActivity(QString(), QVariant(), params2);
+ QVERIFY( mLogsViewManager->loadActivity() );
+ QVERIFY( static_cast<LogsBaseView*>( mLogsViewManager->mMainWindow.currentView() )->viewId() == LogsMatchesViewId );
+ QVERIFY( mLogsViewManager->mComponentsRepository->dialpad()->mIsOpen );
+ QCOMPARE( mLogsViewManager->mComponentsRepository->dialpad()->mLineEdit->text(), QString("33333") );
+
+ // View activity not loaded
+ HbStubHelper::setActivityId("unknownActivity");
+ QVERIFY( !mLogsViewManager->loadActivity() );
+}
--- a/logsui/logsapp/tsrc/ut_logsapp/stubs/hbapplication.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/hbapplication.h Thu Jul 22 16:33:49 2010 +0100
@@ -20,12 +20,20 @@
#include <qobject.h>
#include <qglobal.h>
-class HbApplication : public QObject
+class HbActivityManager;
+
+class HbApplication : public QApplication
{
public:
HbApplication(int &/*argc*/, char */*argv*/[]);
~HbApplication();
+ HbActivityManager *activityManager();
+ Hb::ActivationReason activateReason() const;
+ QVariantHash activateParams() const;
+ QString activateId() const;
+ QVariant activateData();
+
static void quit();
};
--- a/logsui/logsapp/tsrc/ut_logsapp/stubs/hbstubs.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/hbstubs.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -22,9 +22,15 @@
#include "hbstubs_helper.h"
#include <hbmessagebox.h>
#include <hbapplication.h>
+#include <hbcolorscheme.h>
+#include <hbview.h>
+#include <hbactivitymanager.h>
#include <QCoreApplication>
+#include <QApplication>
#include <QTimer>
#include <QGesture>
+#include <hblistview.h>
+#include <hblistviewitem.h>
int actionCount = 0;
Qt::Orientation windowOrientation = Qt::Vertical;
@@ -40,6 +46,15 @@
Qt::GestureState testState = Qt::NoGesture;
bool testIsWidgetOpen = false;
bool testIsWidgetRaised = false;
+QColor testColor = Qt::white;
+QList<HbView *> testViews;
+QList<QVariantHash> testActivities;
+HbActivityManager testActivityManager;
+Hb::ActivationReason testActivationReason = Hb::ActivationReasonNormal;
+QString testActivityId = "LogsViewMatches";
+QList<HbListViewItem*> testViewItems;
+bool testEnsureVisibleCalled = false;
+bool testScrollToCalled = false;
void HbStubHelper::reset()
{
@@ -49,10 +64,16 @@
testQuitCalled = false;
testIsWidgetRaised = false;
testDialogShown = false;
+ testColor = Qt::white;
+ testActivationReason = Hb::ActivationReasonNormal;
+ testActivityId = "LogsViewMatches";
+ testActivities.clear();
+ qDeleteAll(testViewItems);
+ testViewItems.clear();
+ testScrollToCalled = false;
+ testEnsureVisibleCalled = false;
}
-
-
int HbStubHelper::widgetActionsCount()
{
return actionCount;
@@ -106,6 +127,62 @@
testIsWidgetOpen = isOpen;
}
+void HbStubHelper::setColorScheme(QColor col)
+{
+ testColor = col;
+}
+
+void HbStubHelper::setActivityReason(Hb::ActivationReason reason)
+{
+ testActivationReason = reason;
+}
+
+void HbStubHelper::setActivityId(QString activityId)
+{
+ testActivityId = activityId;
+}
+
+QList<HbListViewItem*>& HbStubHelper::listItems()
+{
+ return testViewItems;
+}
+
+bool HbStubHelper::listScrollToCalled()
+{
+ return testScrollToCalled;
+}
+
+bool HbStubHelper::listEnsureVisibleCalled()
+{
+ return testEnsureVisibleCalled;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QCoreApplication::QCoreApplication(int &argc, char **argv)
+{
+
+}
+
+
+void QCoreApplication::quit()
+{
+ testQuitCalled = true;
+}
+
+QApplication::QApplication(QApplication::QS60MainApplicationFactory factory, int &argc, char **argv, int version)
+: QCoreApplication(argc, argv)
+{
+
+}
+
+QApplication::~QApplication()
+{
+
+}
+
bool QGraphicsWidget::close()
{
testIsWidgetOpen = false;
@@ -121,11 +198,52 @@
testIsWidgetRaised = true;
}
+QPixmap QPixmap::grabWidget(QWidget *widget, const QRect &rect)
+{
+ Q_UNUSED(widget);
+ Q_UNUSED(rect);
+ return QPixmap();
+}
+
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
-HbApplication::HbApplication(int &/*argc*/, char */*argv*/[])
+HbActivityManager::HbActivityManager(QObject *parent) : QObject(parent)
+{
+
+}
+HbActivityManager::~HbActivityManager()
+{
+
+}
+
+bool HbActivityManager::addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters)
+{
+ testActivities.append(parameters);
+}
+bool HbActivityManager::removeActivity(const QString &activityId)
+{
+ if ( !testActivities.isEmpty() ){
+ testActivities.takeFirst();
+ }
+}
+QList<QVariantHash> HbActivityManager::activities() const
+{
+ return testActivities;
+}
+
+bool HbActivityManager::waitActivity()
+{
+ return true;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+HbApplication::HbApplication(int &argc, char *argv[]) :
+ QApplication(0, argc, argv, 0)
{
}
@@ -138,9 +256,26 @@
testQuitCalled = true;
}
-void QCoreApplication::quit()
+HbActivityManager *HbApplication::activityManager()
+{
+ return &testActivityManager;
+}
+
+Hb::ActivationReason HbApplication::activateReason() const
{
- testQuitCalled = true;
+ return testActivationReason;
+}
+QVariantHash HbApplication::activateParams() const
+{
+ return QVariantHash();
+}
+QString HbApplication::activateId() const
+{
+ return testActivityId;
+}
+QVariant HbApplication::activateData()
+{
+ return QVariant();
}
// -----------------------------------------------------------------------------
@@ -182,6 +317,7 @@
Q_UNUSED(windowFlags)
testViewCount = 0;
testWindow = this;
+ testViews.clear();
}
HbMainWindow::~HbMainWindow()
@@ -191,7 +327,7 @@
void HbMainWindow::setOrientation(Qt::Orientation orientation, bool animate)
{
- Q_UNUSED(animate)
+ Q_UNUSED(animate)
windowOrientation = orientation;
}
@@ -202,26 +338,30 @@
QRectF HbMainWindow::layoutRect() const
{
- return QRectF(0, 0, 100,100);
+ if (windowOrientation == Qt::Vertical) {
+ return QRectF(0, 0, 360, 640);
+ } else {
+ return QRectF(0, 0, 640, 360);
+ }
}
HbView *HbMainWindow::addView(QGraphicsWidget *widget)
{
- Q_UNUSED(widget)
testViewCount++;
+ testViews.append( static_cast<HbView*>(widget) );
}
void HbMainWindow::setCurrentView(HbView *view, bool animate, Hb::ViewSwitchFlags flags)
{
- Q_UNUSED(animate)
Q_UNUSED(flags)
testView = view;
}
-int HbMainWindow::viewCount() const
+QList<HbView *> HbMainWindow::views() const
{
- return testViewCount;
+ return testViews;
}
+
HbView *HbMainWindow::currentView() const
{
return testView;
@@ -256,26 +396,68 @@
void HbMessageBox::setText(const QString &string)
{
-
if (string == "Ok") {
selectedActionString = "primary";
} else if (string == "Cancel") {
selectedActionString = "secondary";
}
-
-}
-
-
-HbAction *HbDialog::exec()
-{
- if (selectedActionString == "primary") {
- return primaryAction();
- } else {
- return 0;
- }
}
void QTimer::singleShot(int msec, QObject *receiver, const char *member)
{
testSingleShotTimer = true;
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+bool HbStyle::parameter(const QString ¶meter, qreal &value, const HbDeviceProfile &profile) const
+{
+ Q_UNUSED( profile );
+ value = parameter.length();
+ return true;
+}
+
+
+QColor HbColorScheme::color( const QString &colorRole )
+{
+ Q_UNUSED(colorRole);
+ return testColor;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void HbListView::scrollTo(const QModelIndex &index, ScrollHint hint)
+{
+ Q_UNUSED(index);
+ Q_UNUSED(hint);
+ testScrollToCalled = true;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QList<HbAbstractViewItem *> HbAbstractItemView::visibleItems() const
+{
+ QList<HbAbstractViewItem*> visible;
+ foreach ( HbListViewItem* item, testViewItems ){
+ visible.append( item );
+ }
+ return visible;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void HbScrollArea::ensureVisible(const QPointF &position, qreal xMargin, qreal yMargin)
+{
+ Q_UNUSED(position);
+ Q_UNUSED(xMargin);
+ Q_UNUSED(yMargin);
+ testEnsureVisibleCalled = true;
+}
--- a/logsui/logsapp/tsrc/ut_logsapp/stubs/hbstubs_helper.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/hbstubs_helper.h Thu Jul 22 16:33:49 2010 +0100
@@ -17,6 +17,9 @@
#ifndef HBSTUB_HELPER_H
#define HBSTUB_HELPER_H
+
+class HbListViewItem;
+
/**
* Helper class to control logsdbconnector stub behavior
*
@@ -34,6 +37,12 @@
static void setWidgetOpen(bool isOpen);
static bool isWidgetOpen();
static bool isWidgetRaised();
+ static void setColorScheme(QColor col);
+ static void setActivityReason(Hb::ActivationReason reason);
+ static void setActivityId(QString activityId);
+ static QList<HbListViewItem*>& listItems();
+ static bool listScrollToCalled();
+ static bool listEnsureVisibleCalled();
};
#endif
--- a/logsui/logsapp/tsrc/ut_logsapp/stubs/qthighway_stub.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/qthighway_stub.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -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)
+}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
--- a/logsui/logsapp/tsrc/ut_logsapp/ut_logsapp.pro Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsapp/tsrc/ut_logsapp/ut_logsapp.pro Thu Jul 22 16:33:49 2010 +0100
@@ -48,21 +48,22 @@
HEADERS += inc/ut_logseffecthandler.h
HEADERS += inc/ut_logspageindicator.h
HEADERS += inc/ut_logspageindicatoritem.h
+HEADERS += inc/ut_logsservicehandler.h
HEADERS += ../../inc/logsmainwindow.h
HEADERS += ../../inc/logsviewmanager.h
+HEADERS += ../../inc/logscomponentrepository.h
HEADERS += ../../inc/logsrecentcallsview.h
HEADERS += ../../inc/logsbaseview.h
HEADERS += ../../inc/logsdetailsview.h
HEADERS += ../../inc/logsmatchesview.h
HEADERS += ../../inc/logsservicehandler.h
+HEADERS += ../../inc/logsservicehandlerold.h
HEADERS += ../../inc/logseffecthandler.h
HEADERS += ../../inc/logspageindicator.h
HEADERS += ../../inc/logspageindicatoritem.h
#HEADERS += ../../../logsengine/inc/logscommondata.h
HEADERS += ../../../logsengine/inc/logsconfigurationparams.h
-HEADERS += inc/ut_logsservicehandler.h
HEADERS += logsengine_stub/logscontact.h
-HEADERS += logsengine_stub/logsforegroundwatcher.h
HEADERS += ./stubs/dialpad.h
HEADERS += ./stubs/dialpadkeyhandler.h
@@ -82,7 +83,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
@@ -97,6 +97,7 @@
SOURCES += ../../src/logsdetailsview.cpp
SOURCES += ../../src/logsmatchesview.cpp
SOURCES += ../../src/logsservicehandler.cpp
+SOURCES += ../../src/logsservicehandlerold.cpp
SOURCES += ../../src/logseffecthandler.cpp
SOURCES += ../../src/logspageindicator.cpp
SOURCES += ../../src/logspageindicatoritem.cpp
--- a/logsui/logscntfinder/inc/logscntentry.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/inc/logscntentry.h Thu Jul 22 16:33:49 2010 +0100
@@ -91,6 +91,8 @@
void resetHighlights( LogsCntTextList& nameArray );
bool doSimpleMatch( const QString& pattern ) const;
bool doComplexMatch( QStringList patternArray ) const;
+ int startsWith( const LogsCntText& nameItem, const QString& pattern,
+ bool optimize = true ) const;
private:
--- a/logsui/logscntfinder/inc/logspredictive12keytranslator.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/inc/logspredictive12keytranslator.h Thu Jul 22 16:33:49 2010 +0100
@@ -34,7 +34,6 @@
public:
- explicit LogsPredictive12KeyTranslator();
~LogsPredictive12KeyTranslator();
public: //from LogsPredictiveTranslator
@@ -42,7 +41,11 @@
QStringList patternTokens( const QString& pattern ) const;
int hasPatternSeparators( const QString& pattern ) const;
const QChar translateChar( const QChar character ) const;
+
+protected:
+ explicit LogsPredictive12KeyTranslator( const HbInputLanguage& lang );
+
private:
void padWithZeros( QString& token, const QString& source, int padIndex ) const;
--- a/logsui/logscntfinder/inc/logspredictivelatin12keytranslator.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/inc/logspredictivelatin12keytranslator.h Thu Jul 22 16:33:49 2010 +0100
@@ -23,7 +23,12 @@
#include <QHash>
#include "logspredictive12keytranslator.h"
+class HbInputLanguage;
+//Name: ISO_8859-1:1987 [RFC1345,KXS2]
+//MIBenum: 4
+//Source: ECMA registry
+const int MIBenumLatin = 4;
/**
* translator for Latin ITU-T 12 keys keyboard
@@ -35,17 +40,23 @@
public:
explicit LogsPredictiveLatin12KeyTranslator();
+ explicit LogsPredictiveLatin12KeyTranslator( const HbInputLanguage& lang );
~LogsPredictiveLatin12KeyTranslator();
public: //from LogsPredictiveTranslator
QStringList nameTokens( const QString& name ) const;
+ inline int mib() const {return MIBenumLatin;}
+
public: //from LogsPredictive12KeyTranslator
- const QChar translateChar( const QChar character ) const;
+ const QChar translateChar( const QChar character, bool& ok ) const;
-
+private:
+
+ void createSpecialMapping();
+
private:
QHash<QChar,QChar> mSpecialKeyMap;
--- a/logsui/logscntfinder/inc/logspredictivethai12keytranslator.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/inc/logspredictivethai12keytranslator.h Thu Jul 22 16:33:49 2010 +0100
@@ -25,6 +25,14 @@
#include "logspredictive12keytranslator.h"
class HbKeymap;
+class HbInputLanguage;
+
+
+//Name: TIS-620
+//MIBenum: 2259
+//Source: Thai Industrial Standards Institute (TISI) [Tantsetthi]
+const int MIBenumThai = 2259;
+
/**
@@ -37,13 +45,15 @@
public:
explicit LogsPredictiveThai12KeyTranslator();
+ explicit LogsPredictiveThai12KeyTranslator( const HbInputLanguage& lang );
~LogsPredictiveThai12KeyTranslator();
public: //from LogsPredictiveTranslator
- const QChar translateChar( const QChar character ) const;
+ const QChar translateChar( const QChar character, bool& ok ) const;
QStringList nameTokens( const QString& name ) const;
-
+ inline int mib() const {return MIBenumThai;}
+
private:
bool isIgnored( const QChar character ) const;
--- a/logsui/logscntfinder/inc/logspredictivetranslator.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/inc/logspredictivetranslator.h Thu Jul 22 16:33:49 2010 +0100
@@ -20,8 +20,10 @@
#include <QObject>
#include <QChar>
+#include <QList>
class HbKeymap;
+class HbInputLanguage;
/**
* predictive translator. Singelton
@@ -37,27 +39,34 @@
~LogsPredictiveTranslator();
- const QString translate( const QString& name, int count = -1 ) const;
- int startsWith( const QString& text, const QString& pattern,
- bool optimize = true ) const;
+ const QString translatePattern( const QString& pattern ) const;
+ const QString translateText( const QString& text );
public: //abstracts
virtual QStringList nameTokens( const QString& name ) const = 0;
virtual QStringList patternTokens( const QString& pattern ) const = 0;
virtual int hasPatternSeparators( const QString& pattern ) const = 0;
- virtual const QChar translateChar( const QChar character ) const = 0;
+ virtual const QChar translateChar( const QChar character, bool& ok ) const = 0;
+ virtual int mib() const = 0;
protected:
- explicit LogsPredictiveTranslator();
-
+ explicit LogsPredictiveTranslator( const HbInputLanguage& lang );
+ bool encodes( const QString& sniplet );
+ const QString translate( const QString& text, bool* ok = 0, int count = -1 ) const;
+
+private:
+
+ const LogsPredictiveTranslator& nameTranslator( const QString& name );
+
protected:
const HbKeymap* mKeyMap;
private:
+ LogsPredictiveTranslator* mNameTranslator;
static LogsPredictiveTranslator* mInstance;
friend class UT_LogsPredictiveTranslator;
--- a/logsui/logscntfinder/logscntfinder.pro Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/logscntfinder.pro Thu Jul 22 16:33:49 2010 +0100
@@ -26,6 +26,7 @@
INCLUDEPATH += ../inc
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+DEFINES += QT_NO_DEBUG_OUTPUT
# Input
HEADERS += inc/logscntfinder.h
--- a/logsui/logscntfinder/src/logscntentry.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/src/logscntentry.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -203,7 +203,7 @@
mCached=true;
mPhoneNumber.mText = number;
- mPhoneNumber.mTranslatedText = translator->translate( mPhoneNumber.mText );
+ mPhoneNumber.mTranslatedText = translator->translateText( mPhoneNumber.mText );
}
@@ -221,7 +221,7 @@
while( iter.hasNext() ) {
LogsCntText txt;
txt.mText = iter.next();
- txt.mTranslatedText = translator->translate( txt.mText );
+ txt.mTranslatedText = translator->translateText( txt.mText );
textlist.append( txt );
}
if ( textlist.count() == 0 ) {
@@ -278,8 +278,8 @@
//simple
while( names.hasNext() ) {
LogsCntText& nameItem = names.next();
- nameItem.mHighlights =
- translator->startsWith( nameItem.mText, pattern, false );
+ //must use non-optimized version with whole pattern
+ nameItem.mHighlights = startsWith( nameItem, pattern, false );
}
//complex
@@ -289,14 +289,42 @@
names.toFront();
while( names.hasNext() ) {
LogsCntText& nameItem = names.next();
- int matchSize = translator->startsWith( nameItem.mText,
- patternItem, !hasSeparators );
+ int matchSize = startsWith( nameItem, patternItem, !hasSeparators );
nameItem.mHighlights = matchSize > nameItem.mHighlights ?
matchSize : nameItem.mHighlights;
}
}
}
+
+// -----------------------------------------------------------------------------
+// LogsCntEntry::startsWith()
+// -----------------------------------------------------------------------------
+//
+int LogsCntEntry::startsWith( const LogsCntText& nameItem,
+ const QString& pattern, bool optimize ) const
+{
+ LOGS_QDEBUG( "logs [FINDER] -> LogsCntEntry::startsWith()" )
+ //assumed that text has found based on pattern, thus only checking with
+ //first char is enough, if mightContainZeroes eq false
+ const QString& text = nameItem.mTranslatedText;
+
+ int matchCount = pattern.length();
+ if ( text.isEmpty() || matchCount > text.length() ) {
+ matchCount = 0;
+ } else {
+ if ( !optimize ) {
+ matchCount = text.startsWith( pattern ) ? matchCount : 0;
+ } else {
+ matchCount = *text.data() == *pattern.data() ?
+ matchCount : 0;
+ }
+ }
+ LOGS_QDEBUG( "logs [FINDER] -> LogsCntEntry::startsWith()" )
+ return matchCount;
+}
+
+
// -----------------------------------------------------------------------------
// LogsCntEntry::setSpeedDial()
// -----------------------------------------------------------------------------
--- a/logsui/logscntfinder/src/logscntfinder.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/src/logscntfinder.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -1,4 +1,4 @@
-/*
+ /*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
@@ -273,7 +273,7 @@
LogsPredictiveTranslator::instance();
mCurrentInputPattern = pattern;
- mCurrentPredictivePattern = translator->translate( mCurrentInputPattern );
+ mCurrentPredictivePattern = translator->translatePattern( mCurrentInputPattern );
}
@@ -300,18 +300,15 @@
LOGS_QDEBUG_2( "logs [FINDER] caching from DB cid=", entry->contactId() )
QContact contact = mContactManager->contact( entry->contactId() );
QContactName contactName = contact.detail( QContactName::DefinitionName );
- entry->setFirstName( contactName.value( QContactName::FieldFirst ) );
- entry->setLastName( contactName.value( QContactName::FieldLast ) );
+ entry->setFirstName( contactName.value( QContactName::FieldFirstName ) );
+ entry->setLastName( contactName.value( QContactName::FieldLastName ) );
QContactPhoneNumber contactPhoneNumber =
contact.detail( QContactPhoneNumber::DefinitionName );
entry->setPhoneNumber(
contactPhoneNumber.value( QContactPhoneNumber::FieldNumber ) );
- QContactAvatar contactAvatar = contact.detail<QContactAvatar>();
- if (contactAvatar.subType().compare(
- QLatin1String(QContactAvatar::SubTypeImage)) == 0 &&
- !contactAvatar.avatar().isEmpty()) {
- entry->setAvatarPath(contactAvatar.avatar());
- }
+ QContactAvatar contactAvatar = contact.detail<QContactAvatar>();
+ QString avatar = contactAvatar.value( QContactAvatar::FieldImageUrl );
+ entry->setAvatarPath( avatar );
updateResult( entry );
}
--- a/logsui/logscntfinder/src/logspredictive12keytranslator.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/src/logspredictive12keytranslator.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -31,8 +31,9 @@
// LogsPredictive12KeyTranslator::LogsPredictive12KeyTranslator()
// -----------------------------------------------------------------------------
//
-LogsPredictive12KeyTranslator::LogsPredictive12KeyTranslator()
- : LogsPredictiveTranslator()
+LogsPredictive12KeyTranslator::LogsPredictive12KeyTranslator(
+ const HbInputLanguage& lang )
+ : LogsPredictiveTranslator( lang )
{
LOGS_QDEBUG( "logs [FINDER] -> LogsPredictive12KeyTranslator::\
LogsPredictive12KeyTranslator()" )
@@ -60,15 +61,28 @@
//
QStringList LogsPredictive12KeyTranslator::patternTokens( const QString& pattern ) const
{
+ LOGS_QDEBUG( "logs [FINDER] -> LogsPredictive12KeyTranslator::\
+patternTokens()" )
+ LOGS_QDEBUG_2( "logs [FINDER] pattern ", pattern );
+
QStringList target = pattern.split( ZeroSepar, QString::SkipEmptyParts );
if ( target.length() > 1 ) {
+ LOGS_QDEBUG( "logs [FINDER] has separator(s) " )
QString& first = target[0];
QString& last = target[target.length()-1];
padWithZeros( first, pattern, 0 );
padWithZeros( last, pattern, last.length() );
+ } else if ( target.length() == 1 && //0280 -> 028
+ pattern[pattern.length()-1] == ZeroSepar ) {
+ LOGS_QDEBUG( "logs [FINDER] no separators, trailing zero(s) " )
+ QString& first = target[0];
+ padWithZeros( first, pattern, 0 );
} else if ( target.length() == 0 ) {
+ LOGS_QDEBUG( "logs [FINDER] only separators " )
target.append( ZeroSepar );
}
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictive12KeyTranslator::\
+patternTokens()" )
return target;
}
--- a/logsui/logscntfinder/src/logspredictivelatin12keytranslator.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/src/logspredictivelatin12keytranslator.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -17,9 +17,9 @@
#include <QObject>
#include <QLocale>
#include <QHash>
-#include <hbinputkeymapfactory.h>
#include <hbinputkeymap.h>
#include <hbinputsettingproxy.h>
+#include <QTextCodec>
#include "logspredictivelatin12keytranslator.h"
#include "logslogger.h"
@@ -34,16 +34,41 @@
// LogsPredictiveLatin12KeyTranslator::LogsPredictiveLatin12KeyTranslator()
// -----------------------------------------------------------------------------
//
-LogsPredictiveLatin12KeyTranslator::LogsPredictiveLatin12KeyTranslator()
- : LogsPredictive12KeyTranslator()
+LogsPredictiveLatin12KeyTranslator::LogsPredictiveLatin12KeyTranslator()
+ : LogsPredictive12KeyTranslator( QLocale::English )
{
LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveLatin12KeyTranslator::\
LogsPredictiveLatin12KeyTranslator()" )
- HbInputLanguage lang =
- HbInputSettingProxy::instance()->globalInputLanguage();
- mKeyMap = HbKeymapFactory::instance()->keymap( lang.language(),
- lang.variant() );
+
+ createSpecialMapping();
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveLatin12KeyTranslator::\
+LogsPredictiveLatin12KeyTranslator()" )
+}
+
+
+// -----------------------------------------------------------------------------
+// LogsPredictiveLatin12KeyTranslator::LogsPredictiveLatin12KeyTranslator()
+// -----------------------------------------------------------------------------
+//
+LogsPredictiveLatin12KeyTranslator::LogsPredictiveLatin12KeyTranslator(
+ const HbInputLanguage& lang )
+ : LogsPredictive12KeyTranslator( lang )
+{
+ LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveLatin12KeyTranslator::\
+LogsPredictiveLatin12KeyTranslator()" )
+ createSpecialMapping();
+
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveLatin12KeyTranslator::\
+LogsPredictiveLatin12KeyTranslator()" )
+}
+
+// -----------------------------------------------------------------------------
+// LogsPredictiveLatin12KeyTranslator::createSpecialMapping()
+// -----------------------------------------------------------------------------
+//
+void LogsPredictiveLatin12KeyTranslator::createSpecialMapping()
+{
int index = 0;
int arraySize = SpecialsCount * 2;
while( index < arraySize ) {
@@ -52,11 +77,8 @@
mSpecialKeyMap[ character ] = keycode;
}
- LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveLatin12KeyTranslator::\
-LogsPredictiveLatin12KeyTranslator()" )
}
-
// -----------------------------------------------------------------------------
// LogsPredictiveLatin12KeyTranslator::~LogsPredictiveLatin12KeyTranslator()
// -----------------------------------------------------------------------------
@@ -76,17 +98,20 @@
// -----------------------------------------------------------------------------
//
const QChar LogsPredictiveLatin12KeyTranslator::translateChar(
- const QChar character ) const
+ const QChar character,
+ bool& ok ) const
{
+ ok = true;
QChar keycode = mSpecialKeyMap[ character ];
if ( keycode.isNull() ) {
keycode = LogsPredictive12KeyTranslator::translateChar( character );
if ( keycode.isNull() ) {
QString decomposed = character.decomposition();
if (decomposed.isEmpty()) {
+ ok = false;
return keycode;
}
- return translateChar (decomposed.at(0));
+ return translateChar (decomposed.at(0), ok);
}
}
return keycode;
@@ -103,4 +128,9 @@
{
return name.split( SpaceSepar, QString::SkipEmptyParts );
}
-
+
+
+
+
+
+
--- a/logsui/logscntfinder/src/logspredictivethai12keytranslator.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/src/logspredictivethai12keytranslator.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -19,6 +19,7 @@
#include <hbinputkeymapfactory.h>
#include <hbinputkeymap.h>
#include <hbinputsettingproxy.h>
+#include <QTextCodec>
#include "logspredictivethai12keytranslator.h"
#include "logslogger.h"
@@ -27,26 +28,35 @@
const int IgnoreCount = 2;
+
+
// -----------------------------------------------------------------------------
// LogsPredictiveThai12KeyTranslator::LogsPredictiveThai12KeyTranslator()
// -----------------------------------------------------------------------------
//
LogsPredictiveThai12KeyTranslator::LogsPredictiveThai12KeyTranslator()
- : LogsPredictive12KeyTranslator()
+ : LogsPredictive12KeyTranslator( QLocale::Thai )
{
LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveThai12KeyTranslator::\
LogsPredictiveThai12KeyTranslator()" )
- HbInputLanguage lang =
- HbInputSettingProxy::instance()->globalInputLanguage();
- ASSERT( lang.language() == QLocale::Thai );
- mKeyMap = HbKeymapFactory::instance()->keymap( lang.language(),
- lang.variant() );
-
-
LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveThai12KeyTranslator::\
LogsPredictiveThai12KeyTranslator()" )
}
+// -----------------------------------------------------------------------------
+// LogsPredictiveThai12KeyTranslator::LogsPredictiveThai12KeyTranslator()
+// -----------------------------------------------------------------------------
+//
+LogsPredictiveThai12KeyTranslator::LogsPredictiveThai12KeyTranslator(
+ const HbInputLanguage& lang )
+ : LogsPredictive12KeyTranslator( lang )
+{
+ LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveThai12KeyTranslator::\
+LogsPredictiveThai12KeyTranslator()" )
+ ASSERT( lang.language() == QLocale::Thai );
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveThai12KeyTranslator::\
+LogsPredictiveThai12KeyTranslator()" )
+}
// -----------------------------------------------------------------------------
// LogsPredictiveThai12KeyTranslator::~LogsPredictiveThai12KeyTranslator()
@@ -66,11 +76,14 @@
// -----------------------------------------------------------------------------
//
const QChar LogsPredictiveThai12KeyTranslator::translateChar(
- const QChar character ) const
+ const QChar character,
+ bool& ok ) const
{
+ ok = true;
QChar keycode;
if ( !isIgnored( character ) ) {
keycode = LogsPredictive12KeyTranslator::translateChar( character );
+ ok = !keycode.isNull();
keycode = !keycode.isNull() && !isIgnored( keycode ) ?
keycode : QChar();
}
@@ -102,8 +115,3 @@
}
return found;
}
-
-
-
-
-
--- a/logsui/logscntfinder/src/logspredictivetranslator.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/src/logspredictivetranslator.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -17,8 +17,10 @@
#include <QObject>
#include <QLocale>
#include <QHash>
+#include <hbinputkeymapfactory.h>
#include <hbinputsettingproxy.h>
#include <QStringList>
+#include <QTextCodec>
#include "logspredictivetranslator.h"
#include "logspredictivelatin12keytranslator.h"
@@ -34,18 +36,24 @@
//
LogsPredictiveTranslator* LogsPredictiveTranslator::instance()
{
+ LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveTranslator::\
+instance()" )
if ( !mInstance ) {
HbInputLanguage lang =
HbInputSettingProxy::instance()->globalInputLanguage();
+ LOGS_QDEBUG_2( "logs [FINDER] Input lang is %d",
+ lang.language() )
switch( lang.language() ) {
case QLocale::Thai:
- mInstance = new LogsPredictiveThai12KeyTranslator();
+ mInstance = new LogsPredictiveThai12KeyTranslator( lang );
break;
default:
- mInstance = new LogsPredictiveLatin12KeyTranslator();
+ mInstance = new LogsPredictiveLatin12KeyTranslator( lang );
break;
}
}
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::\
+instance()" )
return mInstance;
}
@@ -64,10 +72,16 @@
// LogsPredictiveTranslator::LogsPredictiveTranslator()
// -----------------------------------------------------------------------------
//
-LogsPredictiveTranslator::LogsPredictiveTranslator()
+LogsPredictiveTranslator::LogsPredictiveTranslator( const HbInputLanguage& lang )
+ : mNameTranslator(0)
+
{
LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveTranslator::\
LogsPredictiveTranslator()" )
+
+ mKeyMap = HbKeymapFactory::instance()->keymap( lang.language(),
+ lang.variant() );
+
LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::\
LogsPredictiveTranslator()" )
}
@@ -83,62 +97,132 @@
~LogsPredictiveTranslator()" )
mInstance = 0;
mKeyMap = 0;
+ delete mNameTranslator;
+ mNameTranslator = 0;
LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::\
~LogsPredictiveTranslator()" )
}
// -----------------------------------------------------------------------------
+// LogsPredictiveTranslator::translateText()
+// -----------------------------------------------------------------------------
+//
+const QString LogsPredictiveTranslator::translateText(
+ const QString& text )
+{
+ LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveTranslator::translateText()" )
+ LOGS_QDEBUG_2( "logs [FINDER] text ", text );
+
+ bool ok;
+
+ QString result = translate( text, &ok );
+ if ( !ok ) {
+ LOGS_QDEBUG( "logs [FINDER] Text is not in input language" )
+ result = nameTranslator( text ).translate( text );
+ }
+
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::translateText()" )
+ return result;
+}
+
+// -----------------------------------------------------------------------------
+// LogsPredictiveTranslator::nameTranslator()
+// -----------------------------------------------------------------------------
+//
+const LogsPredictiveTranslator& LogsPredictiveTranslator::nameTranslator(
+ const QString& name )
+{
+ LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveTranslator::nameTranslator()" )
+
+ const LogsPredictiveTranslator* nameTranslator = this;
+ if ( mNameTranslator && mNameTranslator->encodes( name ) ) {
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::\
+nameTranslator() - use current" )
+ nameTranslator = mNameTranslator;
+ } else {
+ delete mNameTranslator;
+ mNameTranslator = new LogsPredictiveLatin12KeyTranslator();
+ if( mNameTranslator->mKeyMap &&
+ mNameTranslator->encodes( name ) ) {
+ nameTranslator = mNameTranslator;
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::\
+nameTranslator() - use latin" )
+ return *nameTranslator;
+ }
+ delete mNameTranslator;
+ mNameTranslator = new LogsPredictiveThai12KeyTranslator();
+ if( mNameTranslator->mKeyMap &&
+ mNameTranslator->encodes( name ) ) {
+ nameTranslator = mNameTranslator;
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::\
+nameTranslator() - use thai" )
+ return *nameTranslator;
+ }
+ delete mNameTranslator;
+ mNameTranslator = 0;
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::\
+nameTranslator() - use global input language" )
+
+ }
+
+
+ return *nameTranslator;
+
+}
+
+// -----------------------------------------------------------------------------
+// LogsPredictiveTranslator::encodes()
+// -----------------------------------------------------------------------------
+//
+bool LogsPredictiveTranslator::encodes( const QString& sniplet )
+{
+ bool ok;
+ translate( sniplet, &ok );
+ return ok;
+}
+
+// -----------------------------------------------------------------------------
+// LogsPredictiveTranslator::translatePattern()
+// -----------------------------------------------------------------------------
+//
+const QString LogsPredictiveTranslator::translatePattern(
+ const QString& pattern ) const
+{
+ LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveTranslator::translatePattern()" )
+ QString result = translate( pattern );
+
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::translatePattern()" )
+ return result;
+}
+
+// -----------------------------------------------------------------------------
// LogsPredictiveTranslator::translate()
// -----------------------------------------------------------------------------
//
-const QString LogsPredictiveTranslator::translate( const QString& name,
- int count ) const
+const QString LogsPredictiveTranslator::translate( const QString& text,
+ bool* ok, int count ) const
{
LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveTranslator::translate()" )
- LOGS_QDEBUG_2( "logs [FINDER] name ", name );
+ LOGS_QDEBUG_2( "logs [FINDER] text ", text );
- count = count == -1 ? name.length() : count;
+ count = count == -1 ? text.length() : count;
+ bool isok = ok ? *ok : true;
QString result;
- const QChar* content = name.data();
+ const QChar* content = text.data();
int index = 0;
- while( index < count ) {
- QChar ch = translateChar( *content++ );
+ while( index < count && isok ) {
+ QChar ch = translateChar( *content++, isok );
if ( !ch.isNull() ) {
result.append( ch );
}
index++;
}
+ if ( ok ) {
+ *ok = isok;
+ }
LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::translate()" )
return result;
}
-// -----------------------------------------------------------------------------
-// LogsPredictiveTranslator::startsWith()
-// -----------------------------------------------------------------------------
-//
-int LogsPredictiveTranslator::startsWith( const QString& text,
- const QString& pattern,
- bool optimize ) const
-{
- LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveTranslator::startsWith()" )
- //assumed that text has found based on pattern, thus only checking with
- //first char is enough, if mightContainZeroes eq false
- int matchCount = pattern.length();
- if ( text.isEmpty() || matchCount > text.length() ) {
- matchCount = 0;
- } else {
- if ( !optimize ) {
- QString translatedText = translate( text, pattern.length() );
- matchCount = translatedText == pattern ? matchCount : 0;
- } else {
- matchCount = translateChar( *text.data() ) == *pattern.data() ?
- matchCount : 0;
- }
- }
-
- LOGS_QDEBUG_2( "logs [FINDER] matchCount=", matchCount )
- LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::startsWith()" )
- return matchCount;
-}
--- a/logsui/logscntfinder/tsrc/pt_logscntfinder/inc/pt_logscntfinder.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/pt_logscntfinder/inc/pt_logscntfinder.h Thu Jul 22 16:33:49 2010 +0100
@@ -14,23 +14,51 @@
* Description:
*
*/
-#ifndef UT_CNTPREFILTERING_H
-#define UT_CNTPREFILTERING_H
+#ifndef PT_LOGSCNTFINDER_H
+#define PT_LOGSCNTFINDER_H
#include <QObject>
#include <qcontactmanager.h>
QTM_USE_NAMESPACE
-
class LogsCntFinder;
+class PtTest
+{
+public:
+
+ PtTest( const QString& name );
+ void execute( LogsCntFinder& engine );
+ void execute( QContactManager& manager );
+ void calculateMean();
+ void calculateVariance();
+ void calculateDeviation();
+ void print();
+ static QString statHeader();
+
+public:
+
+ QString mPattern;
+ QList<int> mSamples;
+ float mMean;
+ float mVariance;
+ float mStdDeviation;
+ int mMin;
+ int mMax;
+ int mMinSample;
+ int mMaxSample;
+ int mResults;
-class pt_LogsCntFinder : public QObject
+};
+
+
+
+class PT_LogsCntFinder : public QObject
{
Q_OBJECT
public:
- inline pt_LogsCntFinder( int samples ) : mSamples(samples) {}
+ inline PT_LogsCntFinder( int samples ) : mSamples(samples) {}
private slots:
@@ -57,11 +85,8 @@
void statistics();
private:
- void createContacts();
void createContact_one_Contact(QString& firstname, QString& Lastname, QString phnumber);
- QContactFilter::MatchFlags flag(int f);
-
private:
QContactManager *m_manager;
@@ -70,4 +95,4 @@
};
-#endif //UT_CNTSPREFILTERING_H
+#endif //PT_LOGSCNTFINDER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logscntfinder/tsrc/pt_logscntfinder/inc/pt_logscntfinderqwerty.h Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,63 @@
+/*
+* 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 PT_LOGSCNTFINDERQWERTY_H
+#define PT_LOGSCNTFINDERQWERTY_H
+
+#include <QObject>
+#include <qcontactmanager.h>
+
+QTM_USE_NAMESPACE
+
+
+class PT_LogsCntFinderQwerty : public QObject
+{
+ Q_OBJECT
+public:
+
+ inline PT_LogsCntFinderQwerty( int samples ) : mSamples(samples) {}
+
+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 statistics();
+
+private:
+
+private:
+
+ QContactManager *m_manager;
+ int mSamples;
+};
+
+
+#endif //PT_LOGSCNTFINDERQWERTY_H
--- a/logsui/logscntfinder/tsrc/pt_logscntfinder/pt_logscntfinder.pro Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/pt_logscntfinder/pt_logscntfinder.pro Thu Jul 22 16:33:49 2010 +0100
@@ -37,8 +37,10 @@
# Input
HEADERS += inc\pt_logscntfinder.h
-
+ HEADERS += inc\pt_logscntfinderqwerty.h
SOURCES += src\pt_logscntfinder.cpp
+ SOURCES += src\pt_logscntfinderqwerty.cpp
+ SOURCES += src\main.cpp
symbian: {
TARGET.UID2 = 0x100039CE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logscntfinder/tsrc/pt_logscntfinder/src/main.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* 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 <QtTest/QtTest>
+
+#include "pt_logscntfinder.h"
+#include "pt_logscntfinderqwerty.h"
+
+
+
+int main(int argc, char *argv[]) //on HW
+{
+ int samples = 100;
+ for (int i=0; i<argc; i++) {
+ if (QString(argv[i]) == "-s") {
+ samples = QString(argv[i+1]).toInt();
+ }
+ }
+
+ QApplication app(argc, argv);
+
+ PT_LogsCntFinder pt_logscntfinder( samples );
+ QString resultFileName = "c:/data/others/pt_logscntfinder.txt";
+ QStringList args_logsCntFinder( "PT_logscntfinder");
+ args_logsCntFinder << "-o" << resultFileName;
+ QTest::qExec(&pt_logscntfinder, args_logsCntFinder);
+
+ PT_LogsCntFinderQwerty pt_LogsCntFinderQwerty( samples );
+ resultFileName = "c:/data/others/pt_logscntfinderqwerty.txt";
+ QStringList args_logsCntFinderQwerty( "PT_LogsCntFinderQwerty");
+ args_logsCntFinderQwerty << "-o" << resultFileName;
+ QTest::qExec(&pt_LogsCntFinderQwerty, args_logsCntFinderQwerty);
+
+ return 0;
+}
+
+
+
+
+
--- a/logsui/logscntfinder/tsrc/pt_logscntfinder/src/pt_logscntfinder.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/pt_logscntfinder/src/pt_logscntfinder.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -14,7 +14,7 @@
* Description:
*
*/
-#include "pt_LogsCntFinder.h"
+#include "pt_Logscntfinder.h"
#include "logscntfinder.h"
#include <qtcontacts.h>
@@ -22,33 +22,6 @@
-class PtTest
-{
-public:
-
- PtTest( const QString& name );
- void execute( LogsCntFinder& engine );
- void calculateMean();
- void calculateVariance();
- void calculateDeviation();
- void print();
- static QString statHeader();
-
-public:
-
- QString mPattern;
- QList<int> mSamples;
- float mMean;
- float mVariance;
- float mStdDeviation;
- int mMin;
- int mMax;
- int mMinSample;
- int mMaxSample;
- int mResults;
-
-};
-
PtTest::PtTest( const QString& name )
: mPattern(name),
@@ -73,8 +46,6 @@
engine.predictiveSearchQuery( mPattern );
mSamples.append( t.elapsed());
mResults += engine.resultsCount();
- //mSamples.append( qrand() / 100000000 );
- //mResults += (100 - mPattern.length() );
}
@@ -157,68 +128,60 @@
}
-void pt_LogsCntFinder::initTestCase()
+void PT_LogsCntFinder::initTestCase()
{
}
-void pt_LogsCntFinder::cleanupTestCase()
+void PT_LogsCntFinder::cleanupTestCase()
{
}
-void pt_LogsCntFinder::init()
+void PT_LogsCntFinder::init()
{
- qDebug() << "pt_LogsCntFinder::init start";
+ qDebug() << "PT_LogsCntFinder::init start";
m_finder = 0;
//open symbian database
m_manager = new QContactManager("symbian");
- //qDebug() << "pt_LogsCntFinder::init remove old contacts";
+ /*
+ //qDebug() << "PT_LogsCntFinder::init remove old contacts";
// Remove all contacts from the database
+ QList<QString> firstnamelist;
+ QList<QString> Lastnamelist;
+ firstnamelist<<"Micheal"<<"Evans"<<"Kacris"<<"Xiao";
+ Lastnamelist<<"Ribecca"<<"Tina"<<"Bob"<<"George"<<"Anna";
+
+ for( int z = 0;z<30;z++) {
+ //for( int z = 0;z<10;z++) {
+ for(int i =0; i < firstnamelist.count(); i++) {
+ for(int k =0; k < Lastnamelist.count(); k++) {
+ //emailaddress = firstnamelist[i].Lastnamelist[k]
+ createContact_one_Contact(firstnamelist[i], Lastnamelist[k], QString("03432"));
+ }
+ }
+ }
+ */
+
QList<QContactLocalId> cnt_ids = m_manager->contactIds();
qDebug() << "contacts now in db" << cnt_ids.count();
- if ( cnt_ids.count() == 600 ) {
- QString f("Jack");
- QString l("Whatever");
- createContact_one_Contact( f,l, QString("03432"));
- }
-
- cnt_ids = m_manager->contactIds();
+ if ( cnt_ids.count() < 600 ) {
+ QString f("Jack");
+ QString l("Whatever");
+ createContact_one_Contact( f,l, QString("03432"));
+ }
+ cnt_ids = m_manager->contactIds();
qDebug() << "contacts now " << cnt_ids.count();
-
-
- /*if ( cnt_ids.count() != 600 ) {
- qDebug() << "contacts now before delete" << cnt_ids.count();
- m_manager->removeContacts(&cnt_ids);
- cnt_ids = m_manager->contactIds();
- qDebug() << "contacts now " << cnt_ids.count();
-
- QVERIFY(0 == cnt_ids.count());
-
- //qDebug() << "pt_LogsCntFinder::createContacts";
- createContacts();
- //qDebug() << "pt_LogsCntFinder::createContacts DONE";
- //qDebug() << "contacts now after create" << cnt_ids.count();
- }*/
-
-
m_finder = new LogsCntFinder( *m_manager );
- qDebug() << "pt_LogsCntFinder::init end";
+ qDebug() << "PT_LogsCntFinder::init end";
}
-void pt_LogsCntFinder::cleanup()
+void PT_LogsCntFinder::cleanup()
{
- /*m_manager = new QContactManager("symbian");
- QList<QContactLocalId> cnt_ids = m_manager->contactIds();
- m_manager->removeContacts(&cnt_ids);
- cnt_ids = m_manager->contactIds();
- qDebug() << "contacts now " << cnt_ids.count();
-
- QVERIFY(0 == cnt_ids.count());*/
delete m_manager;
m_manager = 0;
delete m_finder;
@@ -226,39 +189,10 @@
}
-void pt_LogsCntFinder::createContacts()
-{
- //qDebug() << "pt_LogsCntFinder::createContacts";
- QList<QString> firstnamelist;
- QList<QString> Lastnamelist;
- firstnamelist<<"Micheal"<<"Evans"<<"Kris"<<"Xiao"<<"Una Vivi"<<"Wilda"<<"Tisha"<<"Queen"<<"Olga"<<"Maria Zola";
- //Lastnamelist<<"Ribecca"<<"Tina"<<"Bob"<<"George"<<"Anna"<<"Yadira"<<"Lennon"<<"Jones"<<"Augustin Zi"<<"Csoma"<<"Baranik"<<"Harhai";
- Lastnamelist<<"Ribecca"<<"Tina"<<"Bob"<<"George"<<"Anna"<<"Yadira"<<"Lennon"<<"Jones"<<"Augustin Zi"<<"Csoma";
-
- //for( int z = 0;z<100;z++) {
- for( int z = 0;z<5;z++) {
- for(int i =0; i < firstnamelist.count(); i++) {
- for(int k =0; k < Lastnamelist.count(); k++) {
- createContact_one_Contact(firstnamelist[i], Lastnamelist[k], QString("03432"));
- }
- }
- }
-
- // Empty contact
- //QContact empty;
- //m_manager->saveContact(&empty);
- /*
- QList<QContactLocalId> cnt_ids = m_manager->contactIds();
- cnt_ids = m_manager->contactIds();
- int j = cnt_ids.count();
- QVERIFY( j == 900 );
- */
- //qDebug() << "pt_LogsCntFinder::createContacts DONE";
-
-}
-void pt_LogsCntFinder::createContact_one_Contact(QString& firstname, QString& Lastname, QString phnumber)
+//void PT_LogsCntFinder::createContact_one_Contact(QString& firstname, QString& Lastname, QString phnumber, QString& emailaddress)
+void PT_LogsCntFinder::createContact_one_Contact(QString& firstname, QString& Lastname, QString phnumber)
{
//Currenlty we can only fetch firstname,lastname,companyname and sip/email/phone from the databse
// so create contact with only these details
@@ -276,18 +210,20 @@
number.setNumber(phnumber);
phonecontact.saveDetail(&number);
- //qDebug() << "pt_LogsCntFinder::createContact_one_Contact about to save..";
+ QContactEmailAddress email;
+ QString emailaddress = firstname + "." + Lastname + "@ovi.com";
+ email.setEmailAddress(emailaddress);
+ phonecontact.saveDetail(&email);
m_manager->saveContact(&phonecontact);
- //qDebug() << "pt_LogsCntFinder::createContact_one_Contact done";
}
-void pt_LogsCntFinder::testPredictiveQuery()
+void PT_LogsCntFinder::testPredictiveQuery()
{
const int rowsInDisplay = 10;
- qDebug() << "=>pt_LogsCntFinder::testPredictiveQuery";
+ qDebug() << "=>PT_LogsCntFinder::testPredictiveQuery";
QTime t;
qDebug() << "--- testing query with 5 ---";
@@ -301,42 +237,31 @@
qDebug() << "-- list 10 matched records start --";
for( int i=0;(i < rowsInDisplay && i < results);i++) {
- QTime t1;
- t1.start();
- const LogsCntEntry& data = m_finder->resultAt( i );
- //qDebug() << "First Name: ";
- for (int j = 0; j < data.firstName().length(); j++) {
- //qDebug() << data.firstName().at(j).text();
- }
- //qDebug() << "Last Name: ";
- for (int k = 0; k < data.lastName().length(); k++) {
- //qDebug() << data.lastName().at(k).text();
- }
- //qDebug() << "Phone number: " << data.phoneNumber().text();
-
- qDebug() << "fetched one contact";
- qDebug(" Time elapsed:%d ms", t1.elapsed());
+ QTime t1;
+ t1.start();
+ const LogsCntEntry& data = m_finder->resultAt( i );
+ qDebug() << "fetched one contact";
+ qDebug(" Time elapsed:%d ms", t1.elapsed());
}
qDebug() << "-- list 10 matched records end --";
qDebug(" Time elapsed:%d ms", t.elapsed());
- qDebug() << "<=pt_LogsCntFinder::testPredictiveQuery";
-
+ qDebug() << "<=PT_LogsCntFinder::testPredictiveQuery";
}
-void pt_LogsCntFinder::testExtendedQuery()
+void PT_LogsCntFinder::testExtendedQuery()
{
- qDebug() << "=>pt_LogsCntFinder::testExtendedQuery";
- qDebug() << "<=pt_LogsCntFinder::testPredictiveQuery";
+ qDebug() << "=>PT_LogsCntFinder::testExtendedQuery";
+ qDebug() << "<=PT_LogsCntFinder::testPredictiveQuery";
}
-void pt_LogsCntFinder::testDiffHitQuery()
+void PT_LogsCntFinder::testDiffHitQuery()
{
- qDebug() << "=>pt_LogsCntFinder::testDiffHitQuery";
+ qDebug() << "=>PT_LogsCntFinder::testDiffHitQuery";
QTime t;
@@ -380,14 +305,14 @@
results = m_finder->resultsCount();
qDebug() << "found " << results << " matches:";
- qDebug() << "<=pt_LogsCntFinder::testDiffHitQuery";
+ qDebug() << "<=PT_LogsCntFinder::testDiffHitQuery";
}
-void pt_LogsCntFinder::statistics()
+void PT_LogsCntFinder::statistics()
{
- qDebug() << "=> pt_LogsCntFinder::statistics";
+ qDebug() << "=> PT_LogsCntFinder::statistics";
int results = 0;
int queries = 0;
int ind = mSamples; //samples
@@ -395,9 +320,12 @@
QList<PtTest> tests;
tests.append( PtTest("5") );
+ tests.append( PtTest("05") );
tests.append( PtTest("52") );
tests.append( PtTest("522") );
tests.append( PtTest("5220") );
+ tests.append( PtTest("05220") );
+ tests.append( PtTest("052207") );
tests.append( PtTest("522000000000007") );
tests.append( PtTest("205") );
tests.append( PtTest("34096") );
@@ -439,28 +367,7 @@
tests[ind].print();
}
- qDebug() << "<= pt_LogsCntFinder::statistics";
+ qDebug() << "<= PT_LogsCntFinder::statistics";
}
-//QTEST_MAIN(pt_LogsCntFinder); // on Emulator
-
-int main(int argc, char *argv[]) //on HW
-{
- int samples = 100;
- for (int i=0; i<argc; i++) {
- if (QString(argv[i]) == "-s") {
- samples = QString(argv[i+1]).toInt();
- }
- }
-
- QApplication app(argc, argv);
-
- pt_LogsCntFinder pt_logscntfinder( samples );
- QString resultFileName = "c:/data/others/pt_logscntfinder.txt";
- QStringList args_logsCntFinder( "pt_logscntfinder");
- args_logsCntFinder << "-o" << resultFileName;
- QTest::qExec(&pt_logscntfinder, args_logsCntFinder);
- return 0;
-}
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logscntfinder/tsrc/pt_logscntfinder/src/pt_logscntfinderqwerty.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,116 @@
+/*
+* 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 "pt_logscntfinderqwerty.h"
+#include "pt_logscntfinder.h"
+
+#include <qtcontacts.h>
+#include <QtTest/QtTest>
+
+
+void PtTest::execute( QContactManager& manager )
+{
+
+ QContactDetailFilter df;
+ df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress );
+ df.setMatchFlags( QContactFilter::MatchKeypadCollation );
+ QString pattern = mPattern + QChar(30) + QString("vqwerty");
+ df.setValue( pattern );
+
+ QTime t;
+ t.start();
+
+ QList<QContactLocalId> cnt_ids = manager.contactIds( df );
+ mSamples.append( t.elapsed());
+ mResults += cnt_ids.count();
+
+}
+
+void PT_LogsCntFinderQwerty::initTestCase()
+{
+}
+
+void PT_LogsCntFinderQwerty::cleanupTestCase()
+{
+
+}
+
+
+void PT_LogsCntFinderQwerty::init()
+{
+ qDebug() << "PT_LogsCntFinderQwerty::init start";
+ //open symbian database
+ m_manager = new QContactManager("symbian");
+
+ QList<QContactLocalId> cnt_ids = m_manager->contactIds();
+ qDebug() << "contacts now in db" << cnt_ids.count();
+ qDebug() << "PT_LogsCntFinderQwerty::init end";
+}
+
+void PT_LogsCntFinderQwerty::cleanup()
+{
+ delete m_manager;
+ m_manager = 0;
+}
+
+
+
+void PT_LogsCntFinderQwerty::statistics()
+{
+ qDebug() << "=> PT_LogsCntFinderQwerty::statistics";
+ int results = 0;
+ int queries = 0;
+ int ind = mSamples; //samples
+ QTime t;
+
+ QList<PtTest> tests;
+ tests.append( PtTest("a") );
+ tests.append( PtTest("5") );
+ tests.append( PtTest("Paul") );
+ tests.append( PtTest("Paul sw") );
+ tests.append( PtTest("P S") );
+
+ t.start();
+
+ while( ind > 0 ) {
+ for( int j = 0; j < tests.length(); j++ ) {
+ tests[j].execute( *m_manager );
+ queries++;
+ }
+ ind--;
+ }
+
+ int totalTime = t.elapsed();
+
+
+ for( ind = 0; ind < tests.length(); ind++ ) {
+ tests[ind].calculateMean();
+ tests[ind].calculateVariance();
+ tests[ind].calculateDeviation();
+ results += tests[ind].mResults;
+ }
+
+ qDebug("-- Statistics --");
+ qDebug("%d queries executed with %d results in %d ms.",
+ queries, results, totalTime );
+ qDebug() << PtTest::statHeader();
+ for( ind = 0; ind < tests.length(); ind++ ) {
+ tests[ind].print();
+ }
+
+ qDebug() << "<= PT_LogsCntFinderQwerty::statistics";
+}
+
--- a/logsui/logscntfinder/tsrc/st_logscntfinder/inc/st_logscntfinder.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/inc/st_logscntfinder.h Thu Jul 22 16:33:49 2010 +0100
@@ -19,13 +19,14 @@
#include <QObject>
#include <qcontactmanager.h>
+#include <hbinputlanguage.h>
QTM_USE_NAMESPACE
class LogsCntFinder;
-class st_LogsCntFinder : public QObject
+class ST_LogsCntFinder : public QObject
{
Q_OBJECT
@@ -47,13 +48,36 @@
void cleanup();
private slots: //test methods
- void testPredictiveSearchQuery();
- void testKeymap();
- void testPredictiveSearchQueryZero();
+
+ void testKeymap_2();
+ void testKeymap_3();
+ void testKeymap_4();
+ void testKeymap_5();
+ void testKeymap_6();
+ void testKeymap_7();
+ void testKeymap_8();
+ void testKeymap_9();
+ void testPredictiveSearchQueryZeroStart();
+ void testPredictiveSearchQueryZeroStartZeroEnd();
+ void testPredictiveSearchQueryZeroMiddle();
+ void testPredictiveSearchQueryMultiZerosMiddle();
+ void testPredictiveSearchQueryZeroMiddleLong();
+ void testPredictiveSearchQueryMultiZerosAndZeroMiddle();
+ void testPredictiveSearchQueryPartialCached();
+ void testPredictiveSearchQueryFullyCached();
+ void testPredictiveSearchQueryPartialCachedNoResults();
+ void testPredictiveSearchQueryFullyCachedNoResults();
+ void testPredictiveSearchQueryPartialCachedZeroCase();
+ void testPredictiveSearchQueryFullyCachedZerosCase();
+ void testPredictiveSearchQueryLogs();
+ void testPredictiveSearchQueryLogsZeroCase();
+ void testPredictiveSearchQueryLogsContactsPartialCached();
+ void testPredictiveSearchQueryLogsContactsFullyCached();
+ void testPredictiveSearchQueryLogsContactsZeroCase();
+ void testPredictiveSearchQueryLogsContactsPhoneNumberMatch();
void testPredictiveSearchQueryLimit();
- void testPredictiveSearchQueryLogs();
- void testPredictiveSearchQueryLogsContacts();
void testQueryOrder();
+ void testContactWithNonMappedChars();
private:
@@ -67,6 +91,7 @@
void createContacts();
void createContactsForQueryOrder();
void createContactsForQueryZero();
+ void createContactsWithNonMappedChars();
void createHistoryEvents();
void createLogEvent(
QString firstname,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/inc/st_logscntfinderqwerty.h Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,68 @@
+/*
+* 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 ST_LOGSCNTFINDERQWERTY_H
+#define ST_LOGSCNTFINDERQWERTY_H
+
+#include <QObject>
+#include <qcontactmanager.h>
+#include <hbinputlanguage.h>
+
+QTM_USE_NAMESPACE
+
+class LogsCntFinder;
+
+
+class ST_LogsCntFinderQwerty : 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 testPredictiveEmailSearchNameAndEmailMatch();
+ void testPredictiveEmailSearchWithSpace();
+ void testPredictiveEmailSearchEmailMatch();
+ void testPredictiveEmailSearchNoEmails();
+ void testPredictiveEmailSearchOverLongPattern();
+ void testPredictiveEmailSearchSpecialCharsInPattern();
+
+private:
+
+ void createContacts();
+
+private:
+ QContactManager *m_manager;
+};
+
+
+#endif // ST_LOGSCNTFINDERQWERTY_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/inc/st_logscntfinderthai.h Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* 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 ST_LOGSCNTFINDERTHAI_H
+#define ST_LOGSCNTFINDERTHAI_H
+
+#include <QObject>
+#include <qcontactmanager.h>
+#include <hbinputlanguage.h>
+
+QTM_USE_NAMESPACE
+
+class LogsCntFinder;
+
+
+class ST_LogsCntFinderThai : 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 testPredictiveThaiSearchQuery();
+
+private:
+
+ void createThaiContacts();
+ void createOneContact(QString firstname, QString Lastname,
+ QString phnumber);
+
+
+private:
+ QContactManager *m_manager;
+ LogsCntFinder *m_finder;
+};
+
+
+#endif // ST_LOGSCNTFINDERTHAI_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/src/main.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,71 @@
+/*
+* 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 <QtTest/QtTest>
+
+#include "st_logscntfinder.h"
+#include "st_logscntfinderqwerty.h"
+#include "st_logscntfinderthai.h"
+
+#include "testresultxmlparser.h"
+
+
+#define STEST_CLASS( tc )\
+ tc tc##_instance;\
+ QStringList tc##_args( #tc );\
+ resultFileName = QString("c:/data/others/") + QString( #tc ) + QString(".xml");\
+ tc##_args << "-xml" << "-o" << resultFileName;\
+ QTest::qExec(&tc##_instance, tc##_args);\
+ parser.parseAndPrintResults(resultFileName,true)
+
+
+
+int main(int argc, char *argv[])
+{
+ bool promptOnExit(false);
+ bool useQApplication(true);
+ for (int i=0; i<argc; i++) {
+ if (QString(argv[i]) == "-prompt")
+ promptOnExit = true;
+ else if (QString(argv[i]) == "-noqapp")
+ useQApplication = false;
+ }
+ printf("Running tests...\n");
+
+ QApplication* app = 0;
+ if ( useQApplication )
+ app = new QApplication(argc, argv);
+
+ TestResultXmlParser parser;
+ QString resultFileName;
+
+ STEST_CLASS( ST_LogsCntFinder );
+ STEST_CLASS( ST_LogsCntFinderThai );
+ STEST_CLASS( ST_LogsCntFinderQwerty );
+
+ if (promptOnExit) {
+ printf("Press any key...\n");
+ getchar();
+ }
+ delete app;
+ return 0;
+}
+
+
+
+
--- a/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinder.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinder.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -20,31 +20,48 @@
#include <qtcontacts.h>
#include <QtTest/QtTest>
+#include <hbinputsettingproxy.h>
-void st_LogsCntFinder::initTestCase()
+#define CHECK_RESULTS( count, first, last )\
+ for(int i=0;i<count; i++ ) {\
+ if ( i == 0 ) {\
+ QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString(first));\
+ QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString(last));\
+ } else {\
+ m_finder->resultAt(i);\
+ }\
+ }
+
+
+void ST_LogsCntFinder::initTestCase()
{
+ //open symbian database
+ m_manager = new QContactManager("symbian");
}
-void st_LogsCntFinder::cleanupTestCase()
+void ST_LogsCntFinder::cleanupTestCase()
{
+ delete m_manager;
+ m_manager = 0;
}
-void st_LogsCntFinder::init()
+void ST_LogsCntFinder::init()
{
+ HbInputLanguage eng( QLocale::English );
+ HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+
m_finder = 0;
- //open symbian database
- m_manager = new QContactManager("symbian");
m_finder = new LogsCntFinder(*m_manager);
QVERIFY(m_finder);
// Remove all contacts from the database
QList<QContactLocalId> 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);
@@ -54,15 +71,16 @@
}
}
-void st_LogsCntFinder::cleanup()
+void ST_LogsCntFinder::cleanup()
{
- delete m_manager;
- m_manager = 0;
delete m_finder;
m_finder = 0;
+ HbInputLanguage eng( QLocale::English );
+ HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+
}
-void st_LogsCntFinder::createContacts()
+void ST_LogsCntFinder::createContacts()
{
/*Create contacts in Contacts DB for keymap testing
Stefann Yadira
@@ -92,24 +110,51 @@
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);
- qDebug() << "st_LogsCntFinder::createContacts_testKeymap. created " << contactsCount << " contacts";
}
+/*
+Dlice 00202 Qwerty 45789348
+#Paula 2003 Augustin Ci 0078945617
+Paula 02010 Ezerty Adam 78945617
+Ced Y,g +78945617
+Jari-Pekka Baraniktestteste 78945617
+*/
+void ST_LogsCntFinder::createContactsForQueryZero()
+{
+ createContacts();
+ createOneContact( QString("Dlice 0202"), QString("Qwerty"), QString("45789348") );
+ createOneContact( QString("#Paula 2003"), QString("Augustin Ci"), QString("0078945617") );
+ createOneContact( QString("Paula 02010"), QString("Ezerty Adam"), QString("78945617") );
+ createOneContact( QString("Ced"), QString(",Yg"), QString("+78945617") );
+ createOneContact( QString("Jari-Pekka"), QString(" "), QString("78945617") );
-void st_LogsCntFinder::createHistoryEvents()
+ int contactsCount = m_manager->contactIds().count();
+ QCOMPARE(contactsCount, 18);
+}
+
+void ST_LogsCntFinder::createContactsWithNonMappedChars()
{
+
+ createOneContact( QString("Hannu%"), QString(""), QString("932472398") );
+ createOneContact( QString("%Hannu"), QString(""), QString("932472398") );
+
+}
+
+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") );
}
-void st_LogsCntFinder::createLogEvent(QString firstname, QString lastname,
+void ST_LogsCntFinder::createLogEvent(QString firstname, QString lastname,
QString phnumber)
{
LogsCntEntryHandle* dummy = 0;
@@ -124,8 +169,20 @@
}
+void ST_LogsCntFinder::createContactsForQueryOrder()
+{
+ createContacts();
+ createOneContact( QString("Anna"), QString("Qwerty"), QString("45789348") );
+ createOneContact( QString("Paula"), QString("Qwerty"), QString("78945617") );
+ createOneContact( QString("Paula"), QString("Azerty"), QString("78945617") );
-void st_LogsCntFinder::createOneContact(QString firstname, QString Lastname,
+ int contactsCount = m_manager->contactIds().count();
+ QCOMPARE(contactsCount, 16);
+}
+
+
+
+void ST_LogsCntFinder::createOneContact(QString firstname, QString Lastname,
QString phnumber)
{
//Currenlty we can only fetch firstname,lastname,companyname and sip/email/phone from the databse
@@ -145,7 +202,7 @@
phonecontact.saveDetail(&number);
m_manager->saveContact(&phonecontact);
- qDebug() << "st_LogsCntFinder::createOneContact done";
+ qDebug() << "ST_LogsCntFinder::createOneContact done";
}
@@ -154,90 +211,6 @@
// Tests
//
-// Test basic predictive search, all records with names starting letters "J, K, L" are matched
-void st_LogsCntFinder::testPredictiveSearchQuery()
-{
- createContacts();
-
- //There is no recent call in logs UI
- //case 1
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 5 );
- //see half of matched results
- //results == for(int i =0;i<f->resultCount() / 2;i++){f->resultAt(i);}
- /*QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString("Maria-Zola"));
- QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString("Jones"));
- QCOMPARE(m_finder->resultAt(1).firstName().at(0).text(), QString("Jonn"));
- QCOMPARE(m_finder->resultAt(1).lastName().at(0).text(), QString("Ennon"));*/
-
- m_finder->predictiveSearchQuery( QString("566") );
- QCOMPARE( m_finder->resultsCount(), 2 );
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 5 );
-
- //case 2
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 5 );
- //see all of the matched results
- //results == for(int i =0;i<f->resultCount();i++){f->resultAt(i);}
- /*QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString("Maria-Zola"));
- QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString("Jones"));
- QCOMPARE(m_finder->resultAt(1).firstName().at(0).text(), QString("Jonn"));
- QCOMPARE(m_finder->resultAt(1).lastName().at(0).text(), QString("Ennon"));
- QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString("Una Vivi"));
- QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString("Kantsak"));
- QCOMPARE(m_finder->resultAt(1).firstName().at(0).text(), QString("Wilda"));
- QCOMPARE(m_finder->resultAt(1).lastName().at(0).text(), QString("Lazar"));
- QCOMPARE(m_finder->resultAt(1).firstName().at(0).text(), QString("Levis"));
- QCOMPARE(m_finder->resultAt(1).lastName().at(0).text(), QString("Augustin Zi"));
- */
-
- m_finder->predictiveSearchQuery( QString("566") );
- QCOMPARE( m_finder->resultsCount(), 2 );
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 5 );
-
- //case 3
- m_finder->predictiveSearchQuery( QString("6") );
- QCOMPARE( m_finder->resultsCount(), 3 );
- //see all of matched results
- //results == for(int i =0;i<f->resultCount();i++){f->resultAt(i);}
- /*QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString("Maria-Zola"));
- QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString("Jones"));
- QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString("Nancy"));
- QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString("Csoma"));
- QCOMPARE(m_finder->resultAt(1).firstName().at(0).text(), QString("Olga"));
- QCOMPARE(m_finder->resultAt(1).lastName().at(0).text(), QString("Baraniktestteste"));*/
-
- m_finder->predictiveSearchQuery( QString("69") );
- QCOMPARE( m_finder->resultsCount(), 0 );
- m_finder->predictiveSearchQuery( QString("692") );
- QCOMPARE( m_finder->resultsCount(), 0 );
- m_finder->predictiveSearchQuery( QString("6") );
- QCOMPARE( m_finder->resultsCount(), 3 );
-
- //case 4
-
- m_finder->predictiveSearchQuery( QString("2") );
- QCOMPARE( m_finder->resultsCount(), 3 );
- //see half of matched results
- //results == for(int i =0;i<f->resultCount() / 2;i++){f->resultAt(i);}
- /*QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString("Levis"));
- QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString("Augustin Zi"));
- QCOMPARE(m_finder->resultAt(1).firstName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(1).lastName().at(0).text(), QString(""));*/
-
- m_finder->predictiveSearchQuery( QString("20") );
- QCOMPARE( m_finder->resultsCount(), 3 );
- m_finder->predictiveSearchQuery( QString("209") );
- QCOMPARE( m_finder->resultsCount(), 1 );
- m_finder->predictiveSearchQuery( QString("20") );
- QCOMPARE( m_finder->resultsCount(), 3 );
- m_finder->predictiveSearchQuery( QString("2") );
- QCOMPARE( m_finder->resultsCount(), 3 );
-
-}
-
/* Test itut keymap predictive search, checking that press key "2", records with names starting letters "A, B, C" are matched;
Press key "3", records with names starting letters "D,E,F" are matched;
Press key "4", records with names starting letters "G,H,I" are matched;
@@ -249,111 +222,470 @@
Press key "0", records with names starting letters "space" etc. are matched;
Press key "1", records with names starting letters "-,Ä,Ö" etc. are matched;
*/
-void st_LogsCntFinder::testKeymap()
+void ST_LogsCntFinder::testKeymap_2()
+{
+ createContacts();
+ const LogsCntEntry* data;
+ m_finder->predictiveSearchQuery( QString("2") );
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ data = &m_finder->resultAt( 0 );
+ QCOMPARE( data->firstName().count(), 1 );
+}
+
+void ST_LogsCntFinder::testKeymap_3()
+{
+ createContacts();
+ const LogsCntEntry* data;
+ m_finder->predictiveSearchQuery( QString("3") );
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ data = &m_finder->resultAt( 0 );
+ QCOMPARE( data->firstName().count(), 1 );
+}
+
+void ST_LogsCntFinder::testKeymap_4()
+{
+ createContacts();
+ const LogsCntEntry* data;
+ m_finder->predictiveSearchQuery( QString("4") );
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ data = &m_finder->resultAt( 0 );
+ QCOMPARE( data->firstName().count(), 1 );
+}
+
+void ST_LogsCntFinder::testKeymap_5()
{
createContacts();
const LogsCntEntry* data;
-
- for (int i = 2; i < 10; i++)
- {
- m_finder->predictiveSearchQuery( QString::number(i) );
- switch( i )
- {
- case 2:
- QCOMPARE( m_finder->resultsCount(), 3 );
- data = &m_finder->resultAt( 0 );
- QCOMPARE( data->firstName().count(), 1 );
- break;
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 5 );
+ data = &m_finder->resultAt( 0 );
+ QCOMPARE( data->firstName().count(), 1 );
+}
- case 3:
- QCOMPARE( m_finder->resultsCount(), 3 );
- data = &m_finder->resultAt( 0 );
- QCOMPARE( data->firstName().count(), 1 );
- break;
-
- case 4:
- QCOMPARE( m_finder->resultsCount(), 3 );
- data = &m_finder->resultAt( 0 );
- QCOMPARE( data->firstName().count(), 1 );
- break;
+void ST_LogsCntFinder::testKeymap_6()
+{
+ createContacts();
+ const LogsCntEntry* data;
+ m_finder->predictiveSearchQuery( QString("6") );
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ data = &m_finder->resultAt( 0 );
+ QCOMPARE( data->firstName().count(), 1 );
+}
- case 5:
- QCOMPARE( m_finder->resultsCount(), 5 );
- data = &m_finder->resultAt( 0 );
- QCOMPARE( data->firstName().count(), 1 );
- break;
-
- case 6:
- QCOMPARE( m_finder->resultsCount(), 3 );
- data = &m_finder->resultAt( 0 );
- QCOMPARE( data->firstName().count(), 1 );
- break;
+void ST_LogsCntFinder::testKeymap_7()
+{
+ createContacts();
+ const LogsCntEntry* data;
+ m_finder->predictiveSearchQuery( QString("7") );
+ QCOMPARE( m_finder->resultsCount(), 5 );
+ data = &m_finder->resultAt( 0 );
+ QCOMPARE( data->firstName().count(),1 );
+}
- case 7:
- QCOMPARE( m_finder->resultsCount(), 5 );
- data = &m_finder->resultAt( 0 );
- QCOMPARE( data->firstName().count(),1 );
- break;
+void ST_LogsCntFinder::testKeymap_8()
+{
+ createContacts();
+ const LogsCntEntry* data;
+ m_finder->predictiveSearchQuery( QString("8") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ data = &m_finder->resultAt( 0 );
+ QCOMPARE( data->firstName().count(), 1 );
+}
- case 8:
- QCOMPARE( m_finder->resultsCount(), 2 );
- data = &m_finder->resultAt( 0 );
- QCOMPARE( data->firstName().count(), 1 );
- break;
+void ST_LogsCntFinder::testKeymap_9()
+{
+ createContacts();
+ const LogsCntEntry* data;
+ m_finder->predictiveSearchQuery( QString("9") );
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ data = &m_finder->resultAt( 0 );
+ QCOMPARE( data->firstName().count(), 1 );
+}
- case 9:
- QCOMPARE( m_finder->resultsCount(), 3 );
- data = &m_finder->resultAt( 0 );
- QCOMPARE( data->firstName().count(), 1 );
- break;
- }
- }
-}
/* Test zero query search: 1. zero between "1-9" numbers, then first zero works as "AND" statement;
2. (multiple) zero at beginning; 3. (multiple) zero at the end;
4-5. multi-zeros between "1-9" numbers, only the first works as "AND" statement;
6. Query limit is 15, the 16th is ignored, and first 0 works as "AND" statement */
-void st_LogsCntFinder::testPredictiveSearchQueryZero()
+
+void ST_LogsCntFinder::testPredictiveSearchQueryZeroStart()
+{
+ createContactsForQueryZero();
+
+ m_finder->predictiveSearchQuery( QString("0202") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+}
+
+void ST_LogsCntFinder::testPredictiveSearchQueryZeroStartZeroEnd()
+{
+ createContactsForQueryZero();
+
+ m_finder->predictiveSearchQuery( QString("02010") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+}
+
+void ST_LogsCntFinder::testPredictiveSearchQueryZeroMiddle()
{
createContactsForQueryZero();
m_finder->predictiveSearchQuery( QString("56603") );
QCOMPARE( m_finder->resultsCount(), 1 );
-
- m_finder->predictiveSearchQuery( QString("00202") );
- QCOMPARE( m_finder->resultsCount(), 2 );
-
- m_finder->predictiveSearchQuery( QString("02010") );
- QCOMPARE( m_finder->resultsCount(), 2 );
-
+}
+
+void ST_LogsCntFinder::testPredictiveSearchQueryMultiZerosMiddle()
+{
+ createContactsForQueryZero();
+
m_finder->predictiveSearchQuery( QString("2003") );
QCOMPARE( m_finder->resultsCount(), 2 );
-
- m_finder->predictiveSearchQuery( QString("200904") );
+}
+
+void ST_LogsCntFinder::testPredictiveSearchQueryZeroMiddleLong()
+{
+ createContactsForQueryZero();
+
+ m_finder->predictiveSearchQuery( QString("2272645837883065") );
QCOMPARE( m_finder->resultsCount(), 1 );
-
- m_finder->predictiveSearchQuery( QString("2272645837883065") );
+}
+
+void ST_LogsCntFinder::testPredictiveSearchQueryMultiZerosAndZeroMiddle()
+{
+ createContactsForQueryZero();
+
+ m_finder->predictiveSearchQuery( QString("200904") );
QCOMPARE( m_finder->resultsCount(), 1 );
}
-void st_LogsCntFinder::createContactsForQueryZero()
+
+// Test basic predictive search, all records with names starting letters "J, K, L" are matched
+
+// 5 -> 56 -> 5 -> 56 (not all cached)
+void ST_LogsCntFinder::testPredictiveSearchQueryPartialCached()
+{
+ createContacts();
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 5 );
+ //see half of matched results
+ CHECK_RESULTS( 3, "Jonn", "Ennon" );
+
+ m_finder->predictiveSearchQuery( QString("56") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ //see half of matched results
+ CHECK_RESULTS( 1, "Jonn", "Ennon" );
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 5 );
+ CHECK_RESULTS( 3, "Jonn", "Ennon" );
+
+ m_finder->predictiveSearchQuery( QString("56") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ //see half of matched results
+ CHECK_RESULTS( 1, "Jonn", "Ennon" );
+
+}
+
+// 5 -> 56 -> 5 -> 56 (all cached)
+void ST_LogsCntFinder::testPredictiveSearchQueryFullyCached()
+{
+ createContacts();
+
+ //case 1
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 5 );
+ //see all matched results
+ CHECK_RESULTS( 5, "Jonn", "Ennon" );
+
+ m_finder->predictiveSearchQuery( QString("56") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ //see all of matched results
+ CHECK_RESULTS( 2, "Jonn", "Ennon" );
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 5 );
+ //see all of matched results
+ CHECK_RESULTS( 5, "Jonn", "Ennon" );
+
+ m_finder->predictiveSearchQuery( QString("56") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ //see all of matched results
+ CHECK_RESULTS( 2, "Jonn", "Ennon" );
+
+}
+
+// 6 -> 69 (no match) -> 692 (no match) -> 69 (no match) -> 6 -> 69 (not all cached)
+void ST_LogsCntFinder::testPredictiveSearchQueryPartialCachedNoResults()
+{
+ createContacts();
+
+ m_finder->predictiveSearchQuery( QString("6") );
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ //see half of matched results
+ CHECK_RESULTS( 2, "Maria-Zola", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("69") );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+ m_finder->predictiveSearchQuery( QString("692") );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+ m_finder->predictiveSearchQuery( QString("69") );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+
+ m_finder->predictiveSearchQuery( QString("6") );
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ //see half of matched results
+ CHECK_RESULTS( 2, "Maria-Zola", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("69") );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+
+}
+
+// 6 -> 69 (no match) -> 692 (no match) -> 69 (no match) -> 6 -> 69 (all cached)
+void ST_LogsCntFinder::testPredictiveSearchQueryFullyCachedNoResults()
+{
+ createContacts();
+
+ m_finder->predictiveSearchQuery( QString("6") );
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ //see all of matched results
+ CHECK_RESULTS( 3, "Maria-Zola", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("69") );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+ m_finder->predictiveSearchQuery( QString("692") );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+ m_finder->predictiveSearchQuery( QString("69") );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+
+ m_finder->predictiveSearchQuery( QString("6") );
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ //see all of matched results
+ CHECK_RESULTS( 3, "Maria-Zola", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("69") );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+
+
+}
+
+//
+void ST_LogsCntFinder::testPredictiveSearchQueryPartialCachedZeroCase()
+{
+ createContacts();
+
+ m_finder->predictiveSearchQuery( QString("2") );//db
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ CHECK_RESULTS( 2, "Levis", "Augustin" );//Augustin Zi
+
+ m_finder->predictiveSearchQuery( QString("20") );//db
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ CHECK_RESULTS( 2, "Levis", "Augustin" );//Augustin Zi
+
+ m_finder->predictiveSearchQuery( QString("209") );//db
+ QCOMPARE( m_finder->resultsCount(), 1 );
+ CHECK_RESULTS( 1, "Levis", "Augustin" ); //Augustin Zi
+
+ m_finder->predictiveSearchQuery( QString("20") );//db
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ CHECK_RESULTS( 2, "Levis", "Augustin" );//Augustin Zi
+
+ m_finder->predictiveSearchQuery( QString("2") );//db
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ CHECK_RESULTS( 2, "Levis", "Augustin" );//Augustin Zi
+
+}
+
+//
+void ST_LogsCntFinder::testPredictiveSearchQueryFullyCachedZerosCase()
{
createContacts();
- createOneContact( QString("Dlice 00202"), QString("Qwerty"), QString("45789348") );
- createOneContact( QString("#Paula 2003"), QString("Augustin Ci"), QString("78945617") );
- createOneContact( QString("Paula 02010"), QString("Ezerty Adam"), QString("78945617") );
- createOneContact( QString("Ced"), QString("Y,g"), QString("78945617") );
- createOneContact( QString("Jari-Pekka"), QString("Baraniktestteste"), QString("78945617") );
+
+ m_finder->predictiveSearchQuery( QString("2") ); //db
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ CHECK_RESULTS( 3, "Levis", "Augustin" );//Augustin Zi
+
+ m_finder->predictiveSearchQuery( QString("20") );//cache
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ CHECK_RESULTS( 3, "Levis", "Augustin" );//Augustin Zi
+
+ m_finder->predictiveSearchQuery( QString("200") );//cache
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ CHECK_RESULTS( 3, "Levis", "Augustin" );//Augustin Zi
+
+ m_finder->predictiveSearchQuery( QString("2009") );//cache
+ QCOMPARE( m_finder->resultsCount(), 1 );
+ CHECK_RESULTS( 1, "Levis", "Augustin" ); //Augustin Zi
+
+ m_finder->predictiveSearchQuery( QString("200") );//db
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ CHECK_RESULTS( 3, "Levis", "Augustin" );//Augustin Zi
+
+ m_finder->predictiveSearchQuery( QString("20") );//db
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ CHECK_RESULTS( 3, "Levis", "Augustin" );//Augustin Zi
+
+ m_finder->predictiveSearchQuery( QString("2") );//db
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ CHECK_RESULTS( 3, "Levis", "Augustin" );//Augustin Zi
+
+}
+
+//There is recent call in logs, no contacts DB
+void ST_LogsCntFinder::testPredictiveSearchQueryLogs()
+{
+ createHistoryEvents();
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ CHECK_RESULTS( 2, "Dim-Petter", "Jones" );
- int contactsCount = m_manager->contactIds().count();
- QCOMPARE(contactsCount, 18);
+ m_finder->predictiveSearchQuery( QString("53") );
+ QCOMPARE( m_finder->resultsCount(), 1 );
+ CHECK_RESULTS( 1, "Jonn", "Lennon" );
+
+ m_finder->predictiveSearchQuery( QString("539") );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+
+ m_finder->predictiveSearchQuery( QString("53") );
+ QCOMPARE( m_finder->resultsCount(), 1 );
+ CHECK_RESULTS( 1, "Jonn", "Lennon" );
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ CHECK_RESULTS( 2, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ CHECK_RESULTS( 2, "Dim-Petter", "Jones" );
+}
+
+void ST_LogsCntFinder::testPredictiveSearchQueryLogsZeroCase()
+{
+ createHistoryEvents();
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ CHECK_RESULTS( 2, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("50") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ CHECK_RESULTS( 2, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("503") );
+ QCOMPARE( m_finder->resultsCount(), 1 );
+ CHECK_RESULTS( 1, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("50") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ CHECK_RESULTS( 2, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ CHECK_RESULTS( 2, "Dim-Petter", "Jones" );
+
}
+//There is recent call in logs, and contacts DB
+void ST_LogsCntFinder::testPredictiveSearchQueryLogsContactsPartialCached()
+{
+ createHistoryEvents();
+ createContacts();
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 7 );
+ CHECK_RESULTS( 5, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("56") );
+ QCOMPARE( m_finder->resultsCount(), 4 );
+ CHECK_RESULTS( 2, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("569") );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+
+ m_finder->predictiveSearchQuery( QString("56") );
+ QCOMPARE( m_finder->resultsCount(), 4 );
+ CHECK_RESULTS( 2, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 7 );
+ CHECK_RESULTS( 5, "Dim-Petter", "Jones" );
+
+
+}
+
+void ST_LogsCntFinder::testPredictiveSearchQueryLogsContactsFullyCached()
+{
+ createHistoryEvents();
+ createContacts();
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 7 );
+ CHECK_RESULTS( 7, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("56") );
+ QCOMPARE( m_finder->resultsCount(), 4 );
+ CHECK_RESULTS( 4, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("569") );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+
+ m_finder->predictiveSearchQuery( QString("56") );
+ QCOMPARE( m_finder->resultsCount(), 4 );
+ CHECK_RESULTS( 4, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 7 );
+ CHECK_RESULTS( 7, "Dim-Petter", "Jones" );
+
+}
+
+void ST_LogsCntFinder::testPredictiveSearchQueryLogsContactsZeroCase()
+{
+ createHistoryEvents();
+ createContacts();
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 7 );
+ CHECK_RESULTS( 5, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("50") );
+ QCOMPARE( m_finder->resultsCount(), 7 );
+ CHECK_RESULTS( 2, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("503") );
+ QCOMPARE( m_finder->resultsCount(), 2 );
+ CHECK_RESULTS( 2, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("50") );
+ QCOMPARE( m_finder->resultsCount(), 7 );
+ CHECK_RESULTS( 5, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("5") );
+ QCOMPARE( m_finder->resultsCount(), 7 );
+ CHECK_RESULTS( 5, "Dim-Petter", "Jones" );
+
+}
+
+void ST_LogsCntFinder::testPredictiveSearchQueryLogsContactsPhoneNumberMatch()
+{
+ createHistoryEvents();
+ createContacts();
+
+ m_finder->predictiveSearchQuery( QString("9") );
+ QCOMPARE( m_finder->resultsCount(), 6 ); //3 history + 3 contacts
+ CHECK_RESULTS( 5, "Dim-Petter", "Jones" );
+
+ m_finder->predictiveSearchQuery( QString("93") );
+ QCOMPARE( m_finder->resultsCount(), 3 );
+ CHECK_RESULTS( 1, "Dim-Petter", "Jones" );
+
+}
+
+
// Test query limit is 15, the 16th digit is ignored
-void st_LogsCntFinder::testPredictiveSearchQueryLimit()
+void ST_LogsCntFinder::testPredictiveSearchQueryLimit()
{
createContacts();
@@ -386,96 +718,7 @@
QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString("Baraniktestteste"));
}
-//There is recent call in logs, no contacts DB
-void st_LogsCntFinder::testPredictiveSearchQueryLogs()
-{
- createHistoryEvents();
-
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 2 );
-
- //case 1
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 2 );
- //see half of matched results
- //results == for(int i =0;i<f->resultCount() / 2;i++){f->resultAt(i);}
- /*QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(1).firstName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(1).lastName().at(0).text(), QString(""));*/
-
- m_finder->predictiveSearchQuery( QString("533") );
- QCOMPARE( m_finder->resultsCount(), 0 );
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 2 );
-
- //case 2
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 2 );
- //see half of matched results
- //results == for(int i =0;i<f->resultCount() / 2;i++){f->resultAt(i);}
- /*QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(1).firstName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(1).lastName().at(0).text(), QString(""));*/
-
- m_finder->predictiveSearchQuery( QString("50") );
- QCOMPARE( m_finder->resultsCount(), 2 );
- m_finder->predictiveSearchQuery( QString("503") );
- QCOMPARE( m_finder->resultsCount(), 1 );
- m_finder->predictiveSearchQuery( QString("50") );
- QCOMPARE( m_finder->resultsCount(), 2 );
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 2 );
-
-}
-
-//There is recent call in logs, and contacts DB
-void st_LogsCntFinder::testPredictiveSearchQueryLogsContacts()
-{
- createHistoryEvents();
- createContacts();
-
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 2 );
-
- //case 1
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 2 );
- //see half of matched results
- //results == for(int i =0;i<f->resultCount() / 2;i++){f->resultAt(i);}
- /*QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(1).firstName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(1).lastName().at(0).text(), QString(""));*/
-
- m_finder->predictiveSearchQuery( QString("533") );
- QCOMPARE( m_finder->resultsCount(), 0 );
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 2 );
-
- //case 2
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 2 );
- //see half of matched results
- //results == for(int i =0;i<f->resultCount() / 2;i++){f->resultAt(i);}
- /*QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(0).lastName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(1).firstName().at(0).text(), QString(""));
- QCOMPARE(m_finder->resultAt(1).lastName().at(0).text(), QString(""));*/
-
- m_finder->predictiveSearchQuery( QString("50") );
- QCOMPARE( m_finder->resultsCount(), 2 );
- m_finder->predictiveSearchQuery( QString("503") );
- QCOMPARE( m_finder->resultsCount(), 1 );
- m_finder->predictiveSearchQuery( QString("50") );
- QCOMPARE( m_finder->resultsCount(), 2 );
- m_finder->predictiveSearchQuery( QString("5") );
- QCOMPARE( m_finder->resultsCount(), 2 );
-
-}
-
-void st_LogsCntFinder::testQueryOrder()
+void ST_LogsCntFinder::testQueryOrder()
{
createContactsForQueryOrder();
@@ -507,65 +750,24 @@
QCOMPARE(m_finder->resultAt(7).lastName().at(0).text(), QString("Yadira"));
}
-void st_LogsCntFinder::createContactsForQueryOrder()
+void ST_LogsCntFinder::testContactWithNonMappedChars()
{
- createContacts();
- createOneContact( QString("Anna"), QString("Qwerty"), QString("45789348") );
- createOneContact( QString("Paula"), QString("Qwerty"), QString("78945617") );
- createOneContact( QString("Paula"), QString("Azerty"), QString("78945617") );
+ //Hannu%
+ //%Hannu
+ createContactsWithNonMappedChars();
+
+ m_finder->predictiveSearchQuery( QString("4") );
+ QCOMPARE( m_finder->resultsCount(), 1 );//Hannu%
+ QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString("Hannu%"));
- int contactsCount = m_manager->contactIds().count();
- QCOMPARE(contactsCount, 16);
+ m_finder->predictiveSearchQuery( QString("42") );//all cached
+ QCOMPARE( m_finder->resultsCount(), 1 );//Hannu%
+ QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString("Hannu%"));
+
+ m_finder->predictiveSearchQuery( QString("") );//empty cache
+ m_finder->predictiveSearchQuery( QString("42") );
+ QCOMPARE( m_finder->resultsCount(), 1 );//Hannu%
+ QCOMPARE(m_finder->resultAt(0).firstName().at(0).text(), QString("Hannu%"));
+
}
-//QTEST_MAIN(st_LogsCntFinder);
-
-/*int main(int argc, char *argv[])
-{
- bool promptOnExit(true);
- bool xmlOutput(false);
-
- for (int i=0; i<argc; i++) {
- if (QString(argv[i]) == "-noprompt") {
- promptOnExit = false;
- }
- if (QString(argv[i]) == "-xml") {
- xmlOutput = true;
- }
- }
- printf("Running tests...\n");
-
- QApplication app(argc, argv);
- st_LogsCntFinder st_logscntfinder;
- QString resultFileName = "c:/data/others/st_LogsCntFinder";
- resultFileName.append(xmlOutput ? ".xml" : ".txt");
- QStringList args_logsCntFinder("st_logscntfinder");
- if (xmlOutput)
- args_logsCntFinder.append("-xml");
- args_logsCntFinder << "-v1" << "-o" << resultFileName;
- QTest::qExec(&st_logscntfinder, args_logsCntFinder);
-
- if (xmlOutput) {
- TestResultXmlParser parser;
- parser.parseAndPrintResults(resultFileName);
- }
-
- if (promptOnExit) {
- printf("Press any key...\n");
- getchar();
- }
-
- return 0;
-}*/
-
-int main(int argc, char *argv[]) //on HW
-{
- QApplication app(argc, argv);
-
- st_LogsCntFinder st_logscntfinder;
- QString resultFileName = "c:/data/others/st_logscntfinder.txt";
- QStringList args_logsCntFinder( "st_logscntfinder");
- args_logsCntFinder << "-o" << resultFileName;
- QTest::qExec(&st_logscntfinder, args_logsCntFinder);
- return 0;
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinderqwerty.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,271 @@
+/*
+* 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 "st_logscntfinderqwerty.h"
+#include "testresultxmlparser.h"
+
+#include <qtcontacts.h>
+#include <QtTest/QtTest>
+#include <hbinputsettingproxy.h>
+
+
+#define ADD_CONTACT( id, first, last, pnumber, mail1, mail2, mail3 )\
+ QContact phonecontact##id;\
+ QContactName contactName##id;\
+ if ( QString( first).length() ) {\
+ contactName##id.setFirstName( first );\
+ }\
+ if ( QString( last ).length() ) {\
+ contactName##id.setLastName( last );\
+ }\
+ QVERIFY(phonecontact##id.saveDetail(&contactName##id));\
+ if ( QString( pnumber ).length() ) {\
+ QContactPhoneNumber number;\
+ number.setContexts("Home");\
+ number.setSubTypes("Mobile");\
+ number.setNumber( pnumber );\
+ phonecontact##id.saveDetail(&number);\
+ }\
+ if ( QString( mail1 ).length() ) {\
+ QContactEmailAddress email;\
+ email.setEmailAddress( mail1 );\
+ phonecontact##id.saveDetail(&email);\
+ }\
+ if ( QString( mail2 ).length() ) {\
+ QContactEmailAddress email;\
+ email.setEmailAddress( mail2 );\
+ phonecontact##id.saveDetail(&email);\
+ }\
+ if ( QString( mail3 ).length() ) {\
+ QContactEmailAddress email;\
+ email.setEmailAddress( mail3 );\
+ phonecontact##id.saveDetail(&email);\
+ }\
+ QVERIFY(m_manager->saveContact(&phonecontact##id))
+
+
+void ST_LogsCntFinderQwerty::initTestCase()
+{
+}
+
+void ST_LogsCntFinderQwerty::cleanupTestCase()
+{
+
+}
+
+
+void ST_LogsCntFinderQwerty::init()
+{
+ HbInputLanguage eng( QLocale::English );
+ HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+
+ //open symbian database
+ m_manager = new QContactManager("symbian");
+
+ // Remove all contacts from the database
+ QList<QContactLocalId> cnt_ids = m_manager->contactIds();
+ m_manager->removeContacts(cnt_ids, 0 );
+ cnt_ids = m_manager->contactIds();
+ QCOMPARE(cnt_ids.count(), 0);
+
+}
+
+void ST_LogsCntFinderQwerty::cleanup()
+{
+ delete m_manager;
+ m_manager = 0;
+ HbInputLanguage eng( QLocale::English );
+ HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+
+}
+
+void ST_LogsCntFinderQwerty::createContacts()
+{
+
+ // Remove all contacts from the database
+ QList<QContactLocalId> cnt_ids = m_manager->contactIds();
+ m_manager->removeContacts(cnt_ids, 0 );
+ cnt_ids = m_manager->contactIds();
+ QVERIFY(0 == cnt_ids.count());
+
+ // 'id' first last phonenumber email1 email2 email3
+ ADD_CONTACT( 1, "Stefann", "Yadira", "0035893424558", "syadira@gmail.com", "stefann.yadira@nokia.com", "" );
+ ADD_CONTACT( 2, "", "", "00861048294754", "company1@sohu.com", "", "" );
+ ADD_CONTACT( 3, "Olga", "", "0938485604", "olga089@ovi.com", "test1@yahoo.com", "olga.baranik.s@nordea.com" );
+ ADD_CONTACT( 4, "", "Fesko", "+35892874754", "test2@ovi.com", "", "" );
+ ADD_CONTACT( 5, "Petter", "Harhai", "0402348850", "", "", "" );
+ ADD_CONTACT( 6, "Levis", "Augustin Zi", "", "levis.augustin.z@nokia.com", "laugustin@ovi.com", "" );
+ ADD_CONTACT( 7, "Matt", "Cook", "", "shymatt@live.com", "", "" );
+
+}
+
+
+/* expected results
+ Search steps: search "s", contact (1 & 7) match;
+ search "s ya", contact (1) match;
+ search "syadira", contact (1) match;
+ search "pett", no match;
+ search "levis.augu_whatever", contact (6) match;
+ search "olga.b", contact (3) match;
+*/
+
+
+//search "s", contact (1 & 7) match
+void ST_LogsCntFinderQwerty::testPredictiveEmailSearchNameAndEmailMatch()
+{
+
+ createContacts();
+
+ QContactDetailFilter df;
+ df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress );
+ df.setMatchFlags( QContactFilter::MatchKeypadCollation );
+ QContactLocalId cid;
+ QContact contact;
+ QContactName contactName;
+
+ QString pattern = QString("s") + QChar(30) + QString("vqwerty");
+ df.setValue( pattern );
+ QList<QContactLocalId> cnt_ids = m_manager->contactIds( df );
+ QCOMPARE( cnt_ids.count(), 2 );
+ cid = cnt_ids.at( 0 );
+ contact = m_manager->contact( cid );
+ contactName = contact.detail( QContactName::DefinitionName );
+ QCOMPARE( contactName.value( QContactName::FieldFirstName ), QString("Matt" ) );
+ QCOMPARE( contact.details( QContactEmailAddress::DefinitionName ).count(), 1 );
+ QCOMPARE( contact.details( QContactEmailAddress::DefinitionName )[0].value( QContactEmailAddress::FieldEmailAddress ), QString( "shymatt@live.com" ) );
+ cid = cnt_ids.at( 1 );
+ contact = m_manager->contact( cid );
+ contactName = contact.detail( QContactName::DefinitionName );
+ QCOMPARE( contactName.value( QContactName::FieldFirstName ), QString("Stefann" ) );
+ QCOMPARE( contact.details( QContactEmailAddress::DefinitionName ).count(), 2 );
+ QCOMPARE( contact.details( QContactEmailAddress::DefinitionName )[0].value( QContactEmailAddress::FieldEmailAddress ), QString( "syadira@gmail.com" ) );
+ QCOMPARE( contact.details( QContactEmailAddress::DefinitionName )[1].value( QContactEmailAddress::FieldEmailAddress ), QString( "stefann.yadira@nokia.com" ) );
+}
+
+//search "s ya", contact (1) match
+void ST_LogsCntFinderQwerty::testPredictiveEmailSearchWithSpace()
+{
+
+ createContacts();
+
+ QContactDetailFilter df;
+ df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress );
+ df.setMatchFlags( QContactFilter::MatchKeypadCollation );
+ QContactLocalId cid;
+ QContact contact;
+ QContactName contactName;
+
+ QString pattern = QString("s ya") + QChar(30) + QString("vqwerty");
+ df.setValue( pattern );
+ QList<QContactLocalId> cnt_ids = m_manager->contactIds( df );
+ QCOMPARE( cnt_ids.count(), 1 );
+ cid = cnt_ids.at( 0 );
+ contact = m_manager->contact( cid );
+ contactName = contact.detail( QContactName::DefinitionName );
+ QCOMPARE( contactName.value( QContactName::FieldFirstName ), QString("Stefann" ) );
+
+}
+
+//search "syadira", contact (1) match
+void ST_LogsCntFinderQwerty::testPredictiveEmailSearchEmailMatch()
+{
+
+ createContacts();
+
+ QContactDetailFilter df;
+ df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress );
+ df.setMatchFlags( QContactFilter::MatchKeypadCollation );
+ QContactLocalId cid;
+ QContact contact;
+ QContactName contactName;
+
+ QString pattern = QString("syadira") + QChar(30) + QString("vqwerty");
+ df.setValue( pattern );
+ QList<QContactLocalId> cnt_ids = m_manager->contactIds( df );
+ QCOMPARE( cnt_ids.count(), 1 );
+ cid = cnt_ids.at( 0 );
+ contact = m_manager->contact( cid );
+ contactName = contact.detail( QContactName::DefinitionName );
+ QCOMPARE( contactName.value( QContactName::FieldFirstName ), QString("Stefann" ) );
+}
+
+//search "pett", no match
+void ST_LogsCntFinderQwerty::testPredictiveEmailSearchNoEmails()
+{
+
+ createContacts();
+
+ QContactDetailFilter df;
+ df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress );
+ df.setMatchFlags( QContactFilter::MatchKeypadCollation );
+ QContact contact;
+ QContactName contactName;
+
+ QString pattern = QString("pett") + QChar(30) + QString("vqwerty");
+ df.setValue( pattern );
+ QList<QContactLocalId> cnt_ids = m_manager->contactIds( df );
+ QCOMPARE( cnt_ids.count(), 0 );
+
+}
+
+//search "levis.augu_whatever", contact (6) match
+void ST_LogsCntFinderQwerty::testPredictiveEmailSearchOverLongPattern()
+{
+
+ createContacts();
+
+ QContactDetailFilter df;
+ df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress );
+ df.setMatchFlags( QContactFilter::MatchKeypadCollation );
+ QContactLocalId cid;
+ QContact contact;
+ QContactName contactName;
+
+ QString pattern = QString("levis.augu_whatever") + QChar(30) + QString("vqwerty");
+ df.setValue( pattern );
+ QList<QContactLocalId> cnt_ids = m_manager->contactIds( df );
+ QCOMPARE( cnt_ids.count(), 1 );
+ cid = cnt_ids.at( 0 );
+ contact = m_manager->contact( cid );
+ contactName = contact.detail( QContactName::DefinitionName );
+ QCOMPARE( contactName.value( QContactName::FieldFirstName ), QString("Levis" ) );
+}
+
+//search "olga.b", contact (3) match
+void ST_LogsCntFinderQwerty::testPredictiveEmailSearchSpecialCharsInPattern()
+{
+
+ createContacts();
+
+ QContactDetailFilter df;
+ df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress );
+ df.setMatchFlags( QContactFilter::MatchKeypadCollation );
+ QContactLocalId cid;
+ QContact contact;
+ QContactName contactName;
+
+ //search "olga.b", contact (3) match
+ QString pattern = QString("olga.b") + QChar(30) + QString("vqwerty");
+ df.setValue( pattern );
+ QList<QContactLocalId> cnt_ids = m_manager->contactIds( df );
+ QCOMPARE( cnt_ids.count(), 1 );
+ cid = cnt_ids.at( 0 );
+ contact = m_manager->contact( cid );
+ contactName = contact.detail( QContactName::DefinitionName );
+ QCOMPARE( contactName.value( QContactName::FieldFirstName ), QString("Olga" ) );
+
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinderthai.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,157 @@
+/*
+* 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 "st_logscntfinderthai.h"
+#include "logscntfinder.h"
+#include "testresultxmlparser.h"
+
+#include <qtcontacts.h>
+#include <QtTest/QtTest>
+#include <hbinputsettingproxy.h>
+
+void ST_LogsCntFinderThai::initTestCase()
+{
+}
+
+void ST_LogsCntFinderThai::cleanupTestCase()
+{
+
+}
+
+
+void ST_LogsCntFinderThai::init()
+{
+ HbInputLanguage eng( QLocale::Thai );
+ HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+
+ m_finder = 0;
+ //open symbian database
+ m_manager = new QContactManager("symbian");
+ m_finder = new LogsCntFinder(*m_manager);
+ QVERIFY(m_finder);
+
+ // Remove all contacts from the database
+ QList<QContactLocalId> cnt_ids = m_manager->contactIds();
+ QVERIFY( m_manager->removeContacts(cnt_ids, 0 ) );
+
+ cnt_ids = m_manager->contactIds();
+ QCOMPARE(cnt_ids.count(), 0);
+
+ for (int i = 0; i < 10; ++i) {
+ m_finder->predictiveSearchQuery( QString::number(i) );
+ QCOMPARE( m_finder->resultsCount(), 0 );
+ }
+}
+
+void ST_LogsCntFinderThai::cleanup()
+{
+ delete m_manager;
+ m_manager = 0;
+ delete m_finder;
+ m_finder = 0;
+ HbInputLanguage eng( QLocale::English );
+ HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+
+}
+
+void ST_LogsCntFinderThai::createThaiContacts()
+{
+ /*Create contacts in Contacts DB
+ */
+
+ const QChar thaiFName1[] = {0x0E06,0x0E0A}; // map:23
+ const QChar thaiLName1[] = {0x0E0E,0x0E14,0x0E19,0x0E1E,0x0E23,0x0E2A };//map 456789
+
+ QString first ( thaiFName1, 2 );
+ QString last ( thaiFName1, 6 );
+ createOneContact( first, last, QString("932472398") );
+
+ const QChar thaiFName2[] = {0x0E30,0x0E0A};//#3,
+ const QChar thaiLName2[] = {0x0E2F,0x0E14,0x0E19,0x0E1E,0x0E23,0x0E2A };//*56789
+
+ QString first2 ( thaiFName1, 2 );
+ QString last2 ( thaiFName1, 6 );
+ createOneContact( first2, last2, QString("932472398") );
+
+ int contactsCount = m_manager->contactIds().count();
+ QCOMPARE(contactsCount, 2);
+
+
+}
+
+
+
+void ST_LogsCntFinderThai::createOneContact(QString firstname, QString Lastname,
+ QString phnumber)
+{
+ //Currenlty we can only fetch firstname,lastname,companyname and sip/email/phone from the databse
+ // so create contact with only these details
+ QContact phonecontact;
+ // Stefann Fedrernn +02644424423 ste.Fed@nokia.com
+ // Contact details
+ QContactName contactName;
+ contactName.setFirstName(firstname);
+ contactName.setLastName(Lastname);
+ phonecontact.saveDetail(&contactName);
+
+ QContactPhoneNumber number;
+ number.setContexts("Home");
+ number.setSubTypes("Mobile");
+ number.setNumber(phnumber);
+ phonecontact.saveDetail(&number);
+
+ m_manager->saveContact(&phonecontact);
+}
+
+
+
+//
+// Tests
+//
+
+void ST_LogsCntFinderThai::testPredictiveThaiSearchQuery()
+{
+ HbInputLanguage thai( QLocale::Thai );
+ HbInputSettingProxy::instance()->setGlobalInputLanguage( thai );
+
+ createThaiContacts();
+
+ QEXPECT_FAIL("", "Not supported yet. Issues", Abort );
+
+ //There is no recent call in logs UI
+ //case 1
+ m_finder->predictiveSearchQuery( QString("2") );
+ QCOMPARE( m_finder->resultsCount(), 1 );
+
+ m_finder->predictiveSearchQuery( QString("4") );
+ QCOMPARE( m_finder->resultsCount(), 1 );
+
+ m_finder->predictiveSearchQuery( QString("402") );
+ QCOMPARE( m_finder->resultsCount(), 1 );
+
+ m_finder->predictiveSearchQuery( QString("*4") );
+ QCOMPARE( m_finder->resultsCount(), 1 );
+
+ m_finder->predictiveSearchQuery( QString("*402###") );
+ QCOMPARE( m_finder->resultsCount(), 1 );
+
+ m_finder->predictiveSearchQuery( QString("*4***00002###") );
+ QCOMPARE( m_finder->resultsCount(), 1 );
+
+
+}
+
+
--- a/logsui/logscntfinder/tsrc/st_logscntfinder/st_logscntfinder.pro Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/st_logscntfinder.pro Thu Jul 22 16:33:49 2010 +0100
@@ -20,16 +20,15 @@
QT += testlib xml
CONFIG += qtestlib
+CONFIG += hb
+DEFINES += QT_NO_DEBUG_OUTPUT
-#include(../tsrc.pri)
-
-DEFINES += PBK_UNIT_TEST
DEPENDPATH += .
INCLUDEPATH += ./
INCLUDEPATH += ./inc
INCLUDEPATH += ../inc
-#DEPENDPATH += .
+DEPENDPATH += .
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
INCLUDEPATH += ../../
INCLUDEPATH += ../../inc
@@ -37,18 +36,18 @@
INCLUDEPATH += ../../../tsrc/qtestutils/inc
# Input
-HEADERS += inc\st_logscntfinder.h
+HEADERS += inc/st_logscntfinder.h
+HEADERS += inc/st_logscntfinderqwerty.h
+HEADERS += inc/st_logscntfinderthai.h
-SOURCES += src\st_logscntfinder.cpp
+SOURCES += src/main.cpp
+SOURCES += src/st_logscntfinder.cpp
+SOURCES += src/st_logscntfinderqwerty.cpp
+SOURCES += src/st_logscntfinderthai.cpp
SOURCES += ../../../tsrc/qtestutils/src/testresultxmlparser.cpp
symbian: {
- TARGET.UID2 = 0x100039CE
- TARGET.UID3 = 0xEfa329b3
TARGET.CAPABILITY = ALL -TCB
TARGET.EPOCALLOWDLLDATA = 1
- LIBS += \
- -lxqservice \
- -lQtContacts \
- -llogscntfinder
+ LIBS += -lflogger -lqtcontacts -llogscntfinder
}
--- a/logsui/logscntfinder/tsrc/stubs/qtcontacts_stubs.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/stubs/qtcontacts_stubs.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -155,11 +155,9 @@
QList<QContactLocalId> QContactManager::contactIds(
- const QContactFilter& filter,
+ const QContactFilter& /*filter*/,
const QList<QContactSortOrder>& /*sortOrders*/) const
{
- const QContactDetailFilter& df =
- static_cast<const QContactDetailFilter&>( filter );
QList<QContactLocalId> list;
ContactQueryResults* resultSet = ContactQueryResults::instance();
@@ -172,9 +170,10 @@
return list;
}
+
QContact QContactManager::contact(
- const QContactLocalId& contactId,
- const QStringList& definitionRestrictions ) const
+ const QContactLocalId& contactId,
+ const QContactFetchHint& /*fetchHint*/) const
{
QContact contact;
QContactId id;
@@ -184,6 +183,7 @@
return contact;
}
+
// ----------------------------------------------------------------------------
// QContactDetailFilter
// ----------------------------------------------------------------------------
@@ -232,9 +232,9 @@
}
-QContact& QContact::operator=(const QContact& other)
+QContact& QContact::operator=(const QContact& /*other*/)
{
-
+ return *this;
}
QContactDetail QContact::detail(const QString& definitionId) const
@@ -244,8 +244,8 @@
if ( definitionId == QContactName::DefinitionName ){
QContactName name;
QContactLocalId id = localId();
- name.setValue(QContactName::FieldFirst, results->firstNameAt( (int) id-1 ) );
- name.setValue(QContactName::FieldLast, results->lastNameAt( (int) id-1 ) );
+ name.setValue(QContactName::FieldFirstName, results->firstNameAt( (int) id-1 ) );
+ name.setValue(QContactName::FieldLastName, results->lastNameAt( (int) id-1 ) );
return name;
}
if ( definitionId == QContactPhoneNumber::DefinitionName ){
@@ -256,10 +256,7 @@
}
if ( definitionId == QContactAvatar::DefinitionName){
QContactAvatar avatar;
- avatar.setSubType(QContactAvatar::SubTypeImage);
- avatar.setAvatar("c:\\data\\images\\logstest1.jpg");
- QString a( "Avatar" );
- avatar.setValue( QContactAvatar::FieldAvatar, a );
+ avatar.setValue(QContactAvatar::FieldImageUrl, "c:\\data\\images\\logstest1.jpg" );
return avatar;
}
QContactDetail detail;
@@ -275,19 +272,21 @@
{
}
-QContactDetail::QContactDetail(const QString& definitionName) : d(new QContactDetailPrivate)
+
+QContactDetail::QContactDetail(const QString& /*definitionName*/) : d(new QContactDetailPrivate)
{
}
+
QContactDetail::~QContactDetail()
{
}
-QContactDetail& QContactDetail::operator=(const QContactDetail& other)
+QContactDetail& QContactDetail::operator=(const QContactDetail& /*other*/)
{
-
+ return *this;
}
QString QContactDetail::definitionName() const
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logscntentry.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logscntentry.h Thu Jul 22 16:33:49 2010 +0100
@@ -54,6 +54,8 @@
void testSetHighlights_latin12k();
void testRichText_latin12k();
void testMatch_latin12k();
+ void testStartsWith_latin12k();
+
//with thai 12 keys
void testMatch_thai12k();
void testSetHighlights_thai12k();
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivelatin12keytranslator.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivelatin12keytranslator.h Thu Jul 22 16:33:49 2010 +0100
@@ -45,8 +45,10 @@
private slots: //test methods
void testConstructor();
- void testTranslate();
+ void testTranslateText();
+ void testTranslatePattern();
void testTranslateChar();
+ void testEncodes();
private:
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivethai12keytranslator.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivethai12keytranslator.h Thu Jul 22 16:33:49 2010 +0100
@@ -46,12 +46,13 @@
private slots: //test methods
void testConstructor();
- void testTranslate();
+ void testTranslateText();
+ void testTranslatePattern();
void testTranslateChar();
+ void testEncodes();
private:
- HbInputLanguage mOrigLang;
LogsPredictiveThai12KeyTranslator* mTranslator;
};
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivetranslator.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivetranslator.h Thu Jul 22 16:33:49 2010 +0100
@@ -47,7 +47,9 @@
void testConstructor();
void testTranslate();
- void testStartsWith();
+ void testTranslatePattern();
+ void testTranslateText();
+ void testNameTranslator();
private:
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logscntentry.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logscntentry.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -23,7 +23,7 @@
#include <QtTest/QtTest>
#define PATTERN( pattern )\
- LogsPredictiveTranslator::instance()->translate( QString( pattern ) )
+ LogsPredictiveTranslator::instance()->translatePattern( QString( pattern ) )
void UT_LogsCntEntry::initTestCase()
@@ -625,7 +625,7 @@
mEntry->setFirstName( QString("Alice 028") );
mEntry->setLastName( QString( "Ming" ) );
QVERIFY( mEntry->match( PATTERN( "02806" ) ) );
- QVERIFY( !mEntry->match( PATTERN( "0280" ) ) );//not supported
+ QVERIFY( mEntry->match( PATTERN( "0280" ) ) );//not supported
mEntry->mType = LogsCntEntry::EntryTypeContact;
QVERIFY( !mEntry->match( PATTERN( "+202" ) ) );
@@ -636,6 +636,24 @@
}
+void UT_LogsCntEntry::testStartsWith_latin12k()
+{
+ //just using numbers as name
+ mEntry->setFirstName( QString( "" ) );
+ QCOMPARE( mEntry->startsWith( mEntry->firstName()[0], QString("") ), 0 );
+ QCOMPARE( mEntry->startsWith( mEntry->firstName()[0], QString("123") ), 0 );
+
+ mEntry->setFirstName( QString( "123" ) );
+ QCOMPARE( mEntry->startsWith( mEntry->firstName()[0], QString("") ), 0 );
+ QCOMPARE( mEntry->startsWith( mEntry->firstName()[0], QString("1234") ), 0 );
+ QCOMPARE( mEntry->startsWith( mEntry->firstName()[0], QString("1") ), 1 );
+ QCOMPARE( mEntry->startsWith( mEntry->firstName()[0], QString("123") ), 3 );
+ QCOMPARE( mEntry->startsWith( mEntry->firstName()[0], QString("12"), true ), 2 );
+ QCOMPARE( mEntry->startsWith( mEntry->firstName()[0], QString("12"), false ), 2 );
+
+}
+
+
void UT_LogsCntEntry::testMatch_thai12k()
{
@@ -689,3 +707,4 @@
}
+
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logscntfinder.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logscntfinder.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -72,7 +72,6 @@
QSignalSpy queryReadySpy(mFinder, SIGNAL(queryReady() ) );
QSignalSpy resultsAddedSpy(mCntResults, SIGNAL(resultsAdded() ) );
- int resultsCount = 0;
LogsCntEntryHandle* handle1 = (LogsCntEntryHandle*)1;
LogsCntEntryHandle* handle2 = (LogsCntEntryHandle*)2;
LogsCntEntryHandle* handle3 = (LogsCntEntryHandle*)3;
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictive12keytranslator.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictive12keytranslator.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -28,14 +28,18 @@
public:
inline LogsPredictive12KeyTranslator_mock()
- :LogsPredictive12KeyTranslator()
- { mKeyMap =
- HbKeymapFactory::instance()->keymap( QLocale::English,
- QLocale::AnyCountry );
+ :LogsPredictive12KeyTranslator( QLocale::English )
+ {
}
inline QStringList nameTokens( const QString& /*name*/ ) const
{return QStringList();}
+ inline const QChar translateChar( const QChar /*character*/, bool& /*ok*/ ) const
+ {return QChar();}
+ inline bool encodes( const QString& /*sniplet*/ )
+ {return true;}
+ inline int mib() const {return 0;}
+
};
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivelatin12keytranslator.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivelatin12keytranslator.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -17,6 +17,7 @@
#include "ut_logspredictivelatin12keytranslator.h"
#include "logspredictivelatin12keytranslator.h"
+#include <hbinputsettingproxy.h>
#include <QtTest/QtTest>
#include <QSignalSpy>
@@ -32,7 +33,8 @@
void UT_LogsPredictiveLatin12KeyTranslator::init()
{
- mTranslator = new LogsPredictiveLatin12KeyTranslator();
+ mTranslator = new LogsPredictiveLatin12KeyTranslator(
+ HbInputSettingProxy::instance()->globalInputLanguage() );
}
void UT_LogsPredictiveLatin12KeyTranslator::cleanup()
@@ -48,139 +50,164 @@
}
-void UT_LogsPredictiveLatin12KeyTranslator::testTranslate()
+void UT_LogsPredictiveLatin12KeyTranslator::testTranslateText()
{
- QVERIFY( mTranslator->translate( QString( "Nokia" ) ) == QString( "66542" ) );
- QVERIFY( mTranslator->translate( QString( "Aarne" ) ) == QString( "22763" ) );
- QVERIFY( mTranslator->translate( QString( "Bertta" ) ) == QString( "237882" ) );
- QVERIFY( mTranslator->translate( QString( "Celsius" ) ) == QString( "2357487" ) );
- QVERIFY( mTranslator->translate( QString( "Daavid" ) ) == QString( "322843" ) );
- QVERIFY( mTranslator->translate( QString( "Eemeli" ) ) == QString( "336354" ) );
- QVERIFY( mTranslator->translate( QString( "Faarao" ) ) == QString( "322726" ) );
- QVERIFY( mTranslator->translate( QString( "Gideon" ) ) == QString( "443366" ) );
- QVERIFY( mTranslator->translate( QString( "Heikki" ) ) == QString( "434554" ) );
- QVERIFY( mTranslator->translate( QString( "Iivari" ) ) == QString( "448274" ) );
- QVERIFY( mTranslator->translate( QString( "Jussi" ) ) == QString( "58774" ) );
- QVERIFY( mTranslator->translate( QString( "Kalle" ) ) == QString( "52553" ) );
- QVERIFY( mTranslator->translate( QString( "Lauri" ) ) == QString( "52874" ) );
- QVERIFY( mTranslator->translate( QString( "Matti" ) ) == QString( "62884" ) );
- QVERIFY( mTranslator->translate( QString( "Niilo" ) ) == QString( "64456" ) );
- QVERIFY( mTranslator->translate( QString( "Otto" ) ) == QString( "6886" ) );
- QVERIFY( mTranslator->translate( QString( "Paavo" ) ) == QString( "72286" ) );
- QVERIFY( mTranslator->translate( QString( "Kuu" ) ) == QString( "588" ) );
- QVERIFY( mTranslator->translate( QString( "Risto" ) ) == QString( "74786" ) );
- QVERIFY( mTranslator->translate( QString( "Sakari" ) ) == QString( "725274" ) );
- QVERIFY( mTranslator->translate( QString( "Tyyne" ) ) == QString( "89963" ) );
- QVERIFY( mTranslator->translate( QString( "Urho" ) ) == QString( "8746" ) );
- QVERIFY( mTranslator->translate( QString( "Vihtori" ) ) == QString( "8448674" ) );
- QVERIFY( mTranslator->translate( QString( "Wiski" ) ) == QString( "94754" ) );
- QVERIFY( mTranslator->translate( QString( "Yrjö" ) ) == QString( "9756" ) );
- QVERIFY( mTranslator->translate( QString( "Tseta" ) ) == QString( "87382" ) );
- QVERIFY( mTranslator->translate( QString( "Åke" ) ) == QString( "253" ) );
- QVERIFY( mTranslator->translate( QString( "Äiti" ) ) == QString( "2484" ) );
- QVERIFY( mTranslator->translate( QString( "Öljy" ) ) == QString( "6559" ) );
- QVERIFY( mTranslator->translate( QString( "Adam" ) ) == QString( "2326" ) );
- QVERIFY( mTranslator->translate( QString( "Bertil" ) ) == QString( "237845" ) );
- QVERIFY( mTranslator->translate( QString( "Cesar" ) ) == QString( "23727" ) );
- QVERIFY( mTranslator->translate( QString( "David" ) ) == QString( "32843" ) );
- QVERIFY( mTranslator->translate( QString( "Erik" ) ) == QString( "3745" ) );
- QVERIFY( mTranslator->translate( QString( "Filip" ) ) == QString( "34547" ) );
- QVERIFY( mTranslator->translate( QString( "Gustav" ) ) == QString( "487828" ) );
- QVERIFY( mTranslator->translate( QString( "Helge" ) ) == QString( "43543" ) );
- QVERIFY( mTranslator->translate( QString( "Ivar" ) ) == QString( "4827" ) );
- QVERIFY( mTranslator->translate( QString( "Johan" ) ) == QString( "56426" ) );
- QVERIFY( mTranslator->translate( QString( "Kalle" ) ) == QString( "52553" ) );
- QVERIFY( mTranslator->translate( QString( "Ludvig" ) ) == QString( "583844" ) );
- QVERIFY( mTranslator->translate( QString( "Martin" ) ) == QString( "627846" ) );
- QVERIFY( mTranslator->translate( QString( "Niklas" ) ) == QString( "645527" ) );
- QVERIFY( mTranslator->translate( QString( "Olof" ) ) == QString( "6563" ) );
- QVERIFY( mTranslator->translate( QString( "Petter" ) ) == QString( "738837" ) );
- QVERIFY( mTranslator->translate( QString( "Quintus" ) ) == QString( "7846887" ) );
- QVERIFY( mTranslator->translate( QString( "Rudolf" ) ) == QString( "783653" ) );
- QVERIFY( mTranslator->translate( QString( "Sigurd" ) ) == QString( "744873" ) );
- QVERIFY( mTranslator->translate( QString( "Tore" ) ) == QString( "8673" ) );
- QVERIFY( mTranslator->translate( QString( "Urban" ) ) == QString( "87226" ) );
- QVERIFY( mTranslator->translate( QString( "Viktor" ) ) == QString( "845867" ) );
- QVERIFY( mTranslator->translate( QString( "Wilhelm" ) ) == QString( "9454356" ) );
- QVERIFY( mTranslator->translate( QString( "Xerxes" ) ) == QString( "937937" ) );
- QVERIFY( mTranslator->translate( QString( "Yngve" ) ) == QString( "96483" ) );
- QVERIFY( mTranslator->translate( QString( "Zäta" ) ) == QString( "9282" ) );
- QVERIFY( mTranslator->translate( QString( "Ärlig" ) ) == QString( "27544" ) );
- QVERIFY( mTranslator->translate( QString( "Östen" ) ) == QString( "67836" ) );
- QVERIFY( mTranslator->translate( QString( "Alpha" ) ) == QString( "25742" ) );
- QVERIFY( mTranslator->translate( QString( "Bravo" ) ) == QString( "27286" ) );
- QVERIFY( mTranslator->translate( QString( "Charlie" ) ) == QString( "2427543" ) );
- QVERIFY( mTranslator->translate( QString( "Delta" ) ) == QString( "33582" ) );
- QVERIFY( mTranslator->translate( QString( "Echo" ) ) == QString( "3246" ) );
- QVERIFY( mTranslator->translate( QString( "Foxtrot" ) ) == QString( "3698768" ) );
- QVERIFY( mTranslator->translate( QString( "Golf" ) ) == QString( "4653" ) );
- QVERIFY( mTranslator->translate( QString( "Hotel" ) ) == QString( "46835" ) );
- QVERIFY( mTranslator->translate( QString( "India" ) ) == QString( "46342" ) );
- QVERIFY( mTranslator->translate( QString( "Juliet" ) ) == QString( "585438" ) );
- QVERIFY( mTranslator->translate( QString( "Kilo" ) ) == QString( "5456" ) );
- QVERIFY( mTranslator->translate( QString( "Lima" ) ) == QString( "5462" ) );
- QVERIFY( mTranslator->translate( QString( "Mike" ) ) == QString( "6453" ) );
- QVERIFY( mTranslator->translate( QString( "November" ) ) == QString( "66836237" ) );
- QVERIFY( mTranslator->translate( QString( "Oscar" ) ) == QString( "67227" ) );
- QVERIFY( mTranslator->translate( QString( "Papa" ) ) == QString( "7272" ) );
- QVERIFY( mTranslator->translate( QString( "Quebec" ) ) == QString( "783232" ) );
- QVERIFY( mTranslator->translate( QString( "Romeo" ) ) == QString( "76636" ) );
- QVERIFY( mTranslator->translate( QString( "Sierra" ) ) == QString( "743772" ) );
- QVERIFY( mTranslator->translate( QString( "Tanga" ) ) == QString( "82642" ) );
- QVERIFY( mTranslator->translate( QString( "Uniform" ) ) == QString( "8643676" ) );
- QVERIFY( mTranslator->translate( QString( "Vârlan" ) ) == QString( "827526" ) );
- QVERIFY( mTranslator->translate( QString( "Victor" ) ) == QString( "842867" ) );
- QVERIFY( mTranslator->translate( QString( "Whiskey" ) ) == QString( "9447539" ) );
- QVERIFY( mTranslator->translate( QString( "Xray" ) ) == QString( "9729" ) );
- QVERIFY( mTranslator->translate( QString( "Yankee" ) ) == QString( "926533" ) );
- QVERIFY( mTranslator->translate( QString( "Zulu" ) ) == QString( "9858" ) );
- QVERIFY( mTranslator->translate( QString( "1234567890" ) ) == QString( "1234567890" ) );
- QCOMPARE( mTranslator->translate( QString( "+1234567890" ) ) ,QString( "*1234567890" ) );
- QCOMPARE( mTranslator->translate( QString( "*1234567890" ) ) ,QString( "*1234567890" ) );
- QCOMPARE( mTranslator->translate( QString( "#1234567890" ) ), QString( "#1234567890" ) );
- QCOMPARE( mTranslator->translate( QString( "++##" ) ), QString( "**##" ) );
- QCOMPARE( mTranslator->translate( QString( "-+##" ) ), QString( "1*##" ) );
- QCOMPARE( mTranslator->translate( QString( "/+##" ) ), QString( "1*##" ) );
- QCOMPARE( mTranslator->translate( QString( "*+##" ) ), QString( "**##" ) );
+ QVERIFY( mTranslator->translateText( QString( "Nokia" ) ) == QString( "66542" ) );
+ QVERIFY( mTranslator->translateText( QString( "Aarne" ) ) == QString( "22763" ) );
+ QVERIFY( mTranslator->translateText( QString( "Bertta" ) ) == QString( "237882" ) );
+ QVERIFY( mTranslator->translateText( QString( "Celsius" ) ) == QString( "2357487" ) );
+ QVERIFY( mTranslator->translateText( QString( "Daavid" ) ) == QString( "322843" ) );
+ QVERIFY( mTranslator->translateText( QString( "Eemeli" ) ) == QString( "336354" ) );
+ QVERIFY( mTranslator->translateText( QString( "Faarao" ) ) == QString( "322726" ) );
+ QVERIFY( mTranslator->translateText( QString( "Gideon" ) ) == QString( "443366" ) );
+ QVERIFY( mTranslator->translateText( QString( "Heikki" ) ) == QString( "434554" ) );
+ QVERIFY( mTranslator->translateText( QString( "Iivari" ) ) == QString( "448274" ) );
+ QVERIFY( mTranslator->translateText( QString( "Jussi" ) ) == QString( "58774" ) );
+ QVERIFY( mTranslator->translateText( QString( "Kalle" ) ) == QString( "52553" ) );
+ QVERIFY( mTranslator->translateText( QString( "Lauri" ) ) == QString( "52874" ) );
+ QVERIFY( mTranslator->translateText( QString( "Matti" ) ) == QString( "62884" ) );
+ QVERIFY( mTranslator->translateText( QString( "Niilo" ) ) == QString( "64456" ) );
+ QVERIFY( mTranslator->translateText( QString( "Otto" ) ) == QString( "6886" ) );
+ QVERIFY( mTranslator->translateText( QString( "Paavo" ) ) == QString( "72286" ) );
+ QVERIFY( mTranslator->translateText( QString( "Kuu" ) ) == QString( "588" ) );
+ QVERIFY( mTranslator->translateText( QString( "Risto" ) ) == QString( "74786" ) );
+ QVERIFY( mTranslator->translateText( QString( "Sakari" ) ) == QString( "725274" ) );
+ QVERIFY( mTranslator->translateText( QString( "Tyyne" ) ) == QString( "89963" ) );
+ QVERIFY( mTranslator->translateText( QString( "Urho" ) ) == QString( "8746" ) );
+ QVERIFY( mTranslator->translateText( QString( "Vihtori" ) ) == QString( "8448674" ) );
+ QVERIFY( mTranslator->translateText( QString( "Wiski" ) ) == QString( "94754" ) );
+ QVERIFY( mTranslator->translateText( QString( "Yrjö" ) ) == QString( "9756" ) );
+ QVERIFY( mTranslator->translateText( QString( "Tseta" ) ) == QString( "87382" ) );
+ QVERIFY( mTranslator->translateText( QString( "Åke" ) ) == QString( "253" ) );
+ QVERIFY( mTranslator->translateText( QString( "Äiti" ) ) == QString( "2484" ) );
+ QVERIFY( mTranslator->translateText( QString( "Öljy" ) ) == QString( "6559" ) );
+ QVERIFY( mTranslator->translateText( QString( "Adam" ) ) == QString( "2326" ) );
+ QVERIFY( mTranslator->translateText( QString( "Bertil" ) ) == QString( "237845" ) );
+ QVERIFY( mTranslator->translateText( QString( "Cesar" ) ) == QString( "23727" ) );
+ QVERIFY( mTranslator->translateText( QString( "David" ) ) == QString( "32843" ) );
+ QVERIFY( mTranslator->translateText( QString( "Erik" ) ) == QString( "3745" ) );
+ QVERIFY( mTranslator->translateText( QString( "Filip" ) ) == QString( "34547" ) );
+ QVERIFY( mTranslator->translateText( QString( "Gustav" ) ) == QString( "487828" ) );
+ QVERIFY( mTranslator->translateText( QString( "Helge" ) ) == QString( "43543" ) );
+ QVERIFY( mTranslator->translateText( QString( "Ivar" ) ) == QString( "4827" ) );
+ QVERIFY( mTranslator->translateText( QString( "Johan" ) ) == QString( "56426" ) );
+ QVERIFY( mTranslator->translateText( QString( "Kalle" ) ) == QString( "52553" ) );
+ QVERIFY( mTranslator->translateText( QString( "Ludvig" ) ) == QString( "583844" ) );
+ QVERIFY( mTranslator->translateText( QString( "Martin" ) ) == QString( "627846" ) );
+ QVERIFY( mTranslator->translateText( QString( "Niklas" ) ) == QString( "645527" ) );
+ QVERIFY( mTranslator->translateText( QString( "Olof" ) ) == QString( "6563" ) );
+ QVERIFY( mTranslator->translateText( QString( "Petter" ) ) == QString( "738837" ) );
+ QVERIFY( mTranslator->translateText( QString( "Quintus" ) ) == QString( "7846887" ) );
+ QVERIFY( mTranslator->translateText( QString( "Rudolf" ) ) == QString( "783653" ) );
+ QVERIFY( mTranslator->translateText( QString( "Sigurd" ) ) == QString( "744873" ) );
+ QVERIFY( mTranslator->translateText( QString( "Tore" ) ) == QString( "8673" ) );
+ QVERIFY( mTranslator->translateText( QString( "Urban" ) ) == QString( "87226" ) );
+ QVERIFY( mTranslator->translateText( QString( "Viktor" ) ) == QString( "845867" ) );
+ QVERIFY( mTranslator->translateText( QString( "Wilhelm" ) ) == QString( "9454356" ) );
+ QVERIFY( mTranslator->translateText( QString( "Xerxes" ) ) == QString( "937937" ) );
+ QVERIFY( mTranslator->translateText( QString( "Yngve" ) ) == QString( "96483" ) );
+ QVERIFY( mTranslator->translateText( QString( "Zäta" ) ) == QString( "9282" ) );
+ QVERIFY( mTranslator->translateText( QString( "Ärlig" ) ) == QString( "27544" ) );
+ QVERIFY( mTranslator->translateText( QString( "Östen" ) ) == QString( "67836" ) );
+ QVERIFY( mTranslator->translateText( QString( "Alpha" ) ) == QString( "25742" ) );
+ QVERIFY( mTranslator->translateText( QString( "Bravo" ) ) == QString( "27286" ) );
+ QVERIFY( mTranslator->translateText( QString( "Charlie" ) ) == QString( "2427543" ) );
+ QVERIFY( mTranslator->translateText( QString( "Delta" ) ) == QString( "33582" ) );
+ QVERIFY( mTranslator->translateText( QString( "Echo" ) ) == QString( "3246" ) );
+ QVERIFY( mTranslator->translateText( QString( "Foxtrot" ) ) == QString( "3698768" ) );
+ QVERIFY( mTranslator->translateText( QString( "Golf" ) ) == QString( "4653" ) );
+ QVERIFY( mTranslator->translateText( QString( "Hotel" ) ) == QString( "46835" ) );
+ QVERIFY( mTranslator->translateText( QString( "India" ) ) == QString( "46342" ) );
+ QVERIFY( mTranslator->translateText( QString( "Juliet" ) ) == QString( "585438" ) );
+ QVERIFY( mTranslator->translateText( QString( "Kilo" ) ) == QString( "5456" ) );
+ QVERIFY( mTranslator->translateText( QString( "Lima" ) ) == QString( "5462" ) );
+ QVERIFY( mTranslator->translateText( QString( "Mike" ) ) == QString( "6453" ) );
+ QVERIFY( mTranslator->translateText( QString( "November" ) ) == QString( "66836237" ) );
+ QVERIFY( mTranslator->translateText( QString( "Oscar" ) ) == QString( "67227" ) );
+ QVERIFY( mTranslator->translateText( QString( "Papa" ) ) == QString( "7272" ) );
+ QVERIFY( mTranslator->translateText( QString( "Quebec" ) ) == QString( "783232" ) );
+ QVERIFY( mTranslator->translateText( QString( "Romeo" ) ) == QString( "76636" ) );
+ QVERIFY( mTranslator->translateText( QString( "Sierra" ) ) == QString( "743772" ) );
+ QVERIFY( mTranslator->translateText( QString( "Tanga" ) ) == QString( "82642" ) );
+ QVERIFY( mTranslator->translateText( QString( "Uniform" ) ) == QString( "8643676" ) );
+ QVERIFY( mTranslator->translateText( QString( "Vârlan" ) ) == QString( "827526" ) );
+ QVERIFY( mTranslator->translateText( QString( "Victor" ) ) == QString( "842867" ) );
+ QVERIFY( mTranslator->translateText( QString( "Whiskey" ) ) == QString( "9447539" ) );
+ QVERIFY( mTranslator->translateText( QString( "Xray" ) ) == QString( "9729" ) );
+ QVERIFY( mTranslator->translateText( QString( "Yankee" ) ) == QString( "926533" ) );
+ QVERIFY( mTranslator->translateText( QString( "Zulu" ) ) == QString( "9858" ) );
QString uni;
uni.append(QChar(0x0219));
uni.append(QChar(0x4E0F));
QString result("7");
- QCOMPARE(mTranslator->translate(uni), result);
+ QCOMPARE(mTranslator->translateText(uni), result);
QString uni1;
uni1.append(QChar(0x4E0E));
uni1.append(QChar(0x4E0F));
QString result1("");
- QCOMPARE(mTranslator->translate(uni1), result1);
+ QCOMPARE(mTranslator->translateText(uni1), result1);
QString result2;
- QCOMPARE(mTranslator->translate(uni1), result2);
+ QCOMPARE(mTranslator->translateText(uni1), result2);
+
+}
+
+void UT_LogsPredictiveLatin12KeyTranslator::testTranslatePattern()
+{
+
+ QVERIFY( mTranslator->translatePattern( QString( "1234567890" ) ) == QString( "1234567890" ) );
+ QCOMPARE( mTranslator->translatePattern( QString( "+1234567890" ) ) ,QString( "*1234567890" ) );
+ QCOMPARE( mTranslator->translatePattern( QString( "*1234567890" ) ) ,QString( "*1234567890" ) );
+ QCOMPARE( mTranslator->translatePattern( QString( "#1234567890" ) ), QString( "#1234567890" ) );
+ QCOMPARE( mTranslator->translatePattern( QString( "++##" ) ), QString( "**##" ) );
+ QCOMPARE( mTranslator->translatePattern( QString( "-+##" ) ), QString( "1*##" ) );
+ QCOMPARE( mTranslator->translatePattern( QString( "/+##" ) ), QString( "1*##" ) );
+ QCOMPARE( mTranslator->translatePattern( QString( "*+##" ) ), QString( "**##" ) );
}
void UT_LogsPredictiveLatin12KeyTranslator::testTranslateChar()
{
-
- QCOMPARE( mTranslator->translateChar( QChar('+') ), QChar('*') );
- QCOMPARE( mTranslator->translateChar( QChar('*') ), QChar('*') );
- QCOMPARE( mTranslator->translateChar( QChar('#') ), QChar('#') );
- QCOMPARE( mTranslator->translateChar( QChar('0') ), QChar('0') );
- QCOMPARE( mTranslator->translateChar( QChar('a') ), QChar('2') );
- QCOMPARE( mTranslator->translateChar( QChar('A') ), QChar('2') );
- QCOMPARE( mTranslator->translateChar( QChar('1') ), QChar('1') );
- QCOMPARE( mTranslator->translateChar( QChar('ä') ), QChar('2') );
- QCOMPARE( mTranslator->translateChar( QChar('Ä') ), QChar('2') );
- QCOMPARE( mTranslator->translateChar( QChar('-') ), QChar('1') );
+ bool ok;
+
+ QCOMPARE( mTranslator->translateChar( QChar('+'), ok ), QChar('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('*'), ok ), QChar('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('#'), ok ), QChar('#') );
+ QCOMPARE( mTranslator->translateChar( QChar('0'), ok ), QChar('0') );
+ QCOMPARE( mTranslator->translateChar( QChar('a'), ok ), QChar('2') );
+ QCOMPARE( mTranslator->translateChar( QChar('A'), ok ), QChar('2') );
+ QCOMPARE( mTranslator->translateChar( QChar('1'), ok ), QChar('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('ä'), ok ), QChar('2') );
+ QCOMPARE( mTranslator->translateChar( QChar('Ä'), ok ), QChar('2') );
+ QCOMPARE( mTranslator->translateChar( QChar('-'), ok ), QChar('1') );
// Romanian unicode character "sh"
- QCOMPARE( mTranslator->translateChar( QChar(0x0219) ), QChar('7') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0219), ok ), QChar('7') );
// Chinese unicode character
QChar chn(0x4E0F);
- QCOMPARE( mTranslator->translateChar( QChar(0x4E0F) ), QChar() );
+ QCOMPARE( mTranslator->translateChar( QChar(0x4E0F), ok ), QChar() );
+ QVERIFY( !ok );
+
+
+}
+
+void UT_LogsPredictiveLatin12KeyTranslator::testEncodes()
+{
+ QVERIFY( mTranslator->encodes( QString( "Zulu" ) ) );
+ QVERIFY( mTranslator->encodes( QString( "Öistämö" ) ) );
+
+ //china
+ QString uni1;
+ uni1.append(QChar(0x4E0E));
+ uni1.append(QChar(0x4E0F));
+ QVERIFY( !mTranslator->encodes( uni1) );
+
+ const int ucsize = 9;
+ const QChar thaiName2[] = {0x0E01,0x0E06,0x0E2F,0x0E0E,0x0E14,0x0E19,0x0E30,0x0E23,0x0E2A };
+ QVERIFY( !mTranslator->encodes( QString( thaiName2,ucsize ) ) );
}
-
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivethai12keytranslator.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivethai12keytranslator.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -25,13 +25,11 @@
void UT_LogsPredictiveThai12KeyTranslator::initTestCase()
{
- mOrigLang = HbInputSettingProxy::instance()->globalInputLanguage();
}
void UT_LogsPredictiveThai12KeyTranslator::cleanupTestCase()
{
- HbInputSettingProxy::instance()->setGlobalInputLanguage( mOrigLang );
}
@@ -40,15 +38,12 @@
{
HbInputLanguage thai( QLocale::Thai );
-
- HbInputSettingProxy::instance()->setGlobalInputLanguage( thai );
- mTranslator = new LogsPredictiveThai12KeyTranslator();
+ mTranslator = new LogsPredictiveThai12KeyTranslator( thai );
}
void UT_LogsPredictiveThai12KeyTranslator::cleanup()
{
- HbInputSettingProxy::instance()->setGlobalInputLanguage( mOrigLang );
delete mTranslator;
mTranslator = 0;
}
@@ -59,44 +54,83 @@
}
-void UT_LogsPredictiveThai12KeyTranslator::testTranslate()
+void UT_LogsPredictiveThai12KeyTranslator::testTranslateText()
{
- QCOMPARE( mTranslator->translate( QString( "0123456789" ) ), QString( "0123456789" ) );
- QCOMPARE( mTranslator->translate( QString( "Nokia" ) ), QString( "" ) );
- QCOMPARE( mTranslator->translate( QString( "*0123##456*789*" ) ), QString( "0123456789" ) );
+ QEXPECT_FAIL("", "No proper Thai keymap yet", Abort );
+ QCOMPARE( mTranslator->translateText( QString( "0123456789" ) ), QString( "0123456789" ) );
+ //finds name latin name translator
+ QCOMPARE( mTranslator->translateText( QString( "Nokia" ) ), QString( "66542" ) );
const int ucsize = 9;
// 1 2 3 4 5 6 7 8 9
const QChar thaiName1[] = {0x0E01,0x0E06,0x0E0A,0x0E0E,0x0E14,0x0E19,0x0E1E,0x0E23,0x0E2A };
- QCOMPARE( mTranslator->translate( QString( thaiName1,ucsize ) ), QString( "123456789" ) );
+ QCOMPARE( mTranslator->translateText( QString( thaiName1,ucsize ) ), QString( "123456789" ) );
// 1 2 * 4 5 6 # 8 9
const QChar thaiName2[] = {0x0E01,0x0E06,0x0E2F,0x0E0E,0x0E14,0x0E19,0x0E30,0x0E23,0x0E2A };
- QCOMPARE( mTranslator->translate( QString( thaiName2,ucsize ) ), QString( "1245689" ) );
+ QCOMPARE( mTranslator->translateText( QString( thaiName2,ucsize ) ), QString( "1245689" ) );
}
+void UT_LogsPredictiveThai12KeyTranslator::testTranslatePattern()
+{
+ QCOMPARE( mTranslator->translatePattern( QString( "0123456789" ) ), QString( "0123456789" ) );
+ QCOMPARE( mTranslator->translatePattern( QString( "*0123##456*789*" ) ), QString( "0123456789" ) );
+
+}
+
void UT_LogsPredictiveThai12KeyTranslator::testTranslateChar()
{
-
- QCOMPARE( mTranslator->translateChar( QChar('0') ), QChar('0') );
- QCOMPARE( mTranslator->translateChar( QChar('1') ), QChar('1') );
- QCOMPARE( mTranslator->translateChar( QChar('N') ), QChar() );
- QCOMPARE( mTranslator->translateChar( QChar('*') ), QChar() );
- QCOMPARE( mTranslator->translateChar( QChar('#') ), QChar() );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E01) ), QChar('1') );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E06) ), QChar('2') );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E0A) ), QChar('3') );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E0E) ), QChar('4') );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E14) ), QChar('5') );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E19) ), QChar('6') );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E1E) ), QChar('7') );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E23) ), QChar('8') );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E2A) ), QChar('9') );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E2F) ), QChar() );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E30) ), QChar() );
+ QEXPECT_FAIL("", "No proper Thai keymap yet", Abort );
+ bool ok;
+
+ QCOMPARE( mTranslator->translateChar( QChar('0'), ok ), QChar('0') );
+ QVERIFY( ok );
+ QCOMPARE( mTranslator->translateChar( QChar('1'), ok ), QChar('1') );
+ QVERIFY( ok );
+ QCOMPARE( mTranslator->translateChar( QChar('N'), ok ), QChar() );
+ QVERIFY( !ok );
+ QCOMPARE( mTranslator->translateChar( QChar('*'), ok ), QChar() );
+ QVERIFY( ok );
+ QCOMPARE( mTranslator->translateChar( QChar('#'), ok ), QChar() );
+ QVERIFY( ok );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E01), ok ), QChar('1') );
+ QVERIFY( ok );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E06), ok ), QChar('2') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E0A), ok ), QChar('3') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E0E), ok ), QChar('4') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E14), ok ), QChar('5') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E19), ok ), QChar('6') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E1E), ok ), QChar('7') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E23), ok ), QChar('8') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E2A), ok ), QChar('9') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E2F), ok ), QChar() );
+ QVERIFY( ok );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E30), ok ), QChar() );
+ QVERIFY( ok );
}
+void UT_LogsPredictiveThai12KeyTranslator::testEncodes()
+{
+ //china
+ QString uni1;
+ uni1.append(QChar(0x4E0E));
+ uni1.append(QChar(0x4E0F));
+ QVERIFY( !mTranslator->encodes( uni1) );
+
+ QVERIFY( !mTranslator->encodes( QString( "Zulu" ) ) );
+
+ QEXPECT_FAIL("", "No proper Thai keymap yet", Abort );
+ //thai
+ const int ucsize = 9;
+ const QChar thaiName2[] = {0x0E01,0x0E06,0x0E2F,0x0E0E,0x0E14,0x0E19,0x0E30,0x0E23,0x0E2A };
+
+ QVERIFY( mTranslator->encodes( QString( thaiName2,ucsize ) ) );
+
+
+}
+
+
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivetranslator.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivetranslator.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -19,6 +19,8 @@
#include "ut_logspredictivetranslator.h"
#include "logspredictivetranslator.h"
+#include "logspredictivelatin12keytranslator.h"
+#include "logspredictivethai12keytranslator.h"
#include <QtTest/QtTest>
@@ -52,7 +54,10 @@
{
QVERIFY( mTranslator );
QVERIFY( mTranslator->mKeyMap );
+ QVERIFY( mTranslator->mNameTranslator == 0 );
+ QVERIFY( LogsPredictiveTranslator::mInstance != 0 );
LogsPredictiveTranslator::deleteInstance();
+ QVERIFY( LogsPredictiveTranslator::mInstance == 0 );
mTranslator = 0;
HbInputLanguage thai( QLocale::Thai );
@@ -61,31 +66,99 @@
mTranslator = LogsPredictiveTranslator::instance();
QVERIFY( mTranslator );
QVERIFY( mTranslator->mKeyMap );
+ QVERIFY( mTranslator->mNameTranslator == 0 );
+ QVERIFY( LogsPredictiveTranslator::mInstance != 0 );
+
+ LogsPredictiveTranslator::deleteInstance();
+ QVERIFY( LogsPredictiveTranslator::mInstance == 0 );
+ mTranslator = 0;
}
-
void UT_LogsPredictiveTranslator::testTranslate()
{
QString test1( "12345" );
+ bool ok;
QCOMPARE( mTranslator->LogsPredictiveTranslator::translate( test1 ).length(),
test1.length() );
- QCOMPARE( mTranslator->LogsPredictiveTranslator::translate( test1, 2 ).length(),
+ QCOMPARE( mTranslator->LogsPredictiveTranslator::translate( test1, &ok, 2 ).length(),
2 );
+ QVERIFY( ok );
+
+ QString test2( "Hannu%");
+ QCOMPARE( mTranslator->LogsPredictiveTranslator::translate( test2, &ok ).length(),test2.length() -1 );
+ QVERIFY( !ok );
+
+}
+
+void UT_LogsPredictiveTranslator::testTranslatePattern()
+{
+ QString test1( "12345" );
+
+ QCOMPARE( mTranslator->LogsPredictiveTranslator::translatePattern( test1 ).length(),
+ test1.length() );
+
}
-void UT_LogsPredictiveTranslator::testStartsWith()
+
+void UT_LogsPredictiveTranslator::testTranslateText()
+{
+ QString test1( "12345" );
+
+ QCOMPARE( mTranslator->translateText( test1 ).length(), test1.length() );
+
+ QString test2( "Hannu%");
+ QCOMPARE( mTranslator->translateText( test2 ).length(), test2.length() - 1 );
+
+ QEXPECT_FAIL("", "No proper Thai keymap yet", Abort );
+ //text is thai, input lang latin
+ const int ucsize = 9;
+ // 1 2 3 4 5 6 7 8 9
+ const QChar thaiName1[] = {0x0E01,0x0E06,0x0E0A,0x0E0E,0x0E14,0x0E19,0x0E1E,0x0E23,0x0E2A };
+ QCOMPARE( mTranslator->translateText( QString( thaiName1,ucsize ) ), QString( "123456789" ) );
+
+
+}
+
+void UT_LogsPredictiveTranslator::testNameTranslator()
{
- QCOMPARE( mTranslator->startsWith( QString("" ), QString("") ), 0 );
- QCOMPARE( mTranslator->startsWith( QString("123" ), QString("") ), 0 );
- QCOMPARE( mTranslator->startsWith( QString("" ), QString("123") ), 0 );
- QCOMPARE( mTranslator->startsWith( QString("123" ), QString("1234") ), 0 );
- QCOMPARE( mTranslator->startsWith( QString("123" ), QString("1") ), 1 );
- QCOMPARE( mTranslator->startsWith( QString("123" ), QString("123") ), 3 );
- QCOMPARE( mTranslator->startsWith( QString("123" ), QString("12"), true ), 2 );
- QCOMPARE( mTranslator->startsWith( QString("123" ), QString("12"), false ), 2 );
+ QString test1( "12345" );
+ QCOMPARE( mTranslator->mib(), MIBenumLatin );
+ QVERIFY( !mTranslator->mNameTranslator );
+ QCOMPARE( mTranslator->nameTranslator( test1 ).mib(), MIBenumLatin );
+ QVERIFY( mTranslator->mNameTranslator );
+
+ //china
+ QString uni;
+ uni.append(QChar(0x0219));
+ uni.append(QChar(0x4E0F));
+ QCOMPARE( mTranslator->nameTranslator( uni ).mib(), MIBenumLatin );
+ QVERIFY( !mTranslator->mNameTranslator );
+ QCOMPARE( mTranslator->mib(), MIBenumLatin );
+
+ //unmapped
+ QString test2( "Hannu%");
+ QCOMPARE( mTranslator->nameTranslator( test2 ).mib(), MIBenumLatin );
+ QVERIFY( !mTranslator->mNameTranslator );
+ QCOMPARE( mTranslator->mib(), MIBenumLatin );
+
+ QEXPECT_FAIL("", "No proper Thai keymap yet", Abort );
+
+ //text is thai, input lang latin
+ const int ucsize = 9;
+ // 1 2 3 4 5 6 7 8 9
+ const QChar thaiName1[] = {0x0E01,0x0E06,0x0E0A,0x0E0E,0x0E14,0x0E19,0x0E1E,0x0E23,0x0E2A };
+ QCOMPARE( mTranslator->nameTranslator( QString( thaiName1,ucsize ) ).mib(), MIBenumThai );
+ QVERIFY( mTranslator->mNameTranslator );
+ QCOMPARE( mTranslator->mNameTranslator->mib(), MIBenumThai );
+ QCOMPARE( mTranslator->mib(), MIBenumLatin );
+
+ QCOMPARE( mTranslator->nameTranslator( QString( thaiName1,ucsize ) ).mib(), MIBenumThai );
+ QVERIFY( mTranslator->mNameTranslator );
+ QCOMPARE( mTranslator->mNameTranslator->mib(), MIBenumThai );
+ QCOMPARE( mTranslator->mib(), MIBenumLatin );
}
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/ut_logscntfinder.pro Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/ut_logscntfinder.pro Thu Jul 22 16:33:49 2010 +0100
@@ -66,7 +66,7 @@
symbian: {
TARGET.UID2 = 0x100039CE
- TARGET.UID3 = 0xEfa329b2
+ TARGET.UID3 = 0xEfa329b3
TARGET.CAPABILITY = ALL -TCB
TARGET.EPOCALLOWDLLDATA = 1
LIBS += -lflogger -lqtcontacts
--- a/logsui/logsengine/bwins/logsengineu.def Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/bwins/logsengineu.def Thu Jul 22 16:33:49 2010 +0100
@@ -61,4 +61,8 @@
?clearList@LogsModel@@QAE_NW4ClearType@1@@Z @ 60 NONAME ; bool LogsModel::clearList(enum LogsModel::ClearType)
??1LogsContact@@UAE@XZ @ 61 NONAME ; LogsContact::~LogsContact(void)
?clearType@LogsFilter@@QBE?AW4ClearType@LogsModel@@XZ @ 62 NONAME ; enum LogsModel::ClearType LogsFilter::clearType(void) const
+ ?logsDetailsModel@LogsModel@@QAEPAVLogsDetailsModel@@AAVLogsEvent@@@Z @ 63 NONAME ; class LogsDetailsModel * LogsModel::logsDetailsModel(class LogsEvent &)
+ ?getLogsEvent@LogsDetailsModel@@QBE?AVLogsEvent@@XZ @ 64 NONAME ; class LogsEvent LogsDetailsModel::getLogsEvent(void) const
+ ?serialize@LogsEvent@@QAE_NAAVQDataStream@@@Z @ 65 NONAME ; bool LogsEvent::serialize(class QDataStream &)
+ ??0LogsEvent@@QAE@AAVQDataStream@@@Z @ 66 NONAME ; LogsEvent::LogsEvent(class QDataStream &)
--- a/logsui/logsengine/eabi/logsengineu.def Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/eabi/logsengineu.def Thu Jul 22 16:33:49 2010 +0100
@@ -86,4 +86,9 @@
_ZNK9LogsEvent8durationEv @ 85 NONAME
_ZNK9LogsEvent9directionEv @ 86 NONAME
_ZNK9LogsEvent9eventTypeEv @ 87 NONAME
+ _ZN9LogsEvent9serializeER11QDataStream @ 88 NONAME
+ _ZN9LogsEventC1ER11QDataStream @ 89 NONAME
+ _ZN9LogsEventC2ER11QDataStream @ 90 NONAME
+ _ZN9LogsModel16logsDetailsModelER9LogsEvent @ 91 NONAME
+ _ZNK16LogsDetailsModel12getLogsEventEv @ 92 NONAME
--- a/logsui/logsengine/inc/logsdetailsmodel.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/inc/logsdetailsmodel.h Thu Jul 22 16:33:49 2010 +0100
@@ -45,6 +45,7 @@
LOGSENGINE_EXPORT void clearEvent();
LOGSENGINE_EXPORT void getNumberToClipboard();
+ LOGSENGINE_EXPORT LogsEvent getLogsEvent() const;
public: // From QAbstractItemModel
--- a/logsui/logsengine/inc/logsengdefs.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/inc/logsengdefs.h Thu Jul 22 16:33:49 2010 +0100
@@ -31,7 +31,7 @@
const char logsVoipCallIconId[] = "qtg_large_voip";
const char logsRemotePartyInfoIconId[] = "qtg_large_info";
-const char logsCallDurationIconId[] = "qtg_large_callduration";
+const char logsCallDurationIconId[] = "qtg_large_call_duration";
const char logsCallDateAndTimeIconId[] = "qtg_large_calendar";
const char logsThumbUnknownId[] = "qtg_large_avatar";
@@ -56,18 +56,13 @@
const int logsEventALS = 0x4;
const int logsDeleteCountInit = -1;
-const int logsReadSizeCompressEnabled = 20;
+const int logsReadSizeCompressEnabled = 10;
const int logsReadSizeUndefined = -1;
// MACROS
#define DESC_TO_QSTRING( desc )\
QString::fromUtf16( desc.Ptr(), desc.Length() );
-#define LOGSENG_PANIC() User::Invariant()
-
-#define LOGSENG_ASSERT( cond )\
-if ( !(cond) ) LOGSENG_PANIC;
-
// DATA TYPES
class LogsEventStrings
--- a/logsui/logsengine/inc/logseventdata.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/inc/logseventdata.h Thu Jul 22 16:33:49 2010 +0100
@@ -23,6 +23,7 @@
// FORWARD DECLARATION
class CLogEvent;
+class QDataStream;
// CLASS DECLARATION
@@ -43,6 +44,11 @@
* Copy constructor.
*/
LogsEventData( const LogsEventData& data );
+
+ /**
+ * Construct from data stream
+ */
+ LogsEventData( QDataStream& serializedEvent );
/**
* Destructor.
@@ -79,6 +85,8 @@
unsigned int contactLocalId() const;
+ bool serialize( QDataStream& serializeDestination );
+
private:
void setContactLocalId( unsigned int id );
--- a/logsui/logsengine/inc/logsmatchesmodel.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/inc/logsmatchesmodel.h Thu Jul 22 16:33:49 2010 +0100
@@ -26,6 +26,7 @@
class LogsDbConnector;
class LogsCntFinder;
class LogsCntEntry;
+class LogsCntText;
class LogsContact;
class LogsMatchesModelItemContainer;
class LogsThumbIconManager;
@@ -74,6 +75,7 @@
void eventsUpdated(const QModelIndex& first, const QModelIndex& last);
void eventsAdded(const QModelIndex& parent, int first, int last);
void eventsRemoved(const QModelIndex& parent, int first, int last);
+ void eventsResetted();
void doSearchQuery();
void doModelReset();
@@ -89,6 +91,7 @@
void getLogsMatches( const QString& pattern, bool async = false, bool force = false );
void updateSearchEntry(LogsCntEntry& entry, LogsEvent& event);
QString stripPhoneNumber(const QString& phoneNumber) const;
+ void addEventForSearching(int index, LogsEvent& event);
private: //data
@@ -125,6 +128,7 @@
unsigned int contact() const;
QString number() const;
QString contactName() const;
+ QString contactNameSimple() const;
bool isNull() const;
bool isEventMatch() const;
QStringList texts();
@@ -136,13 +140,18 @@
QString getFormattedCallerId(const LogsCntEntry& entry) const;
void getFormattedContactInfo(
- const LogsCntEntry& entry, QString& contactName, QString& contactNumber ) const;
+ const LogsCntEntry& entry, QString& contactName,
+ QString& contactNameSimple, QString& contactNumber ) const;
+ void getFormattedName(QString& formattedName, const QList<LogsCntText>& list) const;
+ void getFormattedName(QString& formattedName, QString& formattedNameSimple,
+ const QList<LogsCntText>& list) const;
private:
LogsAbstractModel& mParentModel;
unsigned int mContactId;
QString mContactName;
+ QString mContactNameSimple;
QString mContactNumber;
QString mAvatarPath;
QString mFormattedCallerId;
--- a/logsui/logsengine/inc/logsmessage.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/inc/logsmessage.h Thu Jul 22 16:33:49 2010 +0100
@@ -69,6 +69,7 @@
XQServiceRequest* mService;
private:
friend class UT_LogsMessage;
+ friend class UT_LogsMatchesModel;
};
--- a/logsui/logsengine/logsengine.pro Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/logsengine.pro Thu Jul 22 16:33:49 2010 +0100
@@ -19,7 +19,6 @@
TARGET = logsengine
CONFIG += hb dll svg
-RESOURCES += logsengine.qrc
INCLUDEPATH += ./
INCLUDEPATH += ./inc
--- a/logsui/logsengine/logsengine.qrc Fri Jun 11 16:24:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
- <qresource prefix="/" >
- <file>themes/icons/hbdefault/scalable/qtg_large_missed_voice_call_unseen.svg</file>
- <file>themes/icons/hbdefault/scalable/qtg_large_missed_video_call_unseen.svg</file>
- <file>themes/icons/hbdefault/scalable/qtg_large_missed_voip_call_unseen.svg</file>
- </qresource>
-</RCC>
--- a/logsui/logsengine/logssymbianos/inc/logsdbconnector.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/logssymbianos/inc/logsdbconnector.h Thu Jul 22 16:33:49 2010 +0100
@@ -88,6 +88,13 @@
void dataRemoved(QList<int> removedIndexes);
/**
+ * Signaled once significant changes in data has occured.
+ * Corresponding changes have been already done to event array
+ * when this signal is emitted.
+ */
+ void dataReset();
+
+ /**
* Signaled once asycn event clearing has completed.
* @param err, 0 if marking completed succesfully
*/
--- a/logsui/logsengine/logssymbianos/inc/logseventparser.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/logssymbianos/inc/logseventparser.h Thu Jul 22 16:33:49 2010 +0100
@@ -54,7 +54,7 @@
/**
* Resolve event type based on available information.
*/
- static void resolveEventType(LogsEvent& dest);
+ static bool resolveEventType(LogsEvent& dest);
static void eventTypeSpecificParsing(LogsEvent& dest);
--- a/logsui/logsengine/logssymbianos/inc/logsforegroundwatcher.h Fri Jun 11 16:24:14 2010 +0100
+++ /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 <QObject>
-#include <coemain.h>
-
-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
--- a/logsui/logsengine/logssymbianos/src/logsdbconnector.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/logssymbianos/src/logsdbconnector.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -475,7 +475,7 @@
mAddedEventIndexes.append( mEvents.at(i)->index() );
}
}
-
+
bool doModelDataReset( !mRemovedEventIndexes.isEmpty() ||
!mAddedEventIndexes.isEmpty() ||
!mUpdatedEventIndexes.isEmpty() );
@@ -487,21 +487,28 @@
}
}
- if ( !mRemovedEventIndexes.isEmpty() ){
- emit dataRemoved(mRemovedEventIndexes);
- }
- if ( !mAddedEventIndexes.isEmpty() ){
- emit dataAdded(mAddedEventIndexes);
- }
- if ( !mUpdatedEventIndexes.isEmpty() ){
- emit dataUpdated(mUpdatedEventIndexes);
+ int changeCount = 0;
+ changeCount += mRemovedEventIndexes.isEmpty() ? 0 : 1;
+ changeCount += mAddedEventIndexes.isEmpty() ? 0 : 1;
+ changeCount += mUpdatedEventIndexes.isEmpty() ? 0 : 1;
+
+ if ( changeCount > 1 ){
+ // If having many changes, it is less error prone
+ // to just report reset.
+ emit dataReset();
+ } else {
+ if ( !mRemovedEventIndexes.isEmpty() ){
+ emit dataRemoved(mRemovedEventIndexes);
+ }
+ if ( !mAddedEventIndexes.isEmpty() ){
+ emit dataAdded(mAddedEventIndexes);
+ }
+ if ( !mUpdatedEventIndexes.isEmpty() ){
+ emit dataUpdated(mUpdatedEventIndexes);
+ }
}
deleteRemoved(readCount);
-
- if ( mCompressionEnabled ){
- mReader->stop();
- }
LOGS_QDEBUG( "logs [ENG] <- LogsDbConnector::readCompleted()" )
}
--- a/logsui/logsengine/logssymbianos/src/logseventparser.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/logssymbianos/src/logseventparser.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -103,6 +103,18 @@
dest.setDuration(source.Duration());
}
+ LogsEventData* logsEventData = new LogsEventData();
+ if ( logsEventData->parse(source) != 0 ){
+ // Parsing failed, clear event data
+ delete logsEventData;
+ dest.setLogsEventData( 0 );
+ } else {
+ dest.setLogsEventData( logsEventData ); //Ownership transferred
+ }
+
+ // Resolve event type based on current event data
+ dataChanged |= resolveEventType(dest);
+
int currLogId = dest.logId();
int newLogId = source.Id();
bool logIdChanged( currLogId != newLogId );
@@ -114,19 +126,7 @@
dest.mEventState = LogsEvent::EventNotUpdated;
}
dest.setLogId( newLogId ); // Store unique identifier
-
- LogsEventData* logsEventData = new LogsEventData();
- if ( logsEventData->parse(source) != 0 ){
- // Parsing failed, clear event data
- delete logsEventData;
- dest.setLogsEventData( 0 );
- } else {
- dest.setLogsEventData( logsEventData ); //Ownership transferred
- }
-
- // Resolve event type based on current event data
- resolveEventType(dest);
-
+
eventTypeSpecificParsing(dest);
dest.setDuplicates( 0 );
@@ -140,7 +140,7 @@
// LogsEventParser::resolveEventType
// ----------------------------------------------------------------------------
//
-void LogsEventParser::resolveEventType(LogsEvent& dest)
+bool LogsEventParser::resolveEventType(LogsEvent& dest)
{
LogsEvent::LogsEventType type( LogsEvent::TypeVoiceCall );
if ( dest.mLogsEventData ){
@@ -157,7 +157,7 @@
}
}
LOGS_QDEBUG_2( "LogsEventParser::resolveEventType, type:", type )
- dest.setEventType( type );
+ return dest.setEventType( type );
}
// ----------------------------------------------------------------------------
--- a/logsui/logsengine/logssymbianos/src/logsforegroundwatcher.cpp Fri Jun 11 16:24:14 2010 +0100
+++ /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" );
-}
-
--- a/logsui/logsengine/logssymbianos/tsrc/stubs/centralrepository_stub.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/logssymbianos/tsrc/stubs/centralrepository_stub.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -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 )
{
--- a/logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -97,25 +97,18 @@
}
-QList<QContactLocalId> QContactManager::contacts(
- const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders) const
-{
- Q_UNUSED(filter)
- Q_UNUSED(sortOrders)
- QList<QContactLocalId> list;
- if ( QString("11112222").endsWith(logsTestNumber) ){
- list.append( logsTestContactId );
- }
- return list;
-}
-
QList<QContactLocalId> QContactManager::contactIds(
const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders) const
{
Q_UNUSED(filter)
Q_UNUSED(sortOrders)
QList<QContactLocalId> list;
- if ( QString("11112222").endsWith(logsTestNumber) ){
+ QString matchNum = logsTestNumber;
+ // simulate contact API behavior
+ if ( matchNum.length() > 4 && matchNum.startsWith('+') ){
+ matchNum.remove(0,4);
+ }
+ if ( QString("11112222").endsWith(matchNum) ){
list.append( logsTestContactId );
}
return list;
@@ -131,6 +124,16 @@
return contact;
}
+QContact QContactManager::contact(const QContactLocalId& contactId, const QContactFetchHint& fetchHint) const
+{
+ Q_UNUSED(fetchHint)
+ QContact contact;
+ if ( contactId == logsTestContactId ) {
+ logsTestContactLocalId = logsTestContactId;
+ }
+ return contact;
+}
+
// ----------------------------------------------------------------------------
// QContactDetailFilter
@@ -184,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;
}
@@ -253,15 +250,14 @@
QString QContactDetail::value(const QString& key) const
{
- if ( key == QContactName::FieldFirst ){
+ if ( key == QContactName::FieldFirstName ){
return logsFirstName;
- } else if ( key == QContactName::FieldLast ) {
+ } else if ( key == QContactName::FieldLastName ) {
return logsLastName;
} else if ( key == QContactPhoneNumber::FieldNumber ) {
return QString( "12345" );
}
- else if ( key == QContactAvatar::FieldAvatar){
- return QString( "Avatar" );
- }
return QString("");
}
+
+
--- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/inc/ut_logsforegroundwatcher.h Fri Jun 11 16:24:14 2010 +0100
+++ /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 <QObject>
-
-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
--- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/main.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/main.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -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");
--- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/ut_logsdbconnector.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/ut_logsdbconnector.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -208,12 +208,14 @@
QSignalSpy spyAdded(mDbConnector, SIGNAL(dataAdded(QList<int>)));
QSignalSpy spyRemoved(mDbConnector, SIGNAL(dataRemoved(QList<int>)));
QSignalSpy spyUpdated(mDbConnector, SIGNAL(dataUpdated(QList<int>)));
+ QSignalSpy spyReset(mDbConnector, SIGNAL(dataReset()));
// No events, no signal
mDbConnector->readCompleted(0);
QVERIFY( spyAdded.count() == 0 );
QVERIFY( spyRemoved.count() == 0 );
QVERIFY( spyUpdated.count() == 0 );
+ QVERIFY( spyReset.count() == 0 );
// Events exists, their indexes are signaled
LOGS_TEST_CREATE_EVENT(event, 0, LogsEvent::EventAdded );
@@ -224,6 +226,7 @@
QVERIFY( addedIndexes.at(0) == 0 );
QVERIFY( spyRemoved.count() == 0 );
QVERIFY( spyUpdated.count() == 0 );
+ QVERIFY( spyReset.count() == 0 );
QVERIFY( mDbConnector->mEvents.count() == 1 );
QVERIFY( mEvents.count() == 1 );
@@ -240,6 +243,7 @@
QVERIFY( addedIndexes2.at(1) == 1 );
QVERIFY( spyRemoved.count() == 0 );
QVERIFY( spyUpdated.count() == 0 );
+ QVERIFY( spyReset.count() == 0 );
QVERIFY( mDbConnector->mEvents.count() == 3 );
QVERIFY( mEvents.count() == 3 );
@@ -251,6 +255,7 @@
QVERIFY( spyAdded.count() == 2 );
QVERIFY( spyRemoved.count() == 0 );
QVERIFY( spyUpdated.count() == 1 );
+ QVERIFY( spyReset.count() == 0 );
QList<int> updatedIndexes = qvariant_cast< QList<int> >(spyUpdated.at(0).at(0));
QVERIFY( updatedIndexes.count() == 1 );
QVERIFY( updatedIndexes.at(0) == 1 );
@@ -264,19 +269,31 @@
QVERIFY( spyAdded.count() == 2 );
QVERIFY( spyRemoved.count() == 1 );
QVERIFY( spyUpdated.count() == 1 );
+ QVERIFY( spyReset.count() == 0 );
QList<int> removedIndexes = qvariant_cast< QList<int> >(spyRemoved.at(0).at(0));
QVERIFY( removedIndexes.count() == 1 );
QVERIFY( removedIndexes.at(0) == 2 ); // index 2
QVERIFY( mDbConnector->mEvents.count() == 2 );
QVERIFY( mEvents.count() == 2 );
- // Read completed when compression is enabled, reader is stopped
+ // Event added and removed, reset should be signaled
+ mDbConnector->mEvents.at(0)->mEventState = LogsEvent::EventAdded;
+ mDbConnector->mEvents.at(1)->mIsInView = false;
+ mDbConnector->readCompleted(1);
+ QVERIFY( spyAdded.count() == 2 );
+ QVERIFY( spyRemoved.count() == 1 );
+ QVERIFY( spyUpdated.count() == 1 );
+ QVERIFY( spyReset.count() == 1 );
+ QVERIFY( mDbConnector->mEvents.count() == 1 );
+ QVERIFY( mEvents.count() == 1 );
+
+ // Read completed when compression is enabled, reader is not stopped
QVERIFY( mDbConnector->init() == 0 );
QVERIFY( mDbConnector->start() == 0 );
QVERIFY( mDbConnector->mReader->mLogViewRecent != 0 );
mDbConnector->mCompressionEnabled = true;
mDbConnector->readCompleted(0);
- QVERIFY( mDbConnector->mReader->mLogViewRecent == 0 );
+ QVERIFY( mDbConnector->mReader->mLogViewRecent != 0 );
}
void UT_LogsDbConnector::testErrorOccurred()
--- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/ut_logseventparser.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/ut_logseventparser.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -166,26 +166,26 @@
LogsEventParser::resolveEventType(*mEvent);
QVERIFY( mEvent->eventType() == LogsEvent::TypeVoiceCall );
- // Event data
+ // Event data, type not changed
LogsEventData* eventData = new LogsEventData();
mEvent->setLogsEventData(eventData);
- LogsEventParser::resolveEventType(*mEvent);
+ QVERIFY( !LogsEventParser::resolveEventType(*mEvent) );
QVERIFY( mEvent->eventType() == LogsEvent::TypeVoiceCall );
-
+
eventData->mIsVoIP = true;
- LogsEventParser::resolveEventType(*mEvent);
+ QVERIFY( LogsEventParser::resolveEventType(*mEvent) );
QVERIFY( mEvent->eventType() == LogsEvent::TypeVoIPCall );
eventData->mIsVoIP = false;
eventData->mIsVT = true;
- LogsEventParser::resolveEventType(*mEvent);
+ QVERIFY( LogsEventParser::resolveEventType(*mEvent) );
QVERIFY( mEvent->eventType() == LogsEvent::TypeVideoCall );
// PoC not supported
eventData->mIsVoIP = false;
eventData->mIsVT = false;
eventData->mIsPoC = true;
- LogsEventParser::resolveEventType(*mEvent);
+ QVERIFY( LogsEventParser::resolveEventType(*mEvent) );
QVERIFY( mEvent->eventType() == LogsEvent::TypeUndefined );
// Msgs not supported
@@ -193,6 +193,6 @@
eventData->mIsVT = false;
eventData->mIsPoC = false;
eventData->mMsgPartsNumber = 2;
- LogsEventParser::resolveEventType(*mEvent);
+ QVERIFY( !LogsEventParser::resolveEventType(*mEvent) );
QVERIFY( mEvent->eventType() == LogsEvent::TypeUndefined );
}
--- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/ut_logsforegroundwatcher.cpp Fri Jun 11 16:24:14 2010 +0100
+++ /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 <QtTest/QtTest>
-#include <coemain.h>
-
-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 );
-}
-
--- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/ut_logssymbianos.pro Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/ut_logssymbianos.pro Thu Jul 22 16:33:49 2010 +0100
@@ -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
--- a/logsui/logsengine/src/logscall.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/src/logscall.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -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
--- a/logsui/logsengine/src/logscontact.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/src/logscontact.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -200,7 +200,10 @@
SLOT(handleRequestCompleted(QVariant)));
mService->setArguments(arguments);
-
+ XQRequestInfo info;
+ info.setForeground(true);
+ mService->setInfo(info);
+
QVariant retValue;
return mService->send(retValue);
}
--- a/logsui/logsengine/src/logsdetailsmodel.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/src/logsdetailsmodel.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -292,6 +292,15 @@
//
// -----------------------------------------------------------------------------
//
+LogsEvent LogsDetailsModel::getLogsEvent() const
+{
+ return *mEvent;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
bool LogsDetailsModel::isAddress(QString value) const
{
QChar c('@');
--- a/logsui/logsengine/src/logsevent.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/src/logsevent.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -24,6 +24,7 @@
#include <qcontactname.h>
#include <qcontactonlineaccount.h>
#include <hbglobal.h>
+#include <QDataStream>
#include "logsevent.h"
#include "logseventparser.h"
#include "logseventdata.h"
@@ -257,9 +258,11 @@
// LogsEvent::setEventType
// ----------------------------------------------------------------------------
//
-void LogsEvent::setEventType( LogsEventType eventType )
+bool LogsEvent::setEventType( LogsEventType eventType )
{
+ bool changed( mEventType != eventType );
mEventType = eventType;
+ return changed;
}
// ----------------------------------------------------------------------------
@@ -345,6 +348,85 @@
}
// ----------------------------------------------------------------------------
+//
+// ----------------------------------------------------------------------------
+//
+LogsEvent::LogsEvent( QDataStream& serializedEvent )
+{
+ LOGS_QDEBUG( "logs [ENG] -> LogsEvent::LogsEvent deserialize")
+ serializedEvent >> mLogId;
+ int tempEnum;
+ serializedEvent >> tempEnum;
+ mDirection = static_cast<LogsEvent::LogsDirection>( tempEnum );
+ serializedEvent >> tempEnum;
+ mEventType = static_cast<LogsEvent::LogsEventType>( tempEnum );
+ serializedEvent >> mUid;
+
+ serializedEvent >> mRemoteParty;
+ serializedEvent >> mNumber;
+ serializedEvent >> mDuplicates;
+ serializedEvent >> mTime;
+ serializedEvent >> mRingDuration;
+ serializedEvent >> mIsRead;
+ serializedEvent >> mIsALS;
+ serializedEvent >> mDuration;
+
+ serializedEvent >> mIndex;
+ serializedEvent >> mIsInView;
+ serializedEvent >> tempEnum;
+ mEventState = static_cast<LogsEvent::LogsEventState>( tempEnum );
+ serializedEvent >> mIsLocallySeen;
+ serializedEvent >> mIsPrivate;
+ serializedEvent >> mIsUnknown;
+
+ LogsEventData* logsEventData = new LogsEventData(serializedEvent);
+ if ( serializedEvent.status() == QDataStream::ReadPastEnd ){
+ mLogsEventData = 0;
+ delete logsEventData;
+ } else {
+ mLogsEventData = logsEventData;
+ }
+ LOGS_QDEBUG( "logs [ENG] <- LogsEvent::LogsEvent deserialize")
+
+}
+
+// ----------------------------------------------------------------------------
+//
+// ----------------------------------------------------------------------------
+//
+bool LogsEvent::serialize( QDataStream& serializeDestination )
+{
+ LOGS_QDEBUG( "logs [ENG] -> LogsEvent::serialize")
+ serializeDestination << mLogId;
+ serializeDestination << mDirection;
+ serializeDestination << mEventType;
+ serializeDestination << mUid;
+
+ serializeDestination << mRemoteParty;
+ serializeDestination << mNumber;
+ serializeDestination << mDuplicates;
+ serializeDestination << mTime;
+ serializeDestination << mRingDuration;
+ serializeDestination << mIsRead;
+ serializeDestination << mIsALS;
+ serializeDestination << mDuration;
+
+ serializeDestination << mIndex;
+ serializeDestination << mIsInView;
+ serializeDestination << mEventState;
+ serializeDestination << mIsLocallySeen;
+ serializeDestination << mIsPrivate;
+ serializeDestination << mIsUnknown;
+
+ if ( mLogsEventData ){
+ mLogsEventData->serialize(serializeDestination);
+ }
+
+ LOGS_QDEBUG( "logs [ENG] <- LogsEvent::serialize")
+ return true;
+}
+
+// ----------------------------------------------------------------------------
// LogsEvent::RingDuration
//
// For ring duation feature
@@ -519,10 +601,9 @@
phoneFilter.setValue(mLogsEventData->remoteUrl());
phoneFilter.setMatchFlags(QContactFilter::MatchExactly);
} else if ( !mNumber.isEmpty() ){
- // remove non-significant parts from number for better matching
phoneFilter.setDetailDefinitionName( QContactPhoneNumber::DefinitionName,
QContactPhoneNumber::FieldNumber);
- phoneFilter.setValue(stripPhoneNumber(mNumber));
+ phoneFilter.setValue(mNumber);
phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith);
} else {
// Searching not possible
@@ -553,59 +634,19 @@
return contactNameStr;
}
-
-// ----------------------------------------------------------------------------
-// LogsEvent::stripPhoneNumber
-// ----------------------------------------------------------------------------
-//
-QString LogsEvent::stripPhoneNumber(const QString& num)
-{
- // Remove international part from beginning if starts with '+'
- // and leading digit can be removed if doesn't start with '+'
- // NOTE: since international part is not fixed length, this
- // approach is not bulletproof (i.e. if international part is
- // only one digit long, part of group identification code is ignored
- // which might lead to incorrect matching in case where user
- // would have two contacts with same subscriber number part but for
- // different operator (quite unlikely).
-
- if ( num.length() == 0 ){
- return num;
- }
- QString modifiedNum( num );
- if ( modifiedNum.at(0) == '+' ) {
- // QString handles automatically case of removing too much
- const int removePlusAndInternationalPart = 4;
- modifiedNum.remove( 0, removePlusAndInternationalPart );
- }
- else {
- const int removeFirstDigit = 1;
- modifiedNum.remove( 0, removeFirstDigit );
- }
-
- return modifiedNum;
-}
-
// ----------------------------------------------------------------------------
// LogsEvent::parseContactName
// ----------------------------------------------------------------------------
//
QString LogsEvent::parseContactName(const QContactName& name)
{
- QString firstName = name.value(QContactName::FieldFirst);
- QString lastName = name.value(QContactName::FieldLast);
- 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 firstName = name.value(QContactName::FieldFirstName);
+ QString lastName = name.value(QContactName::FieldLastName);
+ QString parsedName = firstName;
+ if (!parsedName.isEmpty() && !lastName.isEmpty()) {
+ parsedName.append(" ");
}
+ parsedName.append(lastName);
return parsedName;
}
--- a/logsui/logsengine/src/logseventdata.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/src/logseventdata.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -19,9 +19,11 @@
#include "logseventdata.h"
#include "logsevent.h"
#include "logseventdataparser.h"
+#include "logslogger.h"
#include <QRegExp>
#include <QRegExpValidator>
+#include <QDataStream>
// ----------------------------------------------------------------------------
// LogsEventData::LogsEventData
@@ -64,6 +66,56 @@
}
// ----------------------------------------------------------------------------
+//
+// ----------------------------------------------------------------------------
+//
+LogsEventData::LogsEventData( QDataStream& serializedEvent )
+{
+ LOGS_QDEBUG( "logs [ENG] -> LogsEventData::LogsEventData deserialize")
+
+ serializedEvent >> mIsCNAP;
+ serializedEvent >> mIsVT;
+ serializedEvent >> mIsPoC;
+ serializedEvent >> mIsVoIP;
+ serializedEvent >> mIsEmerg;
+ serializedEvent >> mDataSent;
+ serializedEvent >> mDataReceived;
+ serializedEvent >> mMsgPartsNumber;
+ serializedEvent >> mServiceId;
+ serializedEvent >> mContactLocalId;
+ serializedEvent >> mRemoteUrl;
+ serializedEvent >> mLocalUrl;
+
+ LOGS_QDEBUG( "logs [ENG] <- LogsEventData::LogsEventData deserialize")
+
+}
+
+// ----------------------------------------------------------------------------
+//
+// ----------------------------------------------------------------------------
+//
+bool LogsEventData::serialize( QDataStream& serializeDestination )
+{
+ LOGS_QDEBUG( "logs [ENG] -> LogsEventData::serialize")
+
+ serializeDestination << mIsCNAP;
+ serializeDestination << mIsVT;
+ serializeDestination << mIsPoC;
+ serializeDestination << mIsVoIP;
+ serializeDestination << mIsEmerg;
+ serializeDestination << mDataSent;
+ serializeDestination << mDataReceived;
+ serializeDestination << mMsgPartsNumber;
+ serializeDestination << mServiceId;
+ serializeDestination << mContactLocalId;
+ serializeDestination << mRemoteUrl;
+ serializeDestination << mLocalUrl;
+
+ LOGS_QDEBUG( "logs [ENG] <- LogsEventData::serialize")
+ return true;
+}
+
+// ----------------------------------------------------------------------------
// LogsEventData::~LogsEventData
// ----------------------------------------------------------------------------
//
--- a/logsui/logsengine/src/logsmatchesmodel.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/src/logsmatchesmodel.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -165,7 +165,8 @@
}
const LogsMatchesModelItemContainer& matchItem =
static_cast<const LogsMatchesModelItemContainer&>( item );
- LogsMessage* logsMessage = new LogsMessage(matchItem.contact(), matchItem.number(),matchItem.contactName());
+ LogsMessage* logsMessage = new LogsMessage(
+ matchItem.contact(), matchItem.number(),matchItem.contactNameSimple());
if (!logsMessage->isMessagingAllowed()) {
delete logsMessage;
logsMessage = 0;
@@ -298,6 +299,39 @@
}
// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsMatchesModel::eventsResetted()
+{
+ LOGS_QDEBUG( "logs [ENG] -> LogsMatchesModel::eventsResetted()" );
+
+ QMap<LogsCntEntryHandle*, LogsEvent*> unusedEvents = mSearchEvents;
+ for ( int i = 0; i < mParentModel.rowCount(); ++i ){
+ LogsEvent* event = qVariantValue<LogsEvent*>(
+ mParentModel.data( mParentModel.index(i, 0), LogsModel::RoleFullEvent ) );
+ if ( event ){
+ QObject* key = mSearchEvents.key(event);
+ if ( key ){
+ unusedEvents.remove(key);
+ } else {
+ addEventForSearching(i, *event);
+ }
+ }
+ }
+
+ QMap<LogsCntEntryHandle*, LogsEvent*>::iterator unusedIt;
+ for (unusedIt = unusedEvents.begin(); unusedIt != unusedEvents.end(); ++unusedIt){
+ mLogsCntFinder->deleteEntry(*unusedIt.key());
+ mSearchEvents.remove(unusedIt.key());
+ }
+
+ forceSearchQuery();
+
+ LOGS_QDEBUG( "logs [ENG] <- LogsMatchesModel::eventsResetted()" );
+}
+
+// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
@@ -315,7 +349,7 @@
this, SLOT(eventsAdded(const QModelIndex&,int,int)));
connect( &mParentModel, SIGNAL(rowsRemoved(const QModelIndex&,int,int)),
this, SLOT(eventsRemoved(const QModelIndex&,int,int)));
- connect( &mParentModel, SIGNAL(modelReset()), this, SLOT(doModelReset()));
+ connect( &mParentModel, SIGNAL(modelReset()), this, SLOT(eventsResetted()));
readEvents(0, mParentModel.rowCount());
mIconManager = new LogsThumbIconManager();
connect(mIconManager, SIGNAL(contactIconReady(int)),
@@ -373,11 +407,7 @@
LogsEvent* event = qVariantValue<LogsEvent*>(
mParentModel.data( mParentModel.index(i, 0), LogsModel::RoleFullEvent ) );
if ( event ){
- QObject* entryHandle = new QObject(this);
- LogsCntEntry* entry = new LogsCntEntry(*entryHandle, 0);
- updateSearchEntry(*entry, *event);
- mLogsCntFinder->insertEntry(i, entry);
- mSearchEvents.insert(entryHandle, event);
+ addEventForSearching(i, *event);
}
}
}
@@ -447,10 +477,12 @@
//
void LogsMatchesModel::doModelReset()
{
+ LOGS_QDEBUG( "logs [ENG] -> LogsMatchesModel::doModelReset()" );
qDeleteAll(mMatches);
mMatches.clear();
mResultCount = 0;
reset();
+ LOGS_QDEBUG( "logs [ENG] <- LogsMatchesModel::doModelReset()" );
}
// -----------------------------------------------------------------------------
@@ -512,6 +544,19 @@
//
// -----------------------------------------------------------------------------
//
+void LogsMatchesModel::addEventForSearching(int index, LogsEvent& event)
+{
+ QObject* entryHandle = new QObject(this);
+ LogsCntEntry* entry = new LogsCntEntry(*entryHandle, 0);
+ updateSearchEntry(*entry, event);
+ mLogsCntFinder->insertEntry(index, entry);
+ mSearchEvents.insert(entryHandle, &event);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
LogsMatchesModelItemContainer::LogsMatchesModelItemContainer(
LogsAbstractModel& parentModel,
LogsThumbIconManager& thumbIconManager,
@@ -594,6 +639,15 @@
//
// -----------------------------------------------------------------------------
//
+QString LogsMatchesModelItemContainer::contactNameSimple() const
+{
+ return mContactNameSimple;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
bool LogsMatchesModelItemContainer::isNull() const
{
return ( !mEvent && !mContactId );
@@ -651,7 +705,7 @@
if ( mEvent ){
mFormattedCallerId = getFormattedCallerId(entry);
} else if ( mContactId > 0 ){
- getFormattedContactInfo(entry, mContactName, mContactNumber);
+ getFormattedContactInfo(entry, mContactName, mContactNameSimple, mContactNumber);
mAvatarPath.clear();
mAvatarPath = entry.avatarPath();
}
@@ -675,12 +729,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();
@@ -695,24 +744,49 @@
//
void LogsMatchesModelItemContainer::getFormattedContactInfo(
const LogsCntEntry& entry,
- QString& contactName,
+ QString& contactName,
+ QString& contactNameSimple,
QString& contactNumber ) const
{
contactName.clear();
- foreach( LogsCntText name, entry.firstName() ) {
- contactName.append( name.richText() );
+
+ getFormattedName(contactName, contactNameSimple, entry.firstName());
+ getFormattedName(contactName, contactNameSimple, entry.lastName());
+
+ contactName = contactName.trimmed();
+ contactNameSimple = contactNameSimple.trimmed();
+ contactNumber = entry.phoneNumber().text();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsMatchesModelItemContainer::getFormattedName(
+ QString& formattedName, const QList<LogsCntText>& 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(" ");
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsMatchesModelItemContainer::getFormattedName(
+ QString& formattedName, QString& formattedNameSimple,
+ const QList<LogsCntText>& list) const
+{
+ foreach( LogsCntText name, list ) {
+ if ( name.text().length() > 0 ) {
+ formattedName.append(name.richText());
+ formattedName.append(" ");
+ formattedNameSimple.append(name.text());
+ formattedNameSimple.append(" ");
}
}
- contactName = contactName.trimmed();
-
- contactNumber = entry.phoneNumber().richText();
}
--- a/logsui/logsengine/src/logsmessage.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/src/logsmessage.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -146,6 +146,9 @@
arguments.append(QVariant(contactId));
arguments.append(QVariant(displayName));
request.setArguments(arguments);
+ XQRequestInfo info;
+ info.setForeground(true);
+ request.setInfo(info);
QVariant retValue;
bool ret = request.send(retValue);
LOGS_QDEBUG_2( "logs [ENG] <- LogsMessage::doSendMessageToNumber()", ret )
--- a/logsui/logsengine/src/logsmodel.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/src/logsmodel.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -59,6 +59,9 @@
this, SLOT( dataUpdated(QList<int>) ));
connect( mDbConnector, SIGNAL( dataRemoved(QList<int>) ),
this, SLOT( dataRemoved(QList<int>) ));
+ connect( mDbConnector, SIGNAL( dataReset() ),
+ this, SLOT( resetModel() ));
+
connect( hbInstance->theme(), SIGNAL ( changeFinished() ),
this, SLOT ( resetModel()));
mDbConnector->init();
@@ -183,6 +186,16 @@
}
// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+LogsDetailsModel* LogsModel::logsDetailsModel(LogsEvent& event)
+{
+ LOGS_QDEBUG( "logs [ENG] -> LogsModel::logsDetailsModel()" )
+ return new LogsDetailsModel( *mDbConnector, event );
+}
+
+// -----------------------------------------------------------------------------
// From QAbstractListModel
// -----------------------------------------------------------------------------
//
@@ -368,11 +381,13 @@
qreal totalwidth = 0;
int x = 0;
if (fontMetrics.width(fullString) > maxwidth){
- maxwidth = maxwidth - fontMetrics.width(tr("...")+secondarystring);
+ maxwidth = maxwidth - fontMetrics.width(tr("...")+secondarystring);
for (x = 0; (x < basestring.count()) && (totalwidth < maxwidth); x++){
totalwidth = totalwidth + fontMetrics.width(basestring[x]);
}
- if ( ( totalwidth > maxwidth ) && ( x>0 ) ) x--;
+ if ( x>1 ){
+ x -= 2;
+ }
return basestring.left(x) + tr("...") + secondarystring;
} else {
return fullString;
@@ -385,7 +400,9 @@
//
void LogsModel::resetModel()
{
- this->reset();
+ LOGS_QDEBUG( "logs [ENG] -> LogsModel::resetModel()" )
+ this->reset();
+ LOGS_QDEBUG( "logs [ENG] <- LogsModel::resetModel()" )
}
// -----------------------------------------------------------------------------
//
--- a/logsui/logsengine/themes/icons/hbdefault/scalable/qtg_large_missed_video_call_unseen.svg Fri Jun 11 16:24:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g>
-<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5609 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="422.2207" x2="428.7761" y1="-578.2104" y2="-582.472">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.1333" style="stop-color:#FFBE82"/>
-<stop offset="0.6303" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#FFBE82"/>
-</linearGradient>
-<path d="M18.469,33.146c2.09-3.596,4.591-6.497,7.281-9.19c2.594-2.589,6.72-5.299,8.562-6.254L43.916,7.42 c-0.846-0.3-3.693-0.465-7.279,0.616c-3.588,1.083-11.736,6.302-16.979,11.547C14.416,24.83,9.932,31.93,9.077,34.178 c-1.343,3.541-1.222,7.445-0.929,8.58c0,0,0.34,1.035,1.145,2.377C9.636,45.711,18.469,33.146,18.469,33.146z" fill="url(#SVGID_1_)"/>
-<path d="M30.573,20.037c1.488-1.037,2.869-1.883,3.74-2.335l9.346-10.006 c-0.131-0.057-0.209-0.088-0.209-0.088c-0.246-0.088-0.641-0.162-1.123-0.218c-0.793,0.005-1.596,0.093-2.402,0.27 C34.23,8.909,30.409,14.194,30.573,20.037z" fill="#020202" fill-opacity="0.05" stroke-opacity="0.05"/>
-<path d="M31.295,19.542c1.205-0.809,2.291-1.462,3.018-1.84l9.377-10.04 c-0.146-0.063-0.234-0.098-0.234-0.098c-0.232-0.08-0.604-0.152-1.061-0.203c-0.75,0.006-1.508,0.087-2.27,0.253 C34.664,8.813,31.023,13.932,31.295,19.542z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
-<path d="M43.467,7.499c-0.209-0.073-0.549-0.137-0.963-0.186c-0.68,0.006-1.369,0.08-2.059,0.231 c-5.088,1.116-8.426,5.984-7.977,11.233c0.725-0.455,1.363-0.826,1.844-1.076l9.422-10.088C43.566,7.538,43.467,7.499,43.467,7.499z " fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
-<radialGradient cx="46.6523" cy="-5.2056" gradientTransform="matrix(0.6122 0 0 0.6122 11.7943 11.6322)" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="20.0698">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.6242" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#FFBE82"/>
-</radialGradient>
-<path d="M34.313,17.702l0.928,1.55c0,0,15.102-6.784,14.084-8.039c-0.514-0.631-0.576-0.656-1.238-1.262 c-1.984-1.815-4.17-2.531-4.17-2.531C43.73,7.357,43.434,7.3,43.07,7.258c-0.596,0.005-1.199,0.069-1.805,0.202 c-4.592,1.008-7.572,5.5-6.965,10.256C34.305,17.713,34.309,17.706,34.313,17.702z" fill="url(#SVGID_2_)"/>
-<path d="M16.873,33.344c-0.989-0.141-2.008-0.121-3.028,0.104c-2.417,0.531-4.375,2.066-5.646,4.131 c-0.367,2.35-0.25,4.408-0.05,5.18c0,0,0.34,1.035,1.145,2.377c0.289,0.484,6.539-8.264,8.555-11.107L16.873,33.344z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
-<path d="M17.755,33.373c-0.989-0.141-2.008-0.119-3.029,0.104c-3.313,0.727-5.776,3.332-6.76,6.623 C7.94,41.125,8,41.973,8.093,42.498c0.002,0.012,0.005,0.033,0.01,0.047c0,0,0.339,1.033,1.143,2.379 c0.3,0.498,6.981-8.887,8.75-11.383L17.755,33.373z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
-<radialGradient cx="437.749" cy="-560.2109" gradientTransform="matrix(0.1283 0.5992 -0.5928 0.13 -373.5847 -154.0506)" gradientUnits="userSpaceOnUse" id="SVGID_3_" r="23.8799">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.6242" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#FFBE82"/>
-</radialGradient>
-<path d="M10.591,46.975c0.616,0.74,0.646,0.955,1.294,1.525c1.195,1.055,9.301-13.613,9.301-13.613 l-2.683-1.719c-0.941-0.111-1.913-0.08-2.889,0.135c-4.777,1.049-7.806,5.869-6.87,10.832C9.138,44.922,9.736,45.947,10.591,46.975z " fill="url(#SVGID_3_)"/>
-<path d="M49.324,11.213c-0.178-0.219-0.381-0.445-0.578-0.669l-13.943,7.958l0.438,0.749 C35.24,19.252,50.342,12.468,49.324,11.213z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
-<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="421.4131" x2="426.6039" y1="-610.4937" y2="-594.0048">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.6788" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#FFBE82"/>
-</linearGradient>
-<path d="M35.24,19.252l1.178,1.98c0.301,0.515,0.973,0.673,1.57,0.423l4.09-2.335l8.043-4.667 c0.631-0.363,0.877-1.12,0.549-1.685c0,0-0.334-0.501-1.35-1.752L35.24,19.252z" fill="url(#SVGID_4_)"/>
-<path d="M21.186,34.887l-0.725-0.473l-9.214,13.488c0.215,0.203,0.429,0.412,0.638,0.598 C13.081,49.555,21.186,34.887,21.186,34.887z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
-<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="438.8232" x2="450.6482" y1="-577.3184" y2="-564.2958">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.6788" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#FFBE82"/>
-</linearGradient>
-<path d="M11.887,48.498c1.193,1.051,1.685,1.371,1.685,1.371c0.568,0.367,1.363,0.168,1.781-0.443 l7.901-11.605c0.418-0.615,0.307-1.412-0.261-1.777l-1.808-1.156L11.887,48.498z" fill="url(#SVGID_5_)"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_6_" x1="39.1182" x2="44.145" y1="48.6309" y2="48.6309">
-<stop offset="0" style="stop-color:#878A8C"/>
-<stop offset="0.2606" style="stop-color:#BDC2C4"/>
-<stop offset="0.6606" style="stop-color:#5B6163"/>
-<stop offset="1" style="stop-color:#959A9C"/>
-</linearGradient>
-<rect fill="url(#SVGID_6_)" height="7.535" width="4.896" x="39.184" y="44.863"/>
-<path d="M39.184,49.596c0.787,0.189,1.604,0.303,2.449,0.303c0.844,0,1.662-0.113,2.447-0.303v-4.121 h-4.896V49.596z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M39.184,48.982c0.787,0.191,1.604,0.303,2.449,0.303c0.844,0,1.662-0.111,2.447-0.303v-4.119 h-4.896V48.982z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_7_" x1="41.6328" x2="41.6328" y1="27.8325" y2="48.6499">
-<stop offset="0" style="stop-color:#F2F2F2"/>
-<stop offset="0.3212" style="stop-color:#E6E6E6"/>
-<stop offset="1" style="stop-color:#666666"/>
-</linearGradient>
-<path d="M41.633,48.674c-5.74,0-10.408-4.67-10.408-10.408c0-5.74,4.668-10.409,10.408-10.409 c5.738,0,10.408,4.668,10.408,10.409C52.041,44.004,47.371,48.674,41.633,48.674L41.633,48.674z" fill="url(#SVGID_7_)"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_8_" x1="41.6318" x2="41.6318" y1="28.4473" y2="48.0381">
-<stop offset="0" style="stop-color:#D1D7D9"/>
-<stop offset="0.0667" style="stop-color:#D1D7D9"/>
-<stop offset="0.2606" style="stop-color:#BDC2C4"/>
-<stop offset="0.6606" style="stop-color:#7C8487"/>
-<stop offset="1" style="stop-color:#ADB3B5"/>
-</linearGradient>
-<circle cx="41.632" cy="38.266" fill="url(#SVGID_8_)" r="9.796"/>
-<path d="M41.633,47.037c-5.102,0-9.268-4.059-9.445-9.115c-0.004,0.111-0.008,0.223-0.008,0.334 c0,5.211,4.24,9.451,9.453,9.451c5.211,0,9.451-4.24,9.451-9.451c0-0.111-0.004-0.223-0.008-0.334 C50.898,42.979,46.732,47.037,41.633,47.037z" fill="#FFFFFF" fill-opacity="0.1" stroke-opacity="0.1"/>
-<path d="M49.592,37.848c0,4.516-3.564,8.969-7.963,8.967c-4.395-0.002-7.957-4.457-7.957-8.971 c0.004-4.516,3.568-8.172,7.963-8.172C46.029,29.675,49.594,33.334,49.592,37.848z" fill="#231F20" fill-opacity="0.3" stroke-opacity="0.3"/>
-<path d="M41.629,46.15c-2.291,0-4.443-0.893-6.061-2.512c-1.619-1.619-2.51-3.773-2.508-6.063 c0-4.725,3.846-8.567,8.572-8.567c2.291,0,4.443,0.893,6.063,2.512c1.619,1.619,2.51,3.771,2.508,6.063 c0,4.725-3.846,8.566-8.57,8.566H41.629z" fill="#231F20" fill-opacity="0.2" stroke-opacity="0.2"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_9_" x1="41.6318" x2="41.6318" y1="29.5093" y2="45.4663">
-<stop offset="0" style="stop-color:#CFCFCF"/>
-<stop offset="0.1091" style="stop-color:#CFCFCF"/>
-<stop offset="0.6848" style="stop-color:#121212"/>
-<stop offset="1" style="stop-color:#A6A6A6"/>
-</linearGradient>
-<path d="M41.629,45.539c-2.127-0.002-4.125-0.83-5.629-2.334c-1.502-1.502-2.328-3.502-2.328-5.629 c0-4.387,3.572-7.956,7.961-7.956c2.127,0,4.125,0.83,5.629,2.333c1.504,1.504,2.33,3.504,2.33,5.631 c-0.002,4.387-3.572,7.955-7.959,7.955H41.629z" fill="url(#SVGID_9_)"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_10_" x1="41.6318" x2="41.6318" y1="30.1289" y2="44.8584">
-<stop offset="0" style="stop-color:#F2F2F2"/>
-<stop offset="1" style="stop-color:#606769"/>
-</linearGradient>
-<circle cx="41.632" cy="37.58" fill="url(#SVGID_10_)" r="7.347"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_11_" x1="41.6318" x2="41.6318" y1="31.4756" y2="43.6433">
-<stop offset="0" style="stop-color:#1A1A1A"/>
-<stop offset="0.503" style="stop-color:#343434"/>
-<stop offset="0.7515" style="stop-color:#9E9E9E"/>
-<stop offset="1" style="stop-color:#CFCFCF"/>
-</linearGradient>
-<path d="M41.633,43.701c-1.639,0-3.176-0.639-4.332-1.795c-1.154-1.156-1.791-2.693-1.791-4.33 c0-3.373,2.746-6.119,6.123-6.119c1.637,0,3.174,0.637,4.33,1.795c1.156,1.156,1.793,2.693,1.791,4.33 C47.754,40.957,45.008,43.701,41.633,43.701L41.633,43.701z" fill="url(#SVGID_11_)"/>
-<radialGradient cx="59.5957" cy="40.5771" gradientTransform="matrix(0.621 1.836735e-004 -1.836735e-004 0.6209 5.2261 12.8455)" gradientUnits="userSpaceOnUse" id="SVGID_12_" r="10.1859">
-<stop offset="0" style="stop-color:#000000"/>
-<stop offset="0.5917" style="stop-color:#000000"/>
-<stop offset="0.627" style="stop-color:#050505"/>
-<stop offset="0.7652" style="stop-color:#121212"/>
-<stop offset="0.8876" style="stop-color:#171717"/>
-<stop offset="1" style="stop-color:#171717"/>
-</radialGradient>
-<circle cx="41.632" cy="37.579" fill="url(#SVGID_12_)" r="5.511"/>
-<radialGradient cx="53.6738" cy="32.9404" gradientTransform="matrix(0.621 0 0 0.6209 5.811 13.4188)" gradientUnits="userSpaceOnUse" id="SVGID_13_" r="16.2221">
-<stop offset="0" style="stop-color:#242424"/>
-<stop offset="0.4303" style="stop-color:#242424"/>
-<stop offset="0.7818" style="stop-color:#000000"/>
-<stop offset="1" style="stop-color:#000000"/>
-</radialGradient>
-<circle cx="41.633" cy="37.58" fill="url(#SVGID_13_)" r="4.521"/>
-<radialGradient cx="56.7607" cy="30.0415" gradientTransform="matrix(0.621 1.836735e-004 -1.836735e-004 0.6209 5.2261 12.8455)" gradientUnits="userSpaceOnUse" id="SVGID_14_" r="17.797">
-<stop offset="0" style="stop-color:#A700F5"/>
-<stop offset="0.3091" style="stop-color:#A700F5"/>
-<stop offset="0.4364" style="stop-color:#5E008A"/>
-<stop offset="0.8061" style="stop-color:#0E1402"/>
-<stop offset="1" style="stop-color:#0E1402"/>
-</radialGradient>
-<path d="M45.672,37.58c0,2.232-1.809,4.041-4.041,4.039c-2.232,0-4.041-1.811-4.041-4.041 c0.002-2.232,1.813-4.039,4.041-4.039C43.865,33.541,45.676,35.35,45.672,37.58z" fill="url(#SVGID_14_)"/>
-<radialGradient cx="58.6514" cy="45.2432" gradientTransform="matrix(0.621 1.836735e-004 -1.836735e-004 0.6209 5.2261 12.8455)" gradientUnits="userSpaceOnUse" id="SVGID_15_" r="7.2256">
-<stop offset="0" style="stop-color:#48630C"/>
-<stop offset="0.7879" style="stop-color:#000000"/>
-<stop offset="1" style="stop-color:#000000"/>
-</radialGradient>
-<path d="M45.672,37.58c0,2.232-1.809,4.041-4.041,4.039c-2.232,0-4.041-1.811-4.041-4.041 c0,0,1.385,2.465,4.041,2.465S45.672,37.58,45.672,37.58z" fill="url(#SVGID_15_)"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_16_" x1="41.6123" x2="41.6123" y1="32.7168" y2="37.5411">
-<stop offset="0" style="stop-color:#F8FBFF"/>
-<stop offset="1" style="stop-color:#808080"/>
-</linearGradient>
-<path d="M41.611,37.518c1.754,0,3.404-0.264,4.863-0.732 c-0.414-2.313-2.432-4.068-4.863-4.068c-2.43,0-4.445,1.756-4.861,4.068C38.207,37.254,39.859,37.518,41.611,37.518z" fill="url(#SVGID_16_)" fill-opacity="0.35" stroke-opacity="0.35"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_17_" x1="32.7676" x2="50.541" y1="51.5801" y2="51.5801">
-<stop offset="0" style="stop-color:#878A8C"/>
-<stop offset="0.2606" style="stop-color:#BDC2C4"/>
-<stop offset="0.6606" style="stop-color:#5B6163"/>
-<stop offset="1" style="stop-color:#959A9C"/>
-</linearGradient>
-<path d="M50.502,52.805c0.025-0.609,0.039-0.486,0.039-0.613v-0.033c0-0.996-0.816-1.803-1.824-1.803H34.592 c-1.008,0-1.824,0.807-1.824,1.803v0.033c0,0.127,0.014,0.004,0.039,0.613H50.502z" fill="url(#SVGID_17_)"/>
-<path d="M32.881,51.557H50.43c-0.08-0.225-0.203-0.426-0.361-0.6H33.242 C33.084,51.131,32.961,51.332,32.881,51.557z" fill="#FFFFFF" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M32.777,52.191c0.008,0.125,0.016,0.309,0.029,0.613h17.695 c0.012-0.305,0.021-0.488,0.027-0.613H32.777z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M33.24,50.957h16.826c-0.332-0.367-0.811-0.602-1.35-0.602H34.592 C34.053,50.355,33.574,50.59,33.24,50.957z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
-<rect fill="none" height="60" width="60"/>
-</g>
-<g>
-<rect fill="none" height="30" width="30"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1__" x1="15.0005" x2="15.0005" y1="4.5283" y2="27.0492">
-<stop offset="0" style="stop-color:#FF7042"/>
-<stop offset="1" style="stop-color:#991B23"/>
-</linearGradient>
-<path d="M19.018,16.846v-4.316h4.535l-8.512-8.844l-8.592,8.844h4.631v4.316 c0,7.293,6.068,9.467,11.908,9.467v-6.422C21.189,19.891,19.018,19.002,19.018,16.846z" fill="url(#SVGID_1__)"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2__" x1="15.0005" x2="15.0005" y1="4.0146" y2="12.8168">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#991B23"/>
-</linearGradient>
-<polygon fill="url(#SVGID_2__)" points="15.041,4.508 22.762,12.529 23.553,12.529 15.041,3.686 6.449,12.529 7.248,12.529 "/>
-</g>
-</svg>
--- a/logsui/logsengine/themes/icons/hbdefault/scalable/qtg_large_missed_voice_call_unseen.svg Fri Jun 11 16:24:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g>
-<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5609 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="423.0967" x2="429.6527" y1="-578.646" y2="-582.908">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.6061" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#991B23"/>
-</linearGradient>
-<path d="M19.081,33.911c2.089-3.597,4.591-6.497,7.281-9.189c2.593-2.591,6.72-5.3,8.562-6.256l9.604-10.282 c-0.845-0.3-3.693-0.464-7.279,0.616c-3.586,1.083-11.736,6.303-16.979,11.547c-5.242,5.246-9.727,12.347-10.581,14.595 c-1.343,3.541-1.221,7.445-0.929,8.581c0,0,0.34,1.034,1.144,2.377C10.248,46.476,19.081,33.911,19.081,33.911z" fill="url(#SVGID_1_)"/>
-<path d="M31.184,20.8c1.488-1.036,2.87-1.882,3.74-2.334L44.271,8.46 c-0.132-0.058-0.209-0.088-0.209-0.088c-0.247-0.088-0.642-0.162-1.124-0.219c-0.793,0.006-1.596,0.093-2.401,0.27 C34.843,9.673,31.019,14.958,31.184,20.8z" fill="#020202" fill-opacity="0.05" stroke-opacity="0.05"/>
-<path d="M31.906,20.306c1.205-0.809,2.291-1.462,3.018-1.84l9.377-10.04 c-0.146-0.063-0.233-0.098-0.233-0.098c-0.231-0.08-0.604-0.152-1.06-0.203c-0.751,0.006-1.51,0.087-2.27,0.253 C35.275,9.576,31.636,14.695,31.906,20.306z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
-<path d="M44.079,8.263c-0.21-0.073-0.55-0.137-0.962-0.186c-0.681,0.006-1.369,0.08-2.06,0.231 c-5.087,1.116-8.426,5.984-7.978,11.233c0.725-0.455,1.363-0.826,1.844-1.076l9.424-10.088C44.178,8.302,44.079,8.263,44.079,8.263z " fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
-<radialGradient cx="43.3906" cy="8.9175" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="18.5073">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.6061" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#991B23"/>
-</radialGradient>
-<path d="M34.924,18.466l0.929,1.55c0,0,15.101-6.784,14.084-8.038c-0.513-0.631-0.577-0.656-1.237-1.263 c-1.985-1.815-4.172-2.531-4.172-2.531c-0.186-0.063-0.481-0.12-0.845-0.161c-0.596,0.004-1.2,0.068-1.806,0.201 c-4.591,1.009-7.57,5.501-6.963,10.257C34.916,18.477,34.921,18.47,34.924,18.466z" fill="url(#SVGID_2_)"/>
-<path d="M17.483,34.106c-0.988-0.14-2.007-0.119-3.027,0.105c-2.418,0.53-4.376,2.066-5.646,4.131 c-0.367,2.35-0.25,4.407-0.05,5.18c0,0,0.34,1.034,1.144,2.377c0.29,0.482,6.54-8.264,8.556-11.107L17.483,34.106z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
-<path d="M18.366,34.136c-0.989-0.14-2.008-0.118-3.029,0.105c-3.313,0.727-5.775,3.332-6.76,6.623 c-0.026,1.025,0.034,1.872,0.127,2.397c0.003,0.013,0.005,0.034,0.01,0.048c0,0,0.34,1.033,1.144,2.379 c0.3,0.498,6.981-8.888,8.75-11.384L18.366,34.136z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
-<radialGradient cx="437.4258" cy="-571.231" gradientTransform="matrix(0.2095 0.9787 -0.9682 0.2124 -629.4526 -270.6148)" gradientUnits="userSpaceOnUse" id="SVGID_3_" r="14.6198">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.6061" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#991B23"/>
-</radialGradient>
-<path d="M11.202,47.738c0.616,0.74,0.646,0.954,1.295,1.524c1.194,1.055,9.301-13.612,9.301-13.612 l-2.683-1.719c-0.941-0.111-1.914-0.079-2.89,0.136c-4.777,1.048-7.806,5.868-6.87,10.832C9.749,45.686,10.349,46.71,11.202,47.738z " fill="url(#SVGID_3_)"/>
-<path d="M49.937,11.978c-0.179-0.22-0.381-0.446-0.578-0.67l-13.944,7.959l0.438,0.749 C35.853,20.016,50.953,13.231,49.937,11.978z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
-<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="422.2881" x2="427.4786" y1="-610.9287" y2="-594.4409">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.8121" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#991B23"/>
-</linearGradient>
-<path d="M35.853,20.016l1.178,1.981c0.302,0.515,0.972,0.674,1.569,0.422l4.09-2.334l8.043-4.668 c0.632-0.363,0.878-1.119,0.549-1.686c0,0-0.333-0.501-1.349-1.751L35.853,20.016z" fill="url(#SVGID_4_)"/>
-<path d="M21.798,35.65l-0.725-0.472l-9.215,13.486c0.216,0.204,0.43,0.414,0.639,0.598 C13.691,50.317,21.798,35.65,21.798,35.65z" fill="#020202" fill-opacity="0.4" stroke-opacity="0.4"/>
-<linearGradient gradientTransform="matrix(0.2118 0.9773 -0.9773 0.2118 -634.5599 -270.4865)" gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="439.6982" x2="451.5232" y1="-577.7549" y2="-564.7323">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.8121" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#991B23"/>
-</linearGradient>
-<path d="M12.498,49.262c1.193,1.05,1.686,1.37,1.686,1.37c0.567,0.367,1.363,0.169,1.781-0.442l7.9-11.605 c0.419-0.614,0.307-1.411-0.26-1.777l-1.808-1.156L12.498,49.262z" fill="url(#SVGID_5_)"/>
-<rect fill="none" height="60" width="60"/>
-</g>
-<g>
-<rect fill="none" height="30" width="30"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1__" x1="15.0005" x2="15.0005" y1="4.5283" y2="27.0492">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#991B23"/>
-</linearGradient>
-<path d="M19.018,16.846v-4.316h4.535l-8.512-8.844l-8.592,8.844h4.631v4.316 c0,7.293,6.068,9.467,11.908,9.467v-6.422C21.189,19.891,19.018,19.002,19.018,16.846z" fill="url(#SVGID_1__)"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2__" x1="15.0005" x2="15.0005" y1="4.0146" y2="12.8168">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#991B23"/>
-</linearGradient>
-<polygon fill="url(#SVGID_2__)" points="15.041,4.508 22.762,12.529 23.553,12.529 15.041,3.686 6.449,12.529 7.248,12.529 "/>
-</g>
-</svg>
--- a/logsui/logsengine/themes/icons/hbdefault/scalable/qtg_large_missed_voip_call_unseen.svg Fri Jun 11 16:24:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g>
-<rect fill="none" height="60" width="60"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="31.3823" x2="31.3823" y1="49.3193" y2="6.7675">
-<stop offset="0" style="stop-color:#004E8C"/>
-<stop offset="1" style="stop-color:#1B66D8"/>
-</linearGradient>
-<circle cx="31.382" cy="28.137" fill="url(#SVGID_1_)" r="21.429"/>
-<radialGradient cx="23.8237" cy="17.7847" gradientTransform="matrix(0.9953 0 0 0.9952 7.3664 3.0238)" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="25.9191">
-<stop offset="0" style="stop-color:#94FFFF"/>
-<stop offset="0.5" style="stop-color:#36B5FF"/>
-<stop offset="1" style="stop-color:#1B66D8"/>
-</radialGradient>
-<path d="M52.262,28.137c0,11.533-9.346,20.877-20.879,20.877c-11.533,0-20.882-9.344-20.882-20.877 c0-11.53,9.35-20.88,20.882-20.88C42.917,7.257,52.262,16.607,52.262,28.137z" fill="url(#SVGID_2_)"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="31.3823" x2="31.3823" y1="7.0732" y2="49.1199">
-<stop offset="0" style="stop-color:#31A7F8"/>
-<stop offset="0.497" style="stop-color:#1E74DC"/>
-<stop offset="1" style="stop-color:#88D6EB"/>
-</linearGradient>
-<path d="M31.383,7.257c-11.533,0-20.882,9.35-20.882,20.88c0,11.533,9.35,20.877,20.882,20.877 c11.533,0,20.879-9.344,20.879-20.877C52.262,16.607,42.917,7.257,31.383,7.257z M31.383,47.188 c-10.843,0-19.664-8.818-19.664-19.659c0-10.843,8.82-19.663,19.664-19.663c10.841,0,19.66,8.82,19.66,19.663 C51.043,38.369,42.224,47.188,31.383,47.188z" fill="url(#SVGID_3_)" fill-opacity="0.3" stroke-opacity="0.3"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="10.8428" x2="14.1621" y1="30.9775" y2="30.9775">
-<stop offset="0" style="stop-color:#58595B"/>
-<stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<path d="M12.462,27.796C12.239,27.5,11.737,27.5,11.516,27.5c-0.437,0-0.669,0.312-0.673,0.616 v0.021l0.001,0.031c-0.001,0.537,0.029,1.14,0.094,1.872c0.013,0.138,0.03,0.276,0.047,0.414l0.024,0.201 c0.056,0.434,0.121,0.86,0.195,1.274l0.034,0.182c0.032,0.164,0.063,0.324,0.098,0.484c0.089,0.406,0.198,0.826,0.332,1.291 c0.02,0.066,0.037,0.133,0.055,0.199c0.028,0.109,0.058,0.217,0.091,0.322l0.005,0.014l0.012,0.033 c-0.003-0.01-0.008-0.023-0.01-0.037l1.198-0.08c0.019-0.188,0.024-0.383,0.019-0.576c-0.01-0.303-0.021-0.676-0.107-0.99 l1.112-1.494l0.12-0.162v-0.203v-1.165v-0.252l-0.179-0.178L12.462,27.796z" fill="url(#SVGID_4_)" fill-opacity="0.3" stroke-opacity="0.3"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="17.2432" x2="51.9731" y1="24.897" y2="24.897">
-<stop offset="0" style="stop-color:#58595B"/>
-<stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-<path d="M51.966,24.045c-0.016-0.079-0.029-0.136-0.043-0.191 c-0.011-0.042-0.021-0.084-0.029-0.125c-0.106-0.495-0.237-1.005-0.392-1.525l-0.017-0.058c-0.033-0.117-0.068-0.234-0.105-0.349 c-0.188-0.588-0.393-1.148-0.608-1.666c-0.027-0.066-0.056-0.125-0.084-0.188l-0.045-0.1c-0.206-0.474-0.436-0.947-0.677-1.403 l-0.03-0.059c-0.047-0.09-0.093-0.181-0.142-0.269c-0.295-0.532-0.604-1.041-0.918-1.512c-0.032-0.049-0.069-0.102-0.106-0.154 c-0.023-0.031-0.045-0.061-0.066-0.092c-0.302-0.437-0.618-0.862-0.946-1.268l-0.064-0.082c-0.044-0.055-0.088-0.111-0.134-0.167 c-0.381-0.456-0.783-0.898-1.199-1.317c-0.056-0.056-0.115-0.115-0.176-0.172l-0.049-0.047c-0.375-0.368-0.774-0.732-1.183-1.074 l-0.081-0.069c-0.041-0.037-0.083-0.073-0.125-0.106c-0.446-0.367-0.931-0.728-1.435-1.075c-0.063-0.042-0.126-0.083-0.19-0.124 l-0.077-0.05c-0.454-0.301-0.928-0.59-1.404-0.853l-0.072-0.042c-0.04-0.023-0.079-0.045-0.119-0.068 c-0.529-0.283-1.081-0.55-1.643-0.792l-0.142-0.057l-0.153-0.063c-0.148-0.061-0.297-0.114-0.443-0.165 c-0.077-0.026-0.152-0.053-0.228-0.08l-0.282-0.105L38.303,8.74c-0.17,0.107-0.84,0.49-1.235,0.715 c-0.438-0.059-1.499-0.192-2.57-0.295c0.33-0.032,0.787-0.069,1.43-0.111l0.09-1.204L35.97,7.832 c-0.039-0.011-0.077-0.021-0.116-0.029l-0.092-0.018l-0.075-0.015c-0.655-0.131-1.271-0.227-1.882-0.291l-0.004-0.001l-0.085-0.009 c-0.698-0.07-1.409-0.106-2.112-0.106c-0.62,0-1.262,0.033-1.964,0.101c-0.109,0.01-0.214,0.021-0.321,0.032 c-0.693,0.078-1.3,0.17-1.873,0.286l-0.02,0.003l-0.015,0.002c-0.604,0.125-1.211,0.281-1.856,0.477 c-0.058,0.018-0.116,0.037-0.173,0.055l-0.131,0.043c-0.547,0.176-1.082,0.371-1.596,0.582c-0.042,0.018-0.071,0.029-0.1,0.04 l-0.078,0.031c-0.564,0.24-1.128,0.512-1.688,0.812c-0.06,0.031-0.118,0.066-0.177,0.099L21.542,9.97 c-0.157,0.087-0.315,0.185-0.473,0.283l-0.203,0.127l-1.118,0.684l1.242,0.415c0.186,0.063,0.385,0.093,0.592,0.093 c0.67,0,1.317-0.329,1.838-0.593c0.209-0.105,0.521-0.264,0.648-0.288c0.152,0.045,0.306,0.068,0.458,0.068 c0.569,0,1.035-0.306,1.446-0.578l0.111-0.072c0.134-0.043,0.362-0.128,0.818-0.299c0.465-0.174,1.314-0.493,1.54-0.546 c0.44-0.005,0.966-0.068,1.339-0.3c0.352,0.058,0.977,0.157,1.619,0.24c-0.047,0.029-0.093,0.059-0.132,0.097 c-0.209,0.192-1.335,0.533-1.68,0.578c-0.647,0.081-0.908,0.408-1.012,0.666c-0.135,0.336-0.054,0.672,0.078,0.946 c-0.245,0.162-0.545,0.342-0.804,0.479c0.001-0.006,0.003-0.012,0.004-0.02c0.093-0.517,0.16-0.89-0.091-1.189 c-0.128-0.153-0.317-0.241-0.519-0.241c-0.295,0-0.525,0.183-0.711,0.362c-0.52,0.502-0.834,1.129-0.952,1.365l-0.022,0.044 l-0.019,0.035c-0.225,0.431-0.317,0.737-0.192,1.688c-0.055,0.04-0.219,0.102-0.445,0.102c-0.03,0-0.058-0.002-0.079-0.003 c-0.146-0.158-0.349-0.248-0.576-0.248l0,0c-0.524,0-1.238,0.589-2.123,1.754l-0.284,0.374l0.289,0.371l0.27,0.343 c-4.216,3.259-4.248,3.444-4.292,3.717c-0.007,0.024-0.044,0.137-0.095,0.293c-0.628,1.952-0.977,3.413-0.637,4.194 c0.784,1.813,1.669,3.505,2.815,3.599c0.101,0.008,0.212,0.012,0.332,0.012c1.051,0,2.753-0.318,3.572-0.485 c0.151,0.283,0.335,0.614,0.438,0.795l0.181,0.323l0.37-0.012c0.004,0,0.199-0.006,0.448-0.006c0.286,0,0.478,0.008,0.602,0.017 c0.446,1.307,1.3,4.317,1.142,4.944L27.272,34.1c-1.441,2.16,0.306,4.975,1.145,6.328c0.066,0.107,0.126,0.203,0.177,0.287 c0.324,0.922,0.716,1.531,1.545,1.531c0.062,0,0.124-0.004,0.188-0.008c0.047-0.002,0.096-0.004,0.146-0.004 c0.092,0,0.157,0.01,0.226,0.035l0.075,0.027l0.08,0.006c0.155,0.014,0.306,0.035,0.453,0.057c0.255,0.035,0.519,0.07,0.788,0.07 c0.721,0,1.293-0.271,1.787-0.855c0.019-0.002,0.036-0.004,0.055-0.006c0.518-0.072,0.712-0.332,0.778-0.564 c0.038-0.039,0.089-0.086,0.131-0.125c0.204-0.188,0.447-0.41,0.615-0.674c0.075-0.045,0.161-0.096,0.258-0.152 c0.167-0.104,0.355-0.217,0.504-0.293c0.131-0.041,0.247-0.117,0.334-0.225c0.209-0.258,0.166-0.549,0.131-0.783 c-0.035-0.242-0.071-0.492,0.06-0.758c0.738-0.355,2.051-1.23,2.263-1.375l-0.001,0.018c-0.014,0.117-0.048,0.43-0.1,0.629 c-0.279,0.279-0.513,0.703-0.586,0.846l-0.049,0.094l-0.015,0.104c-0.019,0.137-0.094,0.85,0.306,1.311 c0.202,0.23,0.49,0.359,0.813,0.359c0.103,0,0.21-0.014,0.319-0.039c1.027-0.232,2.85-2.703,2.998-4.066 c0.072-0.656-0.185-1.172-0.704-1.416l-0.387-0.184l-0.304,0.303l-1.125,1.125c-0.38,0.035-0.678,0.148-0.879,0.326 c0.012-0.48-0.035-0.973-0.086-1.451c-0.155-1.447-0.185-2.369,0.703-2.996l0.045-0.033l0.038-0.039 c0.321-0.326,0.676-0.611,1.052-0.914c0.88-0.707,1.79-1.438,2.332-2.759l0.022-0.056c0.174-0.451,0.437-1.132,0.081-1.651 c-0.089-0.128-0.275-0.327-0.624-0.397c0.462-0.186,0.816-0.332,0.851-0.346l0.107-0.044l0.083-0.08l1.898-1.822l0.278-0.268 l-0.122-0.366c-0.017-0.047-0.12-0.335-0.411-0.747c0.554,0.075,1.029,0.208,1.185,0.326c0.057,0.124,0.171,0.396,0.292,0.683 c2.089,4.924,2.382,5.178,2.926,5.187c0.021,0,0.037,0.002,0.051,0.003c0.044,0.003,0.083,0.005,0.119,0.005 c0.31,0,0.486-0.157,0.564-0.252c0.227-0.274,0.163-0.608,0.14-0.734l-0.009-0.043c-0.025-0.294-0.008-1.618,0.034-2.706 c0.003,0.002,0.004,0.006,0.006,0.01l1.12-0.445L51.966,24.045z M35.508,18.021c-0.087,0.003-0.181,0.008-0.282,0.012 c-0.322,0.015-0.688,0.031-1.053,0.031c-0.955,0-1.174-0.118-1.196-0.131c-0.113-0.082-0.229-0.144-0.35-0.188 c0.216-0.048,0.464-0.214,0.719-0.708c0.251,0.487,0.592,0.917,1.115,0.917c0.142,0,0.277-0.034,0.406-0.101 C35.043,17.856,35.333,17.957,35.508,18.021z M35.133,15.357c-0.072,0-0.131-0.003-0.176-0.007c0.049-0.128,0.107-0.202,0.154-0.244 c0.06,0.093,0.14,0.175,0.232,0.245C35.27,15.355,35.2,15.357,35.133,15.357z M31.331,16.635c0.327,0.641,0.569,0.917,0.762,1.037 c-0.475,0.038-0.833,0.339-1.126,0.625c-0.206-0.068-0.565-0.286-0.672-0.438c-0.063-0.089-0.138-0.166-0.221-0.232 C30.593,17.479,31.049,16.998,31.331,16.635z M29.523,16.163l-0.679-0.033l-2.278-0.111c0.278-0.229,0.541-0.444,0.697-0.57 c0.042-0.015,0.205-0.06,0.605-0.06c0.242,0,0.474,0.017,0.62,0.029L29.523,16.163z" fill="url(#SVGID_5_)" fill-opacity="0.3" stroke-opacity="0.3"/>
-<radialGradient cx="24.4912" cy="10.4414" gradientTransform="matrix(0.9953 0 0 0.9952 7.3664 3.0238)" gradientUnits="userSpaceOnUse" id="SVGID_6_" r="23.6744">
-<stop offset="0" style="stop-color:#7AF200"/>
-<stop offset="0.3152" style="stop-color:#7AF200"/>
-<stop offset="0.7273" style="stop-color:#1CAD0F"/>
-<stop offset="1" style="stop-color:#007A3A"/>
-</radialGradient>
-<path d="M11.451,28.125C11.451,28.125,11.451,28.125,11.451,28.125c0,0.008,0.001,0.012,0.001,0.018 c0,0.622,0.039,1.236,0.093,1.844c0.018,0.198,0.047,0.398,0.069,0.598c0.053,0.417,0.116,0.83,0.19,1.238 c0.042,0.215,0.081,0.434,0.127,0.646c0.094,0.422,0.203,0.838,0.321,1.248c0.05,0.17,0.089,0.342,0.141,0.508 c0.007,0.018,0.015,0.033,0.019,0.051c0.017-0.16,0.021-0.326,0.017-0.496c-0.04-1.199-0.232-1.045-0.232-1.045l1.356-1.822v-1.165 l-1.589-1.589C11.964,28.159,11.452,28.079,11.451,28.125z" fill="url(#SVGID_6_)"/>
-<radialGradient cx="24.4868" cy="10.4395" gradientTransform="matrix(0.9953 0 0 0.9952 7.3664 3.0238)" gradientUnits="userSpaceOnUse" id="SVGID_7_" r="23.6775">
-<stop offset="0" style="stop-color:#7AF200"/>
-<stop offset="0.3152" style="stop-color:#7AF200"/>
-<stop offset="0.7273" style="stop-color:#1CAD0F"/>
-<stop offset="1" style="stop-color:#007A3A"/>
-</radialGradient>
-<path d="M24.212,10.099c0.587,0.193,1.066-0.2,1.613-0.549c0.193-0.04,2.338-0.896,2.57-0.896 c0.231,0,1.011-0.03,1.204-0.34c0,0,3.357,0.584,3.863,0.389c0.275-0.107,1.433-0.2,2.425-0.264 c-0.056-0.012-0.106-0.029-0.162-0.041c-0.054-0.011-0.105-0.019-0.161-0.03c-0.623-0.126-1.252-0.226-1.894-0.29 c-0.006,0-0.01,0-0.016-0.002c-0.674-0.068-1.358-0.104-2.052-0.104c-0.644,0-1.277,0.038-1.906,0.098 c-0.11,0.011-0.221,0.022-0.331,0.035c-0.608,0.067-1.211,0.155-1.801,0.274c-0.01,0.003-0.021,0.004-0.031,0.006 c-0.612,0.127-1.213,0.283-1.802,0.464c-0.102,0.03-0.199,0.064-0.302,0.096c-0.522,0.168-1.038,0.356-1.544,0.564 c-0.06,0.026-0.12,0.048-0.18,0.072c-0.557,0.238-1.1,0.501-1.63,0.784c-0.08,0.043-0.156,0.089-0.234,0.134 c-0.227,0.125-0.44,0.267-0.66,0.402C22.273,11.265,23.635,9.904,24.212,10.099z" fill="url(#SVGID_7_)"/>
-<radialGradient cx="24.4863" cy="10.437" gradientTransform="matrix(0.9953 0 0 0.9952 7.3664 3.0238)" gradientUnits="userSpaceOnUse" id="SVGID_8_" r="23.6745">
-<stop offset="0" style="stop-color:#B2F56E"/>
-<stop offset="0.3152" style="stop-color:#B2F56E"/>
-<stop offset="0.7273" style="stop-color:#5CBF1B"/>
-<stop offset="1" style="stop-color:#227A00"/>
-</radialGradient>
-<path d="M51.366,24.146c-0.021-0.102-0.049-0.197-0.069-0.297c-0.106-0.499-0.233-0.99-0.378-1.474 c-0.038-0.13-0.076-0.264-0.118-0.395c-0.176-0.549-0.371-1.09-0.59-1.616c-0.04-0.093-0.085-0.184-0.125-0.275 c-0.202-0.464-0.421-0.918-0.657-1.363c-0.056-0.106-0.109-0.215-0.166-0.319c-0.279-0.502-0.575-0.993-0.893-1.469 c-0.054-0.083-0.114-0.161-0.17-0.243c-0.291-0.422-0.596-0.831-0.916-1.228c-0.064-0.079-0.127-0.16-0.194-0.24 c-0.368-0.442-0.756-0.868-1.161-1.277c-0.069-0.07-0.143-0.14-0.215-0.208c-0.369-0.363-0.755-0.714-1.153-1.047 c-0.067-0.056-0.131-0.116-0.198-0.171c-0.448-0.366-0.915-0.714-1.395-1.043c-0.084-0.057-0.17-0.112-0.256-0.167 c-0.442-0.294-0.898-0.571-1.366-0.83c-0.063-0.035-0.123-0.073-0.187-0.108c-0.52-0.278-1.05-0.533-1.594-0.768 c-0.097-0.041-0.194-0.079-0.29-0.12c-0.211-0.087-0.432-0.156-0.646-0.235c-0.255,0.163-1.438,0.832-1.438,0.832 s-5.141-0.702-5.491-0.353c-0.352,0.353-1.721,0.71-2.033,0.751c-0.311,0.04-0.956,0.206-0.182,1.161 c-0.116,0.118-2.325,1.657-2.325,0.957s0.494-1.953-0.2-1.282c-0.498,0.482-0.796,1.135-0.86,1.257 c-0.163,0.312-0.263,0.461-0.145,1.357s-1.43,0.891-1.534,0.659c-0.276-0.622-1.809,1.394-1.809,1.394l0.646,0.828 c0,0-4.51,3.474-4.548,3.707c-0.04,0.234-1.164,3.25-0.775,4.147c0.39,0.897,1.376,3.158,2.307,3.233 c1.222,0.101,4.186-0.559,4.186-0.559c0.08,0.196,0.638,1.189,0.638,1.189s1.453-0.048,1.534,0.11 c0.026,0.053,1.75,5.122,1.182,5.794c-1.357,2.033,0.775,5.012,1.369,6.02c0.594,1.73,0.977,0.955,1.758,1.238 c0.962,0.084,1.772,0.439,2.589-0.611c0.237-0.195,0.641-0.041,0.641-0.313c0-0.152,0.698-0.598,0.878-1.018 c0.188-0.088,0.674-0.414,1.003-0.572c0.299-0.02-0.283-0.82,0.309-1.666c0.64-0.252,2.364-1.414,2.364-1.414 c0.078-1.705-0.839-3.811,0.873-5.02c1.104-1.126,2.553-1.767,3.255-3.479c0.194-0.506,0.628-1.542-0.619-1.231 c-1.173,0.295-2.48,0.362-1.861-0.154c-0.071-0.634-0.85-0.932-1.55-1.552c-0.361-0.854-0.93-2.378-0.93-2.378l-1.24-1.885 l0.155-0.389l1.474,2.171l1.474,1.781c0.542,1.783,1.007,1.939,1.007,1.939c0.815-0.288,2.753-1.086,2.753-1.086l1.898-1.822 c0,0-0.195-0.581-0.967-1.316l-0.584-0.349c-0.126,0.357-0.802,0.491-0.802,0.491l-1.641-1.964l0.61-0.123l0.471,0.896l1.128,0.39 c0,0,0.313-0.229,0.893,0.371c0.473-0.039,2.318,0.09,2.749,0.636c0.085,0.109,2.287,5.607,2.721,5.614 c0.19,0.002,0.329,0.077,0.267-0.256c-0.078-0.156,0-3.609,0.116-4.349c0.295-0.628,0.343-0.003,1.04,1.188 C51.374,24.204,51.372,24.175,51.366,24.146z M31.993,10.823c0.154-0.459,1.047-0.615,1.047-0.615s-0.256,0.473-0.197,0.716 c0.06,0.247-0.407,0.402-0.46,0.982c-0.051,0.578-1.117,0.239-1.204,0.036C31.09,11.74,31.835,11.281,31.993,10.823z M35.816,18.624 c-0.661,0-2.645,0.196-3.19-0.194c-0.546-0.389-0.97,0.04-1.362,0.43c-0.258,0.253-1.193-0.26-1.468-0.649 c-0.271-0.39-1.188-0.361-1.188-0.361l0.208-1.111l-2.637-0.128l-1.499,0.439l-1.41,0.041l0.79-0.376l0.983-0.232 c0,0,1.431-1.176,1.859-1.526c0.363-0.297,1.811-0.129,1.811-0.129l1.589,1.146c0,0-0.353,0.898-0.508,1.091 c0.583-0.039,1.269-1.099,1.269-1.099c-1.239-1.138-1.188-1.524-1.188-1.524l1.633,1.146l0.016,0.01c0,0,0.661,1.558,0.937,1.558 c0.271,0,0.619-1.073,0.619-1.073l0.465-0.117c0.207,0.492,0.595,1.603,1.059,1.343c0.269-0.147,0.71-0.013,1.215,0.181 c0.509,0.195,0.854-0.104,1.267,0.258C37.03,19.349,36.089,18.702,35.816,18.624z M36.853,15.943 c-0.681-0.259-2.984,0.586-2.47-0.796c0.275-0.746,0.981-0.901,1.223-0.405c0.063,0.204,0.83,0.519,0.824,0.09 c-0.006-0.431,0.771-0.659,0.883-0.338C36.899,14.791,38.932,16.341,36.853,15.943z M41.192,17.252 c-0.377-0.304,0.169-0.564-0.387-1.041c-0.798-0.684-1.421-0.978-0.334-1.532c1.341-0.168,0.218,0.428,0.44,0.786 c0.119,0.19,0.796,0.828,1.325,1.61C42.676,17.725,41.567,17.555,41.192,17.252z" fill="url(#SVGID_8_)"/>
-<radialGradient cx="24.4839" cy="10.4453" gradientTransform="matrix(0.9953 0 0 0.9952 7.3664 3.0238)" gradientUnits="userSpaceOnUse" id="SVGID_9_" r="23.6688">
-<stop offset="0" style="stop-color:#7AF200"/>
-<stop offset="0.3152" style="stop-color:#7AF200"/>
-<stop offset="0.7273" style="stop-color:#1CAD0F"/>
-<stop offset="1" style="stop-color:#007A3A"/>
-</radialGradient>
-<path d="M41.733,35.008l-1.293,1.291c0,0-0.778,0-0.815,0.313c-0.017,0.133-0.063,0.709-0.192,1.006 c-0.258,0.18-0.569,0.775-0.569,0.775s-0.158,1.15,0.699,0.953C40.42,39.152,43.059,35.633,41.733,35.008z" fill="url(#SVGID_9_)"/>
-<path d="M31.68,48.668c1.546,0,3.049-0.174,4.499-0.49c-0.039-0.049-0.071-0.1-0.114-0.145 l-7.534-7.756c-0.434-0.447-1.031-0.705-1.638-0.705c-0.57,0-1.102,0.221-1.5,0.625l-1.144,1.18l-0.472,0.477l-0.436,0.447 c-1.654-1.605-3.133-3.443-4.739-5.873c-0.888-1.348-1.653-2.988-2.138-4.123l-0.178-0.424c-0.001,0-0.242-0.598-0.324-0.811 l-0.027-0.068c-0.067-0.176-0.127-0.341-0.184-0.5l-0.025-0.069l1.843-0.641c1.017-0.344,1.593-1.403,1.363-2.555l-0.007-0.036 l-1.154-3.523l-2.274-6.787c-0.162-0.486-0.47-0.886-0.858-1.16c-2.416,3.407-3.841,7.565-3.841,12.059 C10.797,39.322,20.147,48.668,31.68,48.668z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
-<path d="M31.68,48.668c1.301,0,2.57-0.125,3.806-0.352l-7.394-7.613c-0.32-0.33-0.758-0.52-1.199-0.52 c-0.404,0-0.779,0.156-1.061,0.441l-1.148,1.182l-0.467,0.473l-0.424,0.436l0.003,0.004l-0.435,0.445 c-1.866-1.736-3.509-3.734-5.269-6.4c-0.91-1.381-1.694-3.059-2.192-4.221l-0.158-0.375l-0.024-0.059c0,0-0.243-0.602-0.327-0.816 l-0.029-0.072c-0.068-0.18-0.129-0.347-0.19-0.513c0,0-0.12-0.337-0.145-0.41l0.071-0.295l2.272-0.791 c0.721-0.244,1.127-1.009,0.966-1.819l-0.007-0.036l-1.142-3.485l-2.274-6.789c-0.119-0.357-0.343-0.65-0.626-0.851 c-2.204,3.31-3.492,7.283-3.492,11.557C10.797,39.322,20.147,48.668,31.68,48.668z" fill="#020202" fill-opacity="0.2" stroke-opacity="0.2"/>
-<radialGradient cx="-859.7427" cy="-265.1074" gradientTransform="matrix(0.9999 -0.0111 0.0111 0.9999 905.1068 277.0371)" gradientUnits="userSpaceOnUse" id="SVGID_10_" r="34.2211">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.8364" style="stop-color:#FFBE82"/>
-<stop offset="0.8909" style="stop-color:#FFBE82"/>
-<stop offset="0.9515" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#FFBE82"/>
-</radialGradient>
-<path d="M23.387,44.016c-2.39-2.133-4.191-4.469-5.806-6.914c-1.552-2.357-2.958-5.889-3.393-7.428 l-6.272-8.836c-0.357,0.592-0.921,2.715-0.661,5.588c0.262,2.872,2.939,9.828,6.083,14.596c3.146,4.766,7.81,9.248,9.374,10.24 c2.462,1.561,5.427,2.074,6.329,2.029c0,0,0.833-0.098,1.97-0.496C31.5,52.625,23.387,44.016,23.387,44.016z" fill="url(#SVGID_10_)"/>
-<path d="M15.369,32.857c-0.55-1.283-0.976-2.456-1.18-3.184l-6.104-8.599c-0.064,0.09-0.099,0.144-0.099,0.144 c-0.104,0.172-0.22,0.458-0.338,0.813c-0.118,0.599-0.177,1.219-0.167,1.854C7.541,28.374,10.936,32.078,15.369,32.857z" fill-opacity="0.05" stroke-opacity="0.05"/>
-<path d="M15.108,32.234c-0.423-1.033-0.749-1.953-0.919-2.561l-6.125-8.627c-0.069,0.101-0.109,0.161-0.109,0.161 c-0.097,0.162-0.208,0.434-0.318,0.769c-0.111,0.567-0.168,1.151-0.159,1.751C7.536,28.033,10.834,31.572,15.108,32.234z" fill-opacity="0.05" stroke-opacity="0.05"/>
-<path d="M7.907,21.188c-0.088,0.148-0.188,0.394-0.289,0.698c-0.102,0.514-0.152,1.046-0.144,1.59 c0.054,4.01,3.21,7.283,7.24,7.757c-0.232-0.618-0.412-1.157-0.526-1.559l-6.154-8.67C7.951,21.121,7.907,21.188,7.907,21.188z" fill-opacity="0.1" stroke-opacity="0.1"/>
-<radialGradient cx="-891.105" cy="-262.4795" gradientTransform="matrix(1.0009 -0.0086 0.0135 0.9911 906.6143 271.6763)" gradientUnits="userSpaceOnUse" id="SVGID_11_" r="11.8382">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.0424" style="stop-color:#FFBE82"/>
-<stop offset="0.4" style="stop-color:#FFBE82"/>
-<stop offset="0.7333" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#FFBE82"/>
-</radialGradient>
-<path d="M14.188,29.674l1.312-0.461c0,0-2.781-12.441-3.885-11.868c-0.555,0.29-0.549,0.448-1.11,0.853 c-1.676,1.219-2.589,2.641-2.589,2.641c-0.077,0.13-0.165,0.345-0.252,0.613c-0.088,0.45-0.134,0.916-0.128,1.392 c0.05,3.62,2.979,6.563,6.661,6.841C14.194,29.681,14.189,29.677,14.188,29.674z" fill="url(#SVGID_11_)"/>
-<path d="M23.289,45.25c-0.259,0.727-0.4,1.498-0.39,2.303c0.025,1.906,0.882,3.621,2.242,4.898 c1.716,0.641,3.287,0.871,3.9,0.84c0,0,0.833-0.098,1.97-0.496c0.409-0.143-5.222-6.213-7.055-8.172L23.289,45.25z" fill-opacity="0.05" stroke-opacity="0.05"/>
-<path d="M23.448,44.59c-0.261,0.725-0.401,1.496-0.391,2.301c0.036,2.613,1.621,4.875,3.95,6.125 c0.771,0.18,1.418,0.264,1.829,0.275c0.011,0,0.026,0.002,0.037,0c0,0,0.832-0.096,1.972-0.494c0.422-0.148-5.624-6.641-7.233-8.363 L23.448,44.59z" fill-opacity="0.1" stroke-opacity="0.1"/>
-<radialGradient cx="-877.4263" cy="-238.3691" gradientTransform="matrix(1.0009 -0.0086 0.0135 0.9911 906.6143 271.6763)" gradientUnits="userSpaceOnUse" id="SVGID_12_" r="12.0474">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.0424" style="stop-color:#FFBE82"/>
-<stop offset="0.4" style="stop-color:#FFBE82"/>
-<stop offset="0.7333" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#FFBE82"/>
-</radialGradient>
-<path d="M32.6,52.1c0.653-0.35,0.819-0.34,1.351-0.74c0.98-0.74-8.83-9.123-8.83-9.123l-1.712,1.756 c-0.229,0.695-0.355,1.434-0.345,2.203c0.051,3.766,3.219,6.797,7.107,6.857C30.828,52.877,31.693,52.584,32.6,52.1z" fill="url(#SVGID_12_)"/>
-<path d="M14.866,29.428l0.634-0.215c0,0-2.781-12.441-3.885-11.868 c-0.291,0.151-0.427,0.268-0.573,0.401L14.866,29.428z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
-<linearGradient gradientTransform="matrix(0.9999 -0.0111 0.0111 0.9999 905.1068 277.0361)" gradientUnits="userSpaceOnUse" id="SVGID_13_" x1="-889.625" x2="-885.2537" y1="-270.9771" y2="-257.0911">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.0424" style="stop-color:#FFBE82"/>
-<stop offset="0.4" style="stop-color:#FFBE82"/>
-<stop offset="0.7333" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#FFBE82"/>
-</linearGradient>
-<path d="M15.5,29.214l1.677-0.583c0.435-0.147,0.659-0.629,0.562-1.119l-1.129-3.446l-2.275-6.79 c-0.177-0.533-0.71-0.836-1.188-0.676c0,0-0.429,0.175-1.529,0.747L15.5,29.214z" fill="url(#SVGID_13_)"/>
-<path d="M25.121,42.236l-0.468,0.473l8.748,9.039c0.188-0.131,0.379-0.26,0.55-0.389 C34.931,50.619,25.121,42.236,25.121,42.236z" fill="#020202" fill-opacity="0.1" stroke-opacity="0.1"/>
-<linearGradient gradientTransform="matrix(0.9999 -0.0111 0.0111 0.9999 905.1068 277.0366)" gradientUnits="userSpaceOnUse" id="SVGID_14_" x1="-876.2178" x2="-867.1104" y1="-245.4277" y2="-235.398">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="0.0424" style="stop-color:#FFBE82"/>
-<stop offset="0.4" style="stop-color:#FFBE82"/>
-<stop offset="0.7333" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#FFBE82"/>
-</linearGradient>
-<path d="M33.95,51.357c0.978-0.738,1.295-1.059,1.295-1.059c0.364-0.373,0.338-1.002-0.059-1.412 l-7.534-7.756c-0.397-0.412-1.016-0.451-1.38-0.08l-1.151,1.186L33.95,51.357z" fill="url(#SVGID_14_)"/>
-</g>
-<g>
-<rect fill="none" height="30" width="30"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1__" x1="15.0005" x2="15.0005" y1="4.5283" y2="27.0492">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#991B23"/>
-</linearGradient>
-<path d="M19.018,16.846v-4.316h4.535l-8.512-8.844l-8.592,8.844h4.631v4.316 c0,7.293,6.068,9.467,11.908,9.467v-6.422C21.189,19.891,19.018,19.002,19.018,16.846z" fill="url(#SVGID_1__)"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2__" x1="15.0005" x2="15.0005" y1="4.0146" y2="12.8168">
-<stop offset="0" style="stop-color:#FFBE82"/>
-<stop offset="1" style="stop-color:#991B23"/>
-</linearGradient>
-<polygon fill="url(#SVGID_2__)" points="15.041,4.508 22.762,12.529 23.553,12.529 15.041,3.686 6.449,12.529 7.248,12.529 "/>
-</g>
-</svg>
--- a/logsui/logsengine/tsrc/stubs/logscntfinder.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/tsrc/stubs/logscntfinder.h Thu Jul 22 16:33:49 2010 +0100
@@ -35,7 +35,7 @@
inline LogsCntText() : mHighlights(0){}
inline const QString& text() const {return mText;}
- inline int highlights() const {return mHighlights;}
+ int highlights() const;
QString richText( QString startTag = QString("<b><u>"),
QString endTag = QString("</u></b>")) const;
@@ -48,6 +48,7 @@
friend class LogsCntEntry;
friend class UT_LogsCntEntry;
friend class UT_LogsCntFinder;
+ friend class UT_LogsMatchesModel;
};
typedef QList<LogsCntText> LogsCntTextList;
@@ -100,6 +101,7 @@
friend class UT_LogsCntEntry;
friend class UT_LogsCntFinder;
+ friend class UT_LogsMatchesModel;
};
typedef QList<LogsCntEntry*> LogsCntEntryList;
--- a/logsui/logsengine/tsrc/stubs/logscntfinder_stub.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/tsrc/stubs/logscntfinder_stub.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -24,6 +24,8 @@
#include <QContactName.h>
#include <QContactPhoneNumber.h>
+QString testHighlights;
+
// -----------------------------------------------------------------------------
// LogsCntEntry::richText()
// -----------------------------------------------------------------------------
@@ -42,6 +44,15 @@
}
// -----------------------------------------------------------------------------
+// LogsCntEntry::highlights()
+// -----------------------------------------------------------------------------
+//
+int LogsCntText::highlights() const
+{
+ return testHighlights.length() ;
+}
+
+// -----------------------------------------------------------------------------
// LogsCntEntry::LogsCntEntry()
// -----------------------------------------------------------------------------
//
@@ -204,6 +215,7 @@
//
void LogsCntEntry::setHighlights( const QString& pattern )
{
+ testHighlights = pattern;
}
// -----------------------------------------------------------------------------
--- a/logsui/logsengine/tsrc/stubs/qthighway_stub.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/tsrc/stubs/qthighway_stub.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -106,3 +106,9 @@
{
return qtHighwayStubRequestBg;
}
+
+
+void XQRequestInfo::setForeground(bool on)
+{
+ Q_UNUSED(on)
+}
--- a/logsui/logsengine/tsrc/symbianos_stub/logseventparser_stub.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/tsrc/symbianos_stub/logseventparser_stub.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -44,8 +44,9 @@
// LogsEventParser::resolveEventType
// ----------------------------------------------------------------------------
//
-void LogsEventParser::resolveEventType(LogsEvent& /*dest*/)
+bool LogsEventParser::resolveEventType(LogsEvent& /*dest*/)
{
+ return false;
}
// End of file
--- a/logsui/logsengine/tsrc/ut_logsengine/inc/ut_logsevent.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/tsrc/ut_logsengine/inc/ut_logsevent.h Thu Jul 22 16:33:49 2010 +0100
@@ -54,6 +54,7 @@
void testSetContactLocalId();
void testUpdateRemotePartyFromContacts();
void testParseContactName();
+ void testSerialization();
private:
--- a/logsui/logsengine/tsrc/ut_logsengine/inc/ut_logseventdata.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/tsrc/ut_logsengine/inc/ut_logseventdata.h Thu Jul 22 16:33:49 2010 +0100
@@ -49,6 +49,7 @@
void testSetters();
void testGetters();
void testIsCsCompatible();
+ void testSerialization();
private:
--- a/logsui/logsengine/tsrc/ut_logsengine/inc/ut_logsmatchesmodel.h Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/tsrc/ut_logsengine/inc/ut_logsmatchesmodel.h Thu Jul 22 16:33:49 2010 +0100
@@ -52,6 +52,7 @@
void testDataAdded();
void testDataUpdated();
void testDataRemoved();
+ void testDataResetted();
void testLogsMatches();
void testCreateContactWithNumber();
void testCreateCall();
--- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logscall.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logscall.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -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() );
}
--- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsevent.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsevent.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -172,15 +172,115 @@
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()
+{
+ // Serialize/deserialize, no event data
+ LogsEvent event;
+ event.mLogId = 3;
+ event.mDirection = LogsEvent::DirMissed;
+ event.mEventType = LogsEvent::TypeVideoCall;
+ event.mUid = 222222;
+ event.mLogsEventData = 0;
+ event.mRemoteParty = "remotePart";
+ event.mNumber = "33333";
+ event.mDuplicates = 2;
+ event.mRingDuration = 3;
+ event.mIsRead = true;
+ event.mIsALS = false;
+ event.mDuration = 30;
+ event.mIndex = 3;
+ event.mIsInView = true;
+ event.mEventState = LogsEvent::EventAdded;
+ event.mIsLocallySeen = true;
+ event.mIsPrivate = false;
+ event.mIsUnknown = false;
+
+ QByteArray serializedEvent;
+ QDataStream stream(&serializedEvent, QIODevice::WriteOnly | QIODevice::Append);
+ event.serialize(stream);
+
+ QDataStream readStream(&serializedEvent, QIODevice::ReadOnly);
+
+ LogsEvent deserializedEvent(readStream);
+ QVERIFY( deserializedEvent.mLogId == 3 );
+ QVERIFY( deserializedEvent.mDirection == LogsEvent::DirMissed );
+ QVERIFY( deserializedEvent.mEventType == LogsEvent::TypeVideoCall );
+ QVERIFY( deserializedEvent.mUid == 222222 );
+ QVERIFY( deserializedEvent.mLogsEventData == 0 );
+ QVERIFY( deserializedEvent.mRemoteParty == "remotePart" );
+ QVERIFY( deserializedEvent.mNumber == "33333" );
+ QVERIFY( deserializedEvent.mDuplicates == 2 );
+ QVERIFY( deserializedEvent.mRingDuration == 3 );
+ QVERIFY( deserializedEvent.mIsRead == true );
+ QVERIFY( deserializedEvent.mIsALS == false );
+ QVERIFY( deserializedEvent.mDuration == 30 );
+ QVERIFY( deserializedEvent.mIndex == 3 );
+ QVERIFY( deserializedEvent.mIsInView == true );
+ QVERIFY( deserializedEvent.mEventState == LogsEvent::EventAdded );
+ QVERIFY( deserializedEvent.mIsLocallySeen == true );
+ QVERIFY( deserializedEvent.mIsPrivate == false );
+ QVERIFY( deserializedEvent.mIsUnknown == false );
+
+ // Serialize/deserialize, event data exists
+ event.mLogsEventData = new LogsEventData();
+
+ QByteArray serializedEvent2;
+ QDataStream stream2(&serializedEvent2, QIODevice::WriteOnly | QIODevice::Append);
+ event.serialize(stream2);
+ QDataStream readStream2(&serializedEvent2, QIODevice::ReadOnly);
+ LogsEvent deserializedEvent2(readStream2);
+ QVERIFY( deserializedEvent2.mLogId == 3 );
+ QVERIFY( deserializedEvent2.mDirection == LogsEvent::DirMissed );
+ QVERIFY( deserializedEvent2.mEventType == LogsEvent::TypeVideoCall );
+ QVERIFY( deserializedEvent2.mUid == 222222 );
+ QVERIFY( deserializedEvent2.mLogsEventData != 0 );
+ QVERIFY( deserializedEvent2.mRemoteParty == "remotePart" );
+ QVERIFY( deserializedEvent2.mNumber == "33333" );
+ QVERIFY( deserializedEvent2.mDuplicates == 2 );
+ QVERIFY( deserializedEvent2.mRingDuration == 3 );
+ QVERIFY( deserializedEvent2.mIsRead == true );
+ QVERIFY( deserializedEvent2.mIsALS == false );
+ QVERIFY( deserializedEvent2.mDuration == 30 );
+ QVERIFY( deserializedEvent2.mIndex == 3 );
+ QVERIFY( deserializedEvent2.mIsInView == true );
+ QVERIFY( deserializedEvent2.mEventState == LogsEvent::EventAdded );
+ QVERIFY( deserializedEvent2.mIsLocallySeen == true );
+ QVERIFY( deserializedEvent2.mIsPrivate == false );
+ QVERIFY( deserializedEvent2.mIsUnknown == false );
+
+ // Incorrect stream
+ QByteArray serializedEvent3;
+ QDataStream stream3(&serializedEvent3, QIODevice::ReadWrite | QIODevice::Append);
+ LogsEvent deserializedEvent3(stream3);
+ QVERIFY( deserializedEvent3.mLogId == 0 );
+ QVERIFY( deserializedEvent3.mDirection == LogsEvent::DirIn );
+ QVERIFY( deserializedEvent3.mEventType == LogsEvent::TypeVoiceCall );
+ QVERIFY( deserializedEvent3.mUid == 0 );
+ QVERIFY( deserializedEvent3.mLogsEventData == 0 );
+ QVERIFY( deserializedEvent3.mRemoteParty == "" );
+ QVERIFY( deserializedEvent3.mNumber == "" );
+ QVERIFY( deserializedEvent3.mDuplicates == 0 );
+ QVERIFY( deserializedEvent3.mRingDuration == 0 );
+ QVERIFY( deserializedEvent3.mIsRead == false );
+ QVERIFY( deserializedEvent3.mIsALS == false );
+ QVERIFY( deserializedEvent3.mDuration == 0 );
+ QVERIFY( deserializedEvent3.mIndex == 0 );
+ QVERIFY( deserializedEvent3.mIsInView == false );
+ QVERIFY( deserializedEvent3.mEventState == LogsEvent::EventAdded );
+ QVERIFY( deserializedEvent3.mIsLocallySeen == false );
+ QVERIFY( deserializedEvent3.mIsPrivate == false );
+ QVERIFY( deserializedEvent3.mIsUnknown == false );
+}
+
--- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logseventdata.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logseventdata.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -97,3 +97,8 @@
mEventData->mRemoteUrl = "test@1.2.3.4";
QVERIFY( !mEventData->isCsCompatible() );
}
+
+void UT_LogsEventData::testSerialization()
+{
+
+}
--- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsmatchesmodel.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsmatchesmodel.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -331,6 +331,55 @@
//
// -----------------------------------------------------------------------------
//
+void UT_LogsMatchesModel::testDataResetted()
+{
+ // Have few events and then get reset where one event is removed and
+ // one new event is added
+ //
+ LogsEvent* event = new LogsEvent();
+ QString event1Name("event1");
+ event->setRemoteParty(event1Name);
+ LogsEvent* event2 = new LogsEvent();
+ QString event2Name("event2");
+ event2->setRemoteParty(event2Name);
+ LogsEvent* event3 = new LogsEvent();
+ QString event3Name("event3");
+ event3->setRemoteParty(event3Name);
+ mModel->mEvents.append(event);
+ mModel->mEvents.append(event2);
+ mModel->mEvents.append(event3);
+ mMatchesModel->eventsAdded(QModelIndex(), 0, 2);
+ QCOMPARE( mMatchesModel->mSearchEvents.count(), 3 );
+ QCOMPARE( mMatchesModel->mLogsCntFinder->mHistoryEvents.count(), 3 );
+ QCOMPARE( mMatchesModel->mLogsCntFinder->mHistoryEvents.at(0)->firstName().at(0).text(), event1Name );
+ QCOMPARE( mMatchesModel->mLogsCntFinder->mHistoryEvents.at(1)->firstName().at(0).text(), event2Name );
+ QCOMPARE( mMatchesModel->mLogsCntFinder->mHistoryEvents.at(2)->firstName().at(0).text(), event3Name );
+
+ mModel->mEvents.clear();
+
+ LogsEvent* event4 = new LogsEvent();
+ QString event4Name("event4");
+ event4->setRemoteParty(event4Name);
+ mModel->mEvents.append(event4);
+
+ mModel->mEvents.append(event);
+ mModel->mEvents.append(event3);
+
+ QSignalSpy spy(mMatchesModel, SIGNAL(modelReset()));
+ mMatchesModel->eventsResetted();
+ QCOMPARE( mMatchesModel->mSearchEvents.count(), 3 );
+ QCOMPARE( mMatchesModel->mLogsCntFinder->mHistoryEvents.count(), 3 );
+ QCOMPARE( mMatchesModel->mLogsCntFinder->mHistoryEvents.at(0)->firstName().at(0).text(), event4Name );
+ QCOMPARE( mMatchesModel->mLogsCntFinder->mHistoryEvents.at(1)->firstName().at(0).text(), event1Name );
+ QCOMPARE( mMatchesModel->mLogsCntFinder->mHistoryEvents.at(2)->firstName().at(0).text(), event3Name );
+ QCOMPARE( spy.count(), 1 );
+ delete event2;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
void UT_LogsMatchesModel::testLogsMatches()
{
QVERIFY( mMatchesModel->mLogsCntFinder );
@@ -487,9 +536,12 @@
// With contact, messaging supported
LogsMatchesModelItemContainer item3(*mModel, *mMatchesModel->mIconManager, 2);
item3.setContact(2);
+ item3.mContactName = "<b>so</b>mename";
+ item3.mContactNameSimple = "somename";
var = mMatchesModel->createMessage(item3);
message = qVariantValue<LogsMessage *>( var );
QVERIFY( message );
+ QVERIFY( message->mDisplayName == "somename" );
delete message;
}
@@ -605,22 +657,26 @@
void UT_LogsMatchesModel::testGetFormattedContactInfo()
{
QString name;
+ QString nameSimple;
QString number;
QVERIFY( mMatchesModel->mIconManager );
// Entry is not initialized, name and number are empty
LogsCntEntry entry(0);
LogsMatchesModelItemContainer item(*mModel, *mMatchesModel->mIconManager, 0);
- item.getFormattedContactInfo(entry, name, number);
- QVERIFY( name.length() == 0 && number.length() == 0 );
+ item.getFormattedContactInfo(entry, name, nameSimple, number);
+ QVERIFY( name.length() == 0 && nameSimple.length() == 0 && number.length() == 0 );
// Entry is initialized, name and number are not empty
entry.setFirstName("long firstname");
entry.setLastName("long lastname");
entry.setPhoneNumber("number");
- item.getFormattedContactInfo(entry, name, number);
- QVERIFY( name == "long firstname long lastname" );
- QVERIFY( number == "number" );
+ entry.setHighlights("lo");
+ item.getFormattedContactInfo(entry, name, nameSimple, number);
+ QCOMPARE( nameSimple, QString("long firstname long lastname") );
+ QVERIFY( nameSimple.length() < name.length() );
+ QCOMPARE( number, QString("number") );
+ entry.setHighlights("");
}
// -----------------------------------------------------------------------------
--- a/logsui/logsservices/src/logsservices.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/logsservices/src/logsservices.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -19,10 +19,11 @@
#include <logsservices.h>
#include "logslogger.h"
-// --------------------------------------------------------------------------
-// LogsServices::start
-// --------------------------------------------------------------------------
-//
+/*!
+ \deprecated LogsServices::start(LogsView activatedView, bool showDialpad, const QString& number)
+ is deprecated. Use XQApplicationManager and
+ "com.nokia.symbian.ILogsView" interface instead
+*/
int LogsServices::start(LogsView activatedView, bool showDialpad, const QString& number)
{
LOGS_QDEBUG_2( "LogsServices::start ->", activatedView )
--- a/logsui/rom/logsresources.iby Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/rom/logsresources.iby Thu Jul 22 16:33:49 2010 +0100
@@ -23,4 +23,5 @@
data=DATAZ_\resource\apps\logs.rsc \resource\apps\logs.rsc
data=DATAZ_\QT_TRANSLATIONS_DIR\dialer.qm QT_TRANSLATIONS_DIR\dialer.qm
+
#endif
--- a/logsui/tsrc/logdbmodifier/addeventtest/install/clientlogstest.pkg Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/tsrc/logdbmodifier/addeventtest/install/clientlogstest.pkg Thu Jul 22 16:33:49 2010 +0100
@@ -37,7 +37,7 @@
;
; Three files to install
;
-"\epoc32\release\armv5\udeb\logclienttest.exe" -"!:\sys\bin\logclienttest.exe"
+"\epoc32\release\armv5\urel\logclienttest.exe" -"!:\sys\bin\logclienttest.exe"
"\epoc32\winscw\c\system\testlogclients.dat" -"!:\system\testlogclients.dat"
--- a/logsui/tsrc/logsservicestester/install/logsservicestester.pkg Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/tsrc/logsservicestester/install/logsservicestester.pkg Thu Jul 22 16:33:49 2010 +0100
@@ -37,6 +37,6 @@
;
; Three files to install
;
-"\epoc32\release\armv5\udeb\logsservicestester.exe" - "!:\sys\bin\logsservicestester.exe"
+"\epoc32\release\armv5\urel\logsservicestester.exe" - "!:\sys\bin\logsservicestester.exe"
"\epoc32\data\z\resource\apps\logsservicestester.rsc" - "!:\resource\apps\logsservicestester.rsc"
"\epoc32\data\z\private\10003a3f\import\apps\logsservicestester_reg.rsc" - "!:\private\10003a3f\import\apps\logsservicestester_reg.rsc"
--- a/logsui/tsrc/logsservicestester/logsservicestester.pro Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/tsrc/logsservicestester/logsservicestester.pro Thu Jul 22 16:33:49 2010 +0100
@@ -19,16 +19,22 @@
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
+INCLUDEPATH += ..\..\logsapp\inc
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
CONFIG += hb
# Input
+HEADERS += logsservicetesterwidget.h
+HEADERS += logsservicetesterappcloser.h
+
SOURCES += main.cpp
+SOURCES += logsservicetesterwidget.cpp
+SOURCES += logsservicetesterappcloser.cpp
symbian: {
TARGET.UID2 = 0x100039CE
TARGET.UID3 = 0xEC209DCF
- TARGET.CAPABILITY = CAP_APPLICATION AllFiles
- LIBS += -llogsservices
+ TARGET.CAPABILITY = CAP_APPLICATION PowerMgmt
+ LIBS += -llogsservices -lxqservice
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/tsrc/logsservicestester/logsservicetesterappcloser.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,183 @@
+/*
+* 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 <QDebug>
+#include "logsservicetesterappcloser.h"
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+LogsServiceTesterAppCloser::LogsServiceTesterAppCloser(QObject* parent) :
+ QObject(parent)
+{
+ mAppCloseWatch = new CAppCloseWatcher(*this);
+ connect(&mTimer, SIGNAL(timeout()), this, SLOT(closeAppTimeout()));
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+LogsServiceTesterAppCloser::~LogsServiceTesterAppCloser()
+{
+ delete mAppCloseWatch;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsServiceTesterAppCloser::AppClosed(TInt aError)
+{
+ mTimer.stop();
+ if (aError == KErrNone) {
+ emit closed();
+ } else {
+ emit closeError(aError);
+ }
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsServiceTesterAppCloser::closeAppTimeout()
+{
+ mAppCloseWatch->Cancel();
+ emit closeError(ErrorClosingTimeout);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsServiceTesterAppCloser::closeApp(TApaTask& aTask)
+{
+ if ( !mAppCloseWatch->IsActive() ) {
+ mTimer.start(3000); //3 sec.
+ mTimer.setSingleShot(true);
+ mAppCloseWatch->Start(aTask);
+ aTask.EndTask();
+ } else {
+ emit closeError(ErrorClosingOngoing);
+ }
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsServiceTesterAppCloser::closeDialerApp()
+{
+ qDebug() << "[LOGS_TESTER] -> LogsServiceTesterAppCloser::closeDialerApp()";
+ const TUid KUidDialer = { 0x101F4CD5 };
+ RWsSession ws;
+ TInt err = ws.Connect();
+ if (err == KErrNone) {
+ TApaTaskList tl( ws);
+ TApaTask dialerTask = (TApaTask)tl.FindApp( KUidDialer );
+ if (dialerTask.Exists()) {
+ qDebug() << "[LOGS_TESTER] dialer is running, killing";
+ closeApp(dialerTask);
+ } else {
+ qDebug() << "[LOGS_TESTER] dialer is not running";
+ emit closeError(ErrorAppNotRunning);
+ }
+ ws.Close();
+ } else {
+ emit closeError(err);
+ }
+ qDebug() << "[LOGS_TESTER] <- LogsServiceTesterAppCloser::closeDialerApp()";
+}
+
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CAppCloseWatcher::CAppCloseWatcher(MCloseOberver& aObserver) :
+ CActive(CActive::EPriorityStandard), iObserver(aObserver)
+ {
+ CActiveScheduler::Add(this);
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CAppCloseWatcher::~CAppCloseWatcher()
+ {
+ Cancel();
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CAppCloseWatcher::Start(const TApaTask& aTask)
+ {
+ qDebug() << "[LOGS_TESTER] -> CAppCloseWatcher::Start()!";
+ if (!IsActive())
+ {
+ TInt err = iThread.Open(aTask.ThreadId());
+ if (err == KErrNone)
+ {
+ qDebug() << "[LOGS_TESTER] calling iThread.Logon(iStatus)";
+ iOriginalProcessPriority = iThread.ProcessPriority();
+ iThread.SetProcessPriority(EPriorityForeground);
+ iThread.Logon(iStatus);
+ SetActive();
+ }
+ else
+ {
+ qDebug() << "[LOGS_TESTER] calling iThread.Open() failed: "<< err;
+ TRequestStatus* s = &iStatus;
+ User::RequestComplete(s, err);
+ SetActive();
+ }
+ }
+ qDebug() << "[LOGS_TESTER] <- CAppCloseWatcher::Start()";
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CAppCloseWatcher::DoCancel()
+ {
+ qDebug() << "[LOGS_TESTER] -> CAppCloseWatcher::DoCancel()";
+ iThread.LogonCancel(iStatus);
+ iThread.SetProcessPriority(iOriginalProcessPriority);
+ iThread.Close();
+ qDebug() << "[LOGS_TESTER] -> CAppCloseWatcher::DoCancel()";
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CAppCloseWatcher::RunL()
+ {
+ qDebug() << "[LOGS_TESTER] -> CAppCloseWatcher::RunL()";
+ if (iThread.Handle())
+ iThread.SetProcessPriority(iOriginalProcessPriority);
+ iThread.Close();
+ iObserver.AppClosed(iStatus.Int());
+ qDebug() << "[LOGS_TESTER] <- CAppCloseWatcher::RunL()";
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/tsrc/logsservicestester/logsservicetesterappcloser.h Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,110 @@
+/*
+* 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 LOGSSERVICETESTERAPPCLOSER_H
+#define LOGSSERVICETESTERAPPCLOSER_H
+
+#include <e32base.h>
+#include <apgtask.h>
+#include <QTimer>
+
+
+class CAppCloseWatcher;
+
+/**
+ *
+ */
+class MCloseOberver
+{
+public:
+ virtual void AppClosed(TInt aError) = 0;
+};
+
+
+/**
+ *
+ */
+class LogsServiceTesterAppCloser : public QObject, public MCloseOberver
+{
+ Q_OBJECT
+public:
+
+ explicit LogsServiceTesterAppCloser(QObject *parent=0);
+ ~LogsServiceTesterAppCloser();
+
+ enum AppCloserErrors {
+ ErrorAppNotRunning = 1,
+ ErrorClosingOngoing,
+ ErrorClosingTimeout
+ };
+
+public slots:
+
+ void closeApp(TApaTask& aTask);
+ void closeDialerApp();
+
+signals:
+
+ void closed();
+ void closeError(int error);
+
+private slots:
+
+ void closeAppTimeout();
+
+private:
+
+ // from MCloseOberver
+ virtual void AppClosed(TInt aError);
+
+private:
+ QTimer mTimer;
+ CAppCloseWatcher* mAppCloseWatch;
+};
+
+
+/**
+ *
+ */
+class CAppCloseWatcher : public CActive
+ {
+public:
+
+ CAppCloseWatcher(MCloseOberver& aObserver);
+ ~CAppCloseWatcher();
+
+ // Start watching application death
+ void Start(const TApaTask& aTask);
+
+private:
+
+ void DoCancel();
+ void RunL();
+
+private: //data
+
+ //A handle to the main thread of the application to be closed.
+ RThread iThread;
+
+ //A backup of the orginal priority of the application's process
+ TProcessPriority iOriginalProcessPriority;
+
+ MCloseOberver& iObserver;
+ };
+
+#endif // LOGSSERVICETESTERAPPCLOSER_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/tsrc/logsservicestester/logsservicetesterwidget.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,187 @@
+/*
+* 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 <QGraphicsLinearLayout>
+#include <QScopedPointer>
+#include <QDebug>
+
+#include <hbmessagebox.h>
+#include <hblabel.h>
+#include <hbpushbutton.h>
+#include <hblineedit.h>
+#include <hbcombobox.h>
+#include <hbcheckbox.h>
+#include <xqappmgr.h>
+#include <xqaiwrequest.h>
+#include <logsservices.h>
+
+#include "logsservicetesterwidget.h"
+#include "logsservicetesterappcloser.h"
+#include "logsdefs.h"
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+LogsServiceTesterWidget::LogsServiceTesterWidget(QGraphicsItem *parent ) :
+ HbWidget(parent),
+ mViewIndex(0),
+ mShowDialpad(false),
+ mDialpadText(QString())
+{
+ qDebug() << "[LOGS_TESTER]-> LogsServiceTesterWidget::LogsServiceTesterWidget()";
+ mAppCloser = new LogsServiceTesterAppCloser(this);
+ connect(mAppCloser, SIGNAL(closed()), this, SLOT(dialerClosed()),
+ Qt::QueuedConnection);
+ connect(mAppCloser, SIGNAL(closeError(int)), this, SLOT(dialerCloseError(int)),
+ Qt::QueuedConnection);
+
+ HbLabel* comboLabel = new HbLabel("Select logs view:");
+
+ mComboBox = new HbComboBox();
+ mComboBox->addItem( "Recent view", QVariant(LogsServices::ViewAll));
+ mComboBox->addItem( "Received view", QVariant(LogsServices::ViewReceived));
+ mComboBox->addItem( "Called view", QVariant(LogsServices::ViewCalled));
+ mComboBox->addItem( "Missed view", QVariant(LogsServices::ViewMissed));
+
+ mCheckBox = new HbCheckBox("Show dialpad");
+
+ HbLabel* editorLabel = new HbLabel("Launch dialpad with number:");
+ mEditor = new HbLineEdit();
+ mEditor->setInputMethodHints(Qt::ImhPreferNumbers);
+
+ HbPushButton* newService = new HbPushButton("Start Dialer via new service name");
+ newService->setPreferredHeight(60);
+ connect(newService, SIGNAL(clicked()), this, SLOT(startNewService()));
+
+ HbPushButton* oldService = new HbPushButton("Start Dialer via old service name");
+ oldService->setPreferredHeight(60);
+ connect(oldService, SIGNAL(clicked()), this, SLOT(startOldService()));
+
+ HbPushButton* killDialer = new HbPushButton("Kill Dialer");
+ killDialer->setPreferredHeight(60);
+ connect(killDialer, SIGNAL(clicked()), mAppCloser, SLOT(closeDialerApp()));
+
+ QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
+ layout->addItem(comboLabel);
+ layout->addItem(mComboBox);
+ layout->addItem(mCheckBox);
+ layout->addItem(editorLabel);
+ layout->addItem(mEditor);
+ layout->addItem(newService);
+ layout->addItem(oldService);
+ layout->addItem(killDialer);
+ setLayout(layout);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+LogsServiceTesterWidget:: ~LogsServiceTesterWidget()
+{
+ qDebug() << "[LOGS_TESTER] <-> LogsServiceTesterWidget::~LogsServiceTesterWidget()";
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsServiceTesterWidget::fetchData()
+{
+ qDebug() << "[LOGS_TESTER] LogsServiceTesterWidget::fetchData()";
+ int index = mComboBox->currentIndex()>0 ? mComboBox->currentIndex() : 0;
+ mViewIndex = mComboBox->itemData(index).toInt();
+ qDebug() << "[LOGS_TESTER] viewIndex: " << mViewIndex;
+
+ mShowDialpad = (mCheckBox->checkState() == Qt::Checked) ? true : false;
+ qDebug() << "[LOGS_TESTER] showDialpad: " << mShowDialpad;
+
+ mDialpadText = mEditor->text();
+ qDebug() << "[LOGS_TESTER] dialpadText: " << mDialpadText;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsServiceTesterWidget::startNewService()
+{
+ qDebug() << "[LOGS_TESTER] -> LogsServiceTesterWidget::startNewService()";
+ fetchData();
+
+ XQApplicationManager appMgr;
+ QScopedPointer<XQAiwRequest> request(appMgr.create( QLatin1String(logsServiceName),
+ QLatin1String(logsInterfaceName),
+ QLatin1String(logsOperationName),
+ false));
+ if (!request.isNull()) {
+ int retValue = -1;
+ QList<QVariant> arglist;
+ QVariantMap map;
+ map.insert(logsViewIndexParam, QVariant(mViewIndex));
+ map.insert(logsShowDialpadParam, QVariant(mShowDialpad));
+ map.insert(logsDialpadTextParam, QVariant(mDialpadText));
+
+ arglist.append(QVariant(map));
+ request->setArguments(arglist);
+ QVariant ret(retValue);
+
+ request->send(ret);
+ }
+ qDebug() << "[LOGS_TESTER] <- LogsServiceTesterWidget::startNewService()";
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsServiceTesterWidget::startOldService()
+{
+ qDebug() << "[LOGS_TESTER] -> LogsServiceTesterWidget::startOldService()";
+ fetchData();
+ LogsServices::start( (LogsServices::LogsView)mViewIndex, mShowDialpad, mDialpadText );
+ qDebug() << "[LOGS_TESTER] <- LogsServiceTesterWidget::startOldService()";
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsServiceTesterWidget::dialerClosed()
+{
+ HbMessageBox::information("Dialer closed");
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsServiceTesterWidget::dialerCloseError(int error)
+{
+ QString errorMsg;
+ if (error == LogsServiceTesterAppCloser::ErrorAppNotRunning) {
+ errorMsg = QString("Dialer not running");
+ } else if (error == LogsServiceTesterAppCloser::ErrorClosingOngoing) {
+ errorMsg = QString("Dialer closing is already ongoing");
+ } else if (error == LogsServiceTesterAppCloser::ErrorClosingTimeout) {
+ errorMsg = QString("Dialer closing timeout");
+ } else {
+ errorMsg = QString("Dialer closing error: %1").arg(error);
+ }
+ HbMessageBox::warning(errorMsg);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/tsrc/logsservicestester/logsservicetesterwidget.h Thu Jul 22 16:33:49 2010 +0100
@@ -0,0 +1,62 @@
+/*
+* 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 LOGSSERVICETESTERWIDGET_H
+#define LOGSSERVICETESTERWIDGET_H
+
+#include <hbwidget.h>
+
+class HbComboBox;
+class HbCheckBox;
+class HbLineEdit;
+class LogsServiceTesterAppCloser;
+
+class LogsServiceTesterWidget : public HbWidget
+{
+ Q_OBJECT
+
+public:
+ LogsServiceTesterWidget(QGraphicsItem *parent=0);
+ ~LogsServiceTesterWidget();
+
+public slots:
+
+ void startOldService();
+ void startNewService();
+
+ void dialerClosed();
+ void dialerCloseError(int error);
+
+private:
+
+ void fetchData();
+
+private:
+ HbCheckBox* mCheckBox;
+ HbComboBox* mComboBox;
+ HbLineEdit* mEditor;
+
+ int mViewIndex;
+ bool mShowDialpad;
+ QString mDialpadText;
+
+ LogsServiceTesterAppCloser* mAppCloser;
+};
+
+
+#endif // LOGSSERVICETESTERWIDGET_H
+
--- a/logsui/tsrc/logsservicestester/main.cpp Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/tsrc/logsservicestester/main.cpp Thu Jul 22 16:33:49 2010 +0100
@@ -15,41 +15,19 @@
*
*/
-#include <QString>
-#include <QStringList>
-#include <QDebug>
#include <hbapplication.h>
#include <hbmainwindow.h>
-#include <logsservices.h>
+#include "logsservicetesterwidget.h"
int main(int argc, char *argv[])
{
- qDebug() << "LogsServicesTester entry";
- LogsServices::LogsView viewIndex = LogsServices::ViewAll;
- bool showDialpad = false;
- QString number;
- for ( int i = 0; i< argc; i++ ){
- qDebug() << "Arg" << ( i + 1 ) << argv[i];
- QString argStr( argv[i] );
- if ( argStr.length() == 1 ){
- viewIndex = (LogsServices::LogsView)argStr.toInt();
- }
- if ( argStr == QString("-dialpad") ){
- showDialpad = true;
- }
- if ( argStr == QString("-num") ){
- number = "223456677";
- }
- }
-
- HbApplication app(argc, argv);
- HbMainWindow mainWindow;
- mainWindow.show();
-
- qDebug() << "LogsServicesTester start logs";
- LogsServices::start( viewIndex, showDialpad, number );
-
- int ret = app.exec();
- qDebug() << "LogsServicesTester exit";
- return ret;
+ HbApplication app(argc, argv);
+ app.setApplicationName(QLatin1String("Logs service tester"));
+ HbMainWindow mainWindow;
+
+ LogsServiceTesterWidget* widget = new LogsServiceTesterWidget();
+ mainWindow.addView(widget);
+
+ mainWindow.show();
+ return app.exec();
}
--- a/logsui/tsrc/unittestrunner/unittest_qt_config.txt Fri Jun 11 16:24:14 2010 +0100
+++ b/logsui/tsrc/unittestrunner/unittest_qt_config.txt Thu Jul 22 16:33:49 2010 +0100
@@ -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
--- a/recents_plat/logs_engine_api/inc/logsevent.h Fri Jun 11 16:24:14 2010 +0100
+++ b/recents_plat/logs_engine_api/inc/logsevent.h Thu Jul 22 16:33:49 2010 +0100
@@ -27,6 +27,7 @@
class LogsEventData;
class LogsEventStrings;
class CLogEvent;
+class QDataStream;
QTM_BEGIN_NAMESPACE
class QContactName;
@@ -166,6 +167,16 @@
*/
LOGSENGINE_EXPORT bool isRead() const;
+ /**
+ * Construct event from serialized data stream
+ */
+ LOGSENGINE_EXPORT LogsEvent( QDataStream& serializedEvent );
+
+ /**
+ * Serialize event to data stream
+ */
+ LOGSENGINE_EXPORT bool serialize( QDataStream& serializeDestination );
+
public:
/**
@@ -288,7 +299,7 @@
void setEventUid( int uid );
- void setEventType( LogsEventType aEventType );
+ bool setEventType( LogsEventType aEventType );
void setLogsEventData( LogsEventData* logsEventData );
--- a/recents_plat/logs_engine_api/inc/logsmodel.h Fri Jun 11 16:24:14 2010 +0100
+++ b/recents_plat/logs_engine_api/inc/logsmodel.h Thu Jul 22 16:33:49 2010 +0100
@@ -25,6 +25,7 @@
class LogsDbConnector;
class LogsMatchesModel;
class LogsConfigurationParams;
+class LogsDetailsModel;
/**
* Model for log events.
@@ -112,6 +113,12 @@
* @return 0 if configured succesfully
*/
LOGSENGINE_EXPORT int updateConfiguration(LogsConfigurationParams& params);
+
+ /**
+ * Get details model.
+ * @return details model
+ */
+ LOGSENGINE_EXPORT LogsDetailsModel* logsDetailsModel(LogsEvent& event);
public: // From QAbstractItemModel
--- a/recents_plat/logs_services_api/inc/logsservices.h Fri Jun 11 16:24:14 2010 +0100
+++ b/recents_plat/logs_services_api/inc/logsservices.h Thu Jul 22 16:33:49 2010 +0100
@@ -22,11 +22,39 @@
/**
* Logs application services
+* @deprecated Use XQApplicationManager instead.
+* Service name: "logs",
+* Interface name: "com.nokia.symbian.ILogsView"
+* Operation signature: "show(QVariantMap)"
+* Operation parameters:
+* "view_index": int, 0 - all recent, 1 - received, 2 - called, 3 - missed
+* "show_dialpad": bool, if true view is shown with dialpad opened on top
+* "dialpad_text": QString, number to be prefilled into dialpad
+*
+* Example usage:
+* XQApplicationManager appMgr;
+* QScopedPointer<XQAiwRequest> request(appMgr.create(QString("logs"),
+* QString("com.nokia.symbian.ILogsView"),
+* QString("show(QVariantMap)"), false));
+* if (!request.isNull()) {
+* int retValue = -1;
+* QList<QVariant> arglist;
+* QVariantMap map;
+* map.insert("view_index", QVariant(0));
+* map.insert("show_dialpad", QVariant(true));
+* map.insert("dialpad_text", QVariant(QString()));
+* arglist.append(QVariant(map));
+* request->setArguments(arglist);
+* QVariant ret(retValue);
+* request->send(ret);
+* }
+*
*/
class LogsServices
{
public:
+ //Deprecated
enum LogsView{
ViewAll,
ViewReceived,
@@ -36,6 +64,9 @@
/**
* Requests to start Logs application. If Logs is already running,
* activates the requested view.
+ *
+ * @deprecated Use "com.nokia.symbian.ILogsView" interface
+ * and "show(int,bool,QString)" operation instead
*
* @param activatedView The view to be activated in Logs.
* @param showDialpad Specifies whether dialpad should be shown on top
@@ -48,4 +79,5 @@
};
+
#endif //LOGSSERVICES_H