--- a/layers.sysdef.xml Fri Sep 17 16:47:32 2010 +0300
+++ b/layers.sysdef.xml Fri Oct 15 14:47:48 2010 +0300
@@ -12,7 +12,7 @@
</module>
</layer>
- <layer name="unit_test_layer">
+ <layer name="qt_unit_test_layer">
<module name="recents_unit_test">
<unit unitID="recents_unit_test" name="recents_unit_test" bldFile="&layer_real_source_path;/tsrc" mrp="" proFile="tsrc.pro"/>
</module>
--- a/logsui/inc/logsexport.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/inc/logsexport.h Fri Oct 15 14:47:48 2010 +0300
@@ -27,13 +27,4 @@
#endif
#endif
-#if !defined(LOGSSERVICES_EXPORT)
-#if defined(LOGSSERVICES_LIB)
-#define LOGSSERVICES_EXPORT Q_DECL_EXPORT
-#else
-#define LOGSSERVICES_EXPORT Q_DECL_IMPORT
-#endif
-#endif
-
-
#endif // LOGSEXPORT_H
--- a/logsui/logsapp/inc/logsabstractviewmanager.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/inc/logsabstractviewmanager.h Fri Oct 15 14:47:48 2010 +0300
@@ -43,13 +43,13 @@
* @param args, custom arguments for view
* @return true if activated succesfully, otherwise false
*/
- virtual bool activateView(LogsAppViewId viewId, bool showDialer, QVariant args) = 0;
+ virtual bool activateView(LogsAppViewId viewId, bool showDialer, QVariant args, const QString& dialpadText = QString()) = 0;
/**
* Activate previous view.
* @return true if activated succesfully, otherwise false
*/
- virtual bool activatePreviousView() = 0;
+ virtual bool activatePreviousView(bool showDialpad, const QString& dialpadText) = 0;
/**
* Returns application main window
--- a/logsui/logsapp/inc/logsbaseview.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/inc/logsbaseview.h Fri Oct 15 14:47:48 2010 +0300
@@ -36,7 +36,9 @@
class HbListView;
class LogsAbstractModel;
class QDataStream;
-class HbActivityManager;
+class AfActivityStorage;
+class HbListWidget;
+class HbListWidgetItem;
/**
*
@@ -60,16 +62,17 @@
};
LogsAppViewId viewId() const;
- virtual void activated(bool showDialer, QVariant args);
+ virtual void activated(bool showDialer, QVariant args, const QString& dialpadText);
virtual void deactivated();
virtual bool isExitAllowed();
virtual void resetView();
- virtual void clearActivity(HbActivityManager& manager);
+ virtual void clearActivity(AfActivityStorage& manager);
virtual QString saveActivity(QDataStream& serializedActivity, QVariantHash& metaData);
virtual QVariant loadActivity(
const QString& activityId, QDataStream& serializedActivity, QVariantHash& metaData);
virtual bool matchWithActivityId(const QString& activityId);
virtual void cancelServiceRequest();
+ void initToolbarExtension();
public slots:
@@ -91,13 +94,12 @@
virtual void updateWidgetsSizeAndLayout();
virtual void contactActionCompleted(bool modified);
virtual void updateEmptyListLabelVisibility();
+ virtual void handleViewSwitchSelected(HbListWidgetItem* item);
//slots bellow are used in *.docml
- void showFilterMenu();
void openDialpad();
void openContactsApp();
void notSupported();
- void changeFilter(HbAction* action);
void addToContacts();
void saveNumberInDialpadToContacts();
@@ -117,6 +119,7 @@
void handleOrientationChanged();
+
protected:
explicit LogsBaseView( LogsAppViewId viewId,
@@ -124,8 +127,6 @@
LogsAbstractViewManager& viewManager );
void setDialpadPosition();
- void initFilterMenu();
- void addActionNamesToMap();
void updateCall(const QModelIndex& listIndex);
void updateMessage(const QModelIndex& listIndex);
@@ -198,6 +199,10 @@
void updateMenuVisibility();
void setMenuVisible(bool visible);
+ QString currDialpadText() const;
+
+ //Populates list and returns width of longest text item
+ qreal populateViewSwitchList(HbListWidget& list);
protected:
@@ -205,12 +210,9 @@
LogsComponentRepository& mRepository;
LogsAbstractViewManager& mViewManager;
- HbMenu* mShowFilterMenu; //not owned
Dialpad* mDialpad; //not owned
HbLabel* mEmptyListLabel; // not owned
- QMap<XQService::LogsViewIndex, QString> mActionMap;
-
bool mInitialized;
LogsCall* mCall; //owned
@@ -224,6 +226,9 @@
QStringList mActivities;
HbMenu* mOptionsMenu;
bool mActivating;
+ bool mShowDialpad;
+
+ HbListWidget* mViewSwitchList;
};
--- a/logsui/logsapp/inc/logsdefs.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/inc/logsdefs.h Fri Oct 15 14:47:48 2010 +0300
@@ -34,7 +34,6 @@
const char logsGroupboxViewNameId[] = "logs_groupbox_recent_calls";
const char logsGroupboxDetailViewNameId[] = "logs_groupbox_remote_party_info";
const char logsDetailsViewMenuId[] = "logs_details_view_menu";
-const char logsShowFilterMenuId[] = "logs_show_filter_menu";
const char logsLabelEmptyListId[] = "logs_label_empty_list";
const char logsToolbarId[] = "logs_toolbar";
const char logsButtonAddToContactsId[] = "logs_button_addtocontacts";
@@ -53,10 +52,7 @@
const char logsRecentViewClearListMenuActionId[] = "logs_act_clear_list";
const char logsRecentViewContactSearchMenuActionId[] = "logs_act_contact_search";
-const char logsShowFilterReceivedMenuActionId[] = "logs_act_received";
-const char logsShowFilterDialledMenuActionId[] = "logs_act_dialled";
-const char logsShowFilterMissedMenuActionId[] = "logs_act_missed";
-const char logsShowFilterRecentMenuActionId[] = "logs_act_recent";
+const char logsDialerActionId[] = "logs_act_dialer";
//list layout names from *.widgetml
--- a/logsui/logsapp/inc/logsdetailsview.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/inc/logsdetailsview.h Fri Oct 15 14:47:48 2010 +0300
@@ -44,7 +44,7 @@
public: // From LogsBaseView
- virtual void activated(bool showDialer, QVariant args);
+ virtual void activated(bool showDialer, QVariant args, const QString& dialpadText);
virtual void deactivated();
virtual QString saveActivity(QDataStream& serializedActivity, QVariantHash& metaData);
virtual QVariant loadActivity(
--- a/logsui/logsapp/inc/logseffecthandler.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/inc/logseffecthandler.h Fri Oct 15 14:47:48 2010 +0300
@@ -25,6 +25,7 @@
class QSequentialAnimationGroup;
class QAbstractAnimation;
class LogsEffectContainer;
+class HbMainWindow;
/**
*
@@ -36,7 +37,7 @@
friend class UT_LogsRecentCallsView;
public:
- explicit LogsEffectHandler();
+ explicit LogsEffectHandler(HbMainWindow& window);
~LogsEffectHandler();
void startDissappearAppearByFadingEffect(QObject& effectTarget);
@@ -76,6 +77,7 @@
private:
+ HbMainWindow& mWindow;
QPropertyAnimation* mItemAppearByFadingAnimation;
QPropertyAnimation* mItemDissappearByFadingAnimation;
QPropertyAnimation* mItemMoveNotPossibleAnimationStart;
--- a/logsui/logsapp/inc/logsmatchesview.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/inc/logsmatchesview.h Fri Oct 15 14:47:48 2010 +0300
@@ -41,7 +41,7 @@
public: // From LogsBaseView
- virtual void activated(bool showDialer, QVariant args);
+ virtual void activated(bool showDialer, QVariant args, const QString& dialpadText);
virtual void deactivated();
protected slots: //from LogsBaseView
--- a/logsui/logsapp/inc/logsrecentcallsview.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/inc/logsrecentcallsview.h Fri Oct 15 14:47:48 2010 +0300
@@ -50,7 +50,7 @@
public: // From LogsBaseView
- virtual void activated(bool showDialer, QVariant args);
+ virtual void activated(bool showDialer, QVariant args, const QString& dialpadText);
virtual void deactivated();
virtual bool isExitAllowed();
virtual QString saveActivity(QDataStream& serializedActivity, QVariantHash& metaData);
@@ -67,10 +67,10 @@
virtual void handleBackSoftkey();
void openDialpad();
virtual void dialpadEditorTextChanged();
- void changeFilter(HbAction* action);
virtual void updateEmptyListWidgetsVisibility();
virtual void updateWidgetsSizeAndLayout();
- virtual void updateEmptyListLabelVisibility();
+ virtual void updateEmptyListLabelVisibility();
+ virtual void handleViewSwitchSelected(HbListWidgetItem* item);
private slots:
@@ -100,7 +100,8 @@
void initListWidget();
void updateFilter(LogsFilter::FilterType type);
void updateViewName();
- void updateContextMenuItems(XQService::LogsViewIndex view);
+ void updateViewSwitchList(XQService::LogsViewIndex view);
+
LogsFilter::FilterType getFilter(XQService::LogsViewIndex view);
void changeView(XQService::LogsViewIndex view);
void updateMenu();
--- a/logsui/logsapp/inc/logsservicehandlerold.h Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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 LOGSSERVICEHANDLEROLD_H
-#define LOGSSERVICEHANDLEROLD_H
-
-#include <xqserviceprovider.h>
-#include <xqaiwdecl.h>
-
-class LogsServiceHandlerOld : public XQServiceProvider
- {
- Q_OBJECT
- public:
- explicit LogsServiceHandlerOld();
- ~LogsServiceHandlerOld();
-
- public slots:
- int start(int activatedView, bool showDialpad);
- int startWithNum(int activatedView, bool showDialpad, QString dialpadText);
-
- signals:
-
- void activateView(XQService::LogsViewIndex activatedView, bool showDialpad, QString dialpadText);
- void activateView(QString dialpadText);
-
- public:
-
- bool isStartedUsingService() const;
-
- private:
- bool mIsAppStartedUsingService;
-
- private:
- friend class UT_LogsServiceHandler;
- friend class UT_LogsViewManager;
- };
-
-#endif //LOGSSERVICEHANDLEROLD_H
--- a/logsui/logsapp/inc/logsviewmanager.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/inc/logsviewmanager.h Fri Oct 15 14:47:48 2010 +0300
@@ -22,6 +22,7 @@
#include <QList>
#include <QVariant>
#include <xqaiwdecl.h>
+#include <afactivities_global.h>
#include "logsabstractviewmanager.h"
class HbMainWindow;
@@ -33,6 +34,8 @@
class LogsBaseView;
class LogsAppSettings;
class LogsForegroundWatcher;
+class AfActivation;
+class AfActivityStorage;
/**
*
@@ -52,7 +55,7 @@
* @param service
*/
LogsViewManager( LogsMainWindow& mainWindow, LogsServiceHandler& service,
- LogsServiceHandlerOld& serviceOld, LogsAppSettings& settings );
+ LogsAppSettings& settings );
~LogsViewManager();
public slots:
@@ -65,8 +68,8 @@
public: // From LogsAbstractViewManager
virtual bool activateView(LogsAppViewId viewId);
- virtual bool activateView(LogsAppViewId viewId, bool showDialpad, QVariant args);
- virtual bool activatePreviousView();
+ virtual bool activateView(LogsAppViewId viewId, bool showDialpad, QVariant args, const QString& dialpadText = QString());
+ virtual bool activatePreviousView(bool showDialpad, const QString& dialpadText);
virtual HbMainWindow& mainWindow();
virtual void exitApplication();
@@ -80,7 +83,7 @@
void closeEmbeddedApplication();
void appGainedForeground();
void appLostForeground();
- void activityRequested(const QString &activityId);
+ void activityRequested(Af::ActivationReason reason, QString name, QVariantHash parameters);
void bgStartupForegroundGained();
private:
@@ -108,7 +111,6 @@
LogsMainWindow& mMainWindow;
LogsServiceHandler& mService;
- LogsServiceHandlerOld& mServiceOld;
LogsAppSettings& mSettings;
LogsComponentRepository* mComponentsRepository;
QList<LogsBaseView*> mViewStack;
@@ -116,7 +118,9 @@
QVariant mViewActivationArgs;
bool mViewActivationShowDialpad;
LogsForegroundWatcher* mBackgroundStartupWatcher;
-
+ QString mDialpadText;
+ AfActivityStorage* mActivityManager;
+ AfActivation* mActivation;
};
#endif //LOGVIEWMANAGER_H
--- a/logsui/logsapp/logsapp.pro Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/logsapp.pro Fri Oct 15 14:47:48 2010 +0300
@@ -40,7 +40,6 @@
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
@@ -58,7 +57,6 @@
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
@@ -68,9 +66,9 @@
symbian: {
TARGET.UID2 = 0x100039CE
TARGET.UID3 = 0x101F4CD5
- TARGET.CAPABILITY = CAP_APPLICATION NetworkControl
+ TARGET.CAPABILITY = CAP_APPLICATION NetworkControl TrustedUI
LIBS += -lxqservice -lxqserviceutil -llogsengine -ldialpad -lxqkeycapture -ltstaskmonitorclient \
- -lxqsettingsmanager -lapparc -lcone
+ -lxqsettingsmanager -lapparc -lcone -lafservice
SKINICON = qtg_large_dialer
MMP_RULES += SMPSAFE
}
--- a/logsui/logsapp/logsapp.qrc Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/logsapp.qrc Fri Oct 15 14:47:48 2010 +0300
@@ -7,11 +7,12 @@
<qresource prefix="/" >
<file alias="view_show.fxml">resources/logs_view_fade_in_scale.fxml</file>
<file alias="view_hide.fxml">resources/logs_view_fade_out.fxml</file>
- <file alias="hbgroupboxheadingwidget.css">resources/hbgroupboxheadingwidget.css</file>
</qresource>
<qresource prefix="/logslayouts" >
<file alias="hblistviewitem.css">resources/hblistviewitem.css</file>
<file alias="hblistviewitem.widgetml">resources/hblistviewitem.widgetml</file>
<file alias="hbgroupboxcontentwidget.css">resources/hbgroupboxcontentwidget.css</file>
+ <file alias="hbgroupboxheadingwidget.css">resources/hbgroupboxheadingwidget.css</file>
</qresource>
</RCC>
+
--- a/logsui/logsapp/resources/detailsView.docml Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/resources/detailsView.docml Fri Oct 15 14:47:48 2010 +0300
@@ -32,22 +32,6 @@
<icon iconName="qtg_mono_contacts" name="icon"/>
<string name="toolTip" value="Contacts"/>
</object>
- <object name="logs_act_show" type="HbAction">
- <icon iconName="qtg_mono_show_view" name="icon"/>
- <string name="toolTip" value="Show"/>
- </object>
- <object name="logs_act_recent" type="HbAction">
- <string locid="txt_dialer_ui_list_recent" name="text" value="Recent calls"/>
- </object>
- <object name="logs_act_received" type="HbAction">
- <string locid="txt_dialer_ui_list_received" name="text" value="Received calls"/>
- </object>
- <object name="logs_act_dialled" type="HbAction">
- <string locid="txt_dialer_ui_list_dialled" name="text" value="Dialled calls"/>
- </object>
- <object name="logs_act_missed" type="HbAction">
- <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="container" type="HbWidget">
@@ -75,9 +59,8 @@
</widget>
<widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
<enums name="orientation" value="Horizontal"/>
+ <ref object="logs_act_dialer" role="HbToolBar:addAction"/>
<ref object="logs_act_contacts" role="HbToolBar:addAction"/>
- <ref object="logs_act_dialer" role="HbToolBar:addAction"/>
- <ref object="logs_act_show" role="HbToolBar:addAction"/>
</widget>
<widget name="logs_details_view_menu" role="HbView:menu" type="HbMenu">
<ref object="logs_act_voice_call" role="HbMenu:addAction"/>
@@ -91,13 +74,6 @@
</widget>
<string locid="txt_dial_title_dialer" name="title" value="Dialer"/>
</widget>
- <!-- Context menu -->
- <widget name="logs_show_filter_menu" type="HbMenu">
- <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>
<connect receiver="logs_details_view" sender="logs_act_voice_call" signal="triggered(bool)" slot="initiateVoiceCall()"/>
<connect receiver="logs_details_view" sender="logs_act_video_call" signal="triggered(bool)" slot="initiateVideoCall()"/>
<connect receiver="logs_details_view" sender="logs_act_internet_call" signal="triggered(bool)" slot="notSupported()"/>
@@ -108,8 +84,6 @@
<connect receiver="logs_details_view" sender="logs_act_delete_event" signal="triggered(bool)" slot="deleteEvent()"/>
<connect receiver="logs_details_view" sender="logs_act_dialer" signal="triggered(bool)" slot="openDialpad()"/>
<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*)"/>
<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"/>
--- a/logsui/logsapp/resources/hbgroupboxheadingwidget.css Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/resources/hbgroupboxheadingwidget.css Fri Oct 15 14:47:48 2010 +0300
@@ -1,9 +1,5 @@
-HbGroupBoxHeadingWidget[groupBoxType="1"]::text
+HbGroupBox#logs_groupbox_recent_calls > 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 Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/resources/hblistviewitem.css Fri Oct 15 14:47:48 2010 +0300
@@ -29,3 +29,8 @@
text-height: 0.0un;
}
+HbListWidget#LogsViewSwitchList HbListViewItem::text-1{
+ text-height: var(hb-param-text-height-secondary);
+ font-variant: secondary;
+ color: var(qtc_popup_list_item_trans_normal);
+}
--- a/logsui/logsapp/resources/matchesView.docml Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/resources/matchesView.docml Fri Oct 15 14:47:48 2010 +0300
@@ -17,22 +17,6 @@
<icon iconName="qtg_mono_contacts" name="icon"/>
<string name="toolTip" value="Contacts"/>
</object>
- <object name="logs_act_show" type="HbAction">
- <icon iconName="qtg_mono_show_view" name="icon"/>
- <string name="toolTip" value="Show"/>
- </object>
- <object name="logs_act_recent" type="HbAction">
- <string locid="txt_dialer_ui_list_recent" name="text" value="Recent calls"/>
- </object>
- <object name="logs_act_received" type="HbAction">
- <string locid="txt_dialer_ui_list_received" name="text" value="Received calls"/>
- </object>
- <object name="logs_act_dialled" type="HbAction">
- <string locid="txt_dialer_ui_list_dialled" name="text" value="Dialled calls"/>
- </object>
- <object name="logs_act_missed" type="HbAction">
- <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_label_empty_list" type="HbLabel">
@@ -67,9 +51,8 @@
</widget>
<widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
<enums name="orientation" value="Horizontal"/>
+ <ref object="logs_act_dialer" role="HbToolBar:addAction"/>
<ref object="logs_act_contacts" role="HbToolBar:addAction"/>
- <ref object="logs_act_dialer" role="HbToolBar:addAction"/>
- <ref object="logs_act_show" role="HbToolBar:addAction"/>
</widget>
<widget name="logs_view_menu2" role="HbView:menu" type="HbMenu">
<ref object="logs_act_video_call" role="HbMenu:addAction"/>
@@ -78,21 +61,12 @@
</widget>
<string locid="txt_dial_title_dialer" name="title" value="Dialer"/>
</widget>
- <!-- Context menu -->
- <widget name="logs_show_filter_menu" type="HbMenu">
- <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>
<connect receiver="logs_matches_view" sender="logs_act_video_call" signal="triggered(bool)" slot="videoCallToCurrentNum()"/>
<connect receiver="logs_matches_view" sender="logs_act_create_message" signal="triggered(bool)" slot="sendMessageToCurrentNum()"/>
<connect receiver="logs_matches_view" sender="logs_act_contact_search" signal="triggered(bool)" slot="toggleContactSearch()"/>
<connect receiver="logs_matches_view" sender="logs_act_dialer" signal="triggered(bool)" slot="openDialpad()"/>
<connect receiver="logs_matches_view" sender="logs_act_contacts" signal="triggered(bool)" slot="openContactsApp()"/>
<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*)"/>
<section name="portrait_dialpad">
<widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
<bool name="visible" value="FALSE"/>
--- a/logsui/logsapp/resources/recentCallsView.docml Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/resources/recentCallsView.docml Fri Oct 15 14:47:48 2010 +0300
@@ -23,26 +23,6 @@
<icon iconName="qtg_mono_contacts" name="icon"/>
<string name="toolTip" value="Contacts"/>
</object>
- <object name="logs_act_show" type="HbAction">
- <icon iconName="qtg_mono_show_view" name="icon"/>
- <string name="toolTip" value="Show"/>
- </object>
- <object name="logs_act_recent" type="HbAction">
- <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 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 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 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_label_empty_list" type="HbLabel">
@@ -95,9 +75,8 @@
</widget>
<widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
<enums name="orientation" value="Horizontal"/>
+ <ref object="logs_act_dialer" role="HbToolBar:addAction"/>
<ref object="logs_act_contacts" role="HbToolBar:addAction"/>
- <ref object="logs_act_dialer" role="HbToolBar:addAction"/>
- <ref object="logs_act_show" role="HbToolBar:addAction"/>
</widget>
<widget name="logs_view_menu" role="HbView:menu" type="HbMenu">
<ref object="logs_act_video_call" role="HbMenu:addAction"/>
@@ -108,13 +87,6 @@
</widget>
<string locid="txt_dial_title_dialer" name="title" value="Dialer"/>
</widget>
- <!-- Context menu -->
- <widget name="logs_show_filter_menu" type="HbMenu">
- <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>
<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()"/>
@@ -122,8 +94,6 @@
<connect receiver="logs_recent_calls_view" sender="logs_act_contact_search" signal="triggered(bool)" slot="toggleContactSearch()"/>
<connect receiver="logs_recent_calls_view" sender="logs_act_dialer" signal="triggered(bool)" slot="openDialpad()"/>
<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*)"/>
<section name="portrait_dialpad">
<widget name="logs_toolbar" role="HbView:toolBar" type="HbToolBar">
<bool name="visible" value="FALSE"/>
--- a/logsui/logsapp/service_conf.xml Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/service_conf.xml Fri Oct 15 14:47:48 2010 +0300
@@ -8,10 +8,4 @@
<version>1.0</version>
<description>Interface to open a view of logs application</description>
</interface>
- <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 Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/src/logsbaseview.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -43,10 +43,16 @@
#include <hblistview.h>
#include <QGraphicsLinearLayout>
#include <hbpushbutton.h>
-#include <hbactivitymanager.h>
+#include <afactivitystorage.h>
#include <hbmodeliterator.h>
#include <hbscrollbar.h>
#include <hbstringutil.h>
+#include <hbtoolbarextension.h>
+#include <hblistwidget.h>
+#include <hblistwidgetitem.h>
+#include <hblistviewitem.h>
+#include <hbframebackground.h>
+
Q_DECLARE_METATYPE(LogsCall*)
Q_DECLARE_METATYPE(LogsMessage*)
@@ -66,7 +72,6 @@
mViewId( viewId ),
mRepository( repository ),
mViewManager( viewManager ),
- mShowFilterMenu(0),
mEmptyListLabel(0),
mInitialized(false),
mCall(0),
@@ -75,7 +80,9 @@
mDetailsModel(0),
mCallTypeMapper(0),
mOptionsMenu(0),
- mActivating(false)
+ mActivating(false),
+ mShowDialpad(true),
+ mViewSwitchList(0)
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::LogsBaseView()" );
@@ -141,7 +148,7 @@
//
// -----------------------------------------------------------------------------
//
-void LogsBaseView::clearActivity(HbActivityManager& manager)
+void LogsBaseView::clearActivity(AfActivityStorage& manager)
{
foreach ( const QString& activity, mActivities ){
manager.removeActivity(activity);
@@ -186,7 +193,7 @@
//
// -----------------------------------------------------------------------------
//
-void LogsBaseView::activated(bool showDialer, QVariant args)
+void LogsBaseView::activated(bool showDialer, QVariant args, const QString& dialpadText)
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::activated()" );
Q_UNUSED(args);
@@ -208,6 +215,13 @@
if (showDialer && !mDialpad->isOpen()) {
openDialpad();
}
+ if (!showDialer && mDialpad->isOpen()) {
+ mDialpad->closeDialpad();
+ }
+
+ if (currDialpadText() != dialpadText){
+ mDialpad->editor().setText(dialpadText);
+ }
updateWidgetsSizeAndLayout();
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::activated()" );
@@ -248,6 +262,9 @@
if (mContact) {
mContact->cancelServiceRequest();
}
+ if (mMessage) {
+ mMessage->cancelServiceRequest();
+ }
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::cancelServiceRequest()" );
}
@@ -270,7 +287,7 @@
void LogsBaseView::handleBackSoftkey()
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::handleBackSoftkey()" );
- mViewManager.activateView( LogsRecentViewId, false, QVariant() );
+ mViewManager.activateView( LogsRecentViewId, mShowDialpad,QVariant(), currDialpadText() );
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::handleBackSoftkey()" );
}
@@ -278,35 +295,120 @@
//
// -----------------------------------------------------------------------------
//
-void LogsBaseView::initFilterMenu()
+void LogsBaseView::initView()
+{
+ Q_ASSERT_X( !mInitialized, "logs [UI] ", "view is already initialized!!" );
+ mInitialized = true;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+qreal LogsBaseView::populateViewSwitchList(HbListWidget& list)
{
- mShowFilterMenu =
- qobject_cast<HbMenu*>( mRepository.findWidget( logsShowFilterMenuId ) );
+ LOGS_QDEBUG( "logs [UI] -> LogsBaseView::populateViewSwitchList()" );
+ qreal maxWidth = 0.0;
+ qreal width = 0.0;
+ QFontMetricsF fontMetrics(HbFontSpec(HbFontSpec::Secondary).font());
+
+ typedef QPair<XQService::LogsViewIndex, QString> QListViewPair;
+ QList<QListViewPair> viewList;
+ viewList.append( QListViewPair(XQService::LogsViewAll,
+ hbTrId("txt_dialer_ui_list_recent") ));
+ viewList.append( QListViewPair(XQService::LogsViewCalled,
+ hbTrId("txt_dialer_ui_list_dialled") ));
+ viewList.append( QListViewPair(XQService::LogsViewReceived,
+ hbTrId("txt_dialer_ui_list_received") ));
+ viewList.append( QListViewPair(XQService::LogsViewMissed,
+ hbTrId("txt_dialer_ui_list_missed") ));
+
+ for (int i=0; i<viewList.count(); i++) {
+ HbListWidgetItem* item = new HbListWidgetItem();
+ item->setText(viewList.at(i).second);
+ item->setData(viewList.at(i).first, Qt::UserRole);
+ list.addItem(item);
+
+ width = fontMetrics.width(viewList.at(i).second);
+ LOGS_QDEBUG_2( "logs [UI] -> width: ", width );
+ maxWidth = qMax(maxWidth, width);
+ }
+ LOGS_QDEBUG_2( "logs [UI] -> maxwidth: ", maxWidth );
+ LOGS_QDEBUG( "logs [UI] -> LogsBaseView::populateViewSwitchList()" );
+ return maxWidth;
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
-void LogsBaseView::addActionNamesToMap()
+void LogsBaseView::initToolbarExtension()
{
- mActionMap.clear();
- mActionMap.insert(XQService::LogsViewReceived, logsShowFilterReceivedMenuActionId);
- mActionMap.insert(XQService::LogsViewCalled, logsShowFilterDialledMenuActionId);
- mActionMap.insert(XQService::LogsViewMissed, logsShowFilterMissedMenuActionId);
- mActionMap.insert(XQService::LogsViewAll, logsShowFilterRecentMenuActionId);
+ Q_ASSERT_X( !mViewSwitchList, "logs [UI] ", "toolbar extension is already initialized!!" );
+ bool singleSelection = mViewId == LogsRecentViewId;
+ HbToolBarExtension* toolbarExtention = new HbToolBarExtension();
+ toolbarExtention->setContentsMargins(0.0,0.0,0.0,0.0);
+
+ mViewSwitchList = new HbListWidget();
+ mViewSwitchList->setObjectName("LogsViewSwitchList");//used in CSS
+ mViewSwitchList->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
+
+ qreal maxWidth = populateViewSwitchList(*mViewSwitchList);
+ qreal width = 0.0;
+ qreal shortEdge = 0.0;
+ if (style()->parameter(QString("var(hb-param-screen-short-edge)"),shortEdge)){
+ mViewSwitchList->setMaximumWidth(shortEdge);
+ mViewSwitchList->setMinimumWidth(shortEdge*2.0/3.0);
+ }
+
+ QString expr;
+ if (singleSelection) {
+ mViewSwitchList->setSelectionMode(HbAbstractItemView::SingleSelection);
+ expr = "expr(var(hb-param-margin-gene-left) + var(hb-param-graphic-size-secondary) ";
+ expr += "+ var(hb-param-margin-gene-middle-horizontal) + var(hb-param-margin-gene-right))";
+ } else {
+ expr = "expr(var(hb-param-margin-gene-left) + var(hb-param-margin-gene-right))";
+ }
+
+ if (style()->parameter(expr, width)) {
+ LOGS_QDEBUG_2( "logs [UI] -> margins: ", width );
+ width += maxWidth;
+ LOGS_QDEBUG_2( "logs [UI] -> total width: ", width );
+ mViewSwitchList->setPreferredWidth(width);
+ }
+
+ HbFrameBackground frame("qtg_fr_popup_list_normal", HbFrameDrawer::NinePieces);
+ mViewSwitchList->listItemPrototype()->setDefaultFrame(frame);
+
+ connect(mViewSwitchList, SIGNAL(activated(HbListWidgetItem*)),
+ this, SLOT(handleViewSwitchSelected(HbListWidgetItem*)));
+ connect(mViewSwitchList, SIGNAL(activated(HbListWidgetItem*)),
+ toolbarExtention, SLOT(close()));
+
+ toolbarExtention->setContentWidget(mViewSwitchList);
+
+ HbAction* dialerAction = qobject_cast<HbAction*>(
+ mRepository.findObject( logsDialerActionId ) );
+ if (dialerAction) {
+ HbAction* extensionAction = toolBar()->insertExtension(dialerAction,toolbarExtention);
+ extensionAction->setIcon(HbIcon("qtg_mono_show_view"));
+ } else {
+ delete toolbarExtention;
+ mViewSwitchList = 0;
+ }
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
-void LogsBaseView::initView()
-{
- Q_ASSERT_X( !mInitialized, "logs [UI] ", "view is already initialized!!" );
- mInitialized = true;
- initFilterMenu();
- addActionNamesToMap();
+void LogsBaseView::handleViewSwitchSelected(HbListWidgetItem* item)
+{
+ LOGS_QDEBUG( "logs [UI] -> LogsBaseView::handleViewSwitchSelected()" );
+ int viewId = item->data(Qt::UserRole).toInt();
+ QVariant args(viewId);
+ mViewManager.activateView( LogsRecentViewId, false, args );
+ LOGS_QDEBUG( "logs [UI] <- LogsBaseView::handleViewSwitchSelected()" );
}
// -----------------------------------------------------------------------------
@@ -384,44 +486,12 @@
//
// -----------------------------------------------------------------------------
//
-void LogsBaseView::showFilterMenu()
-{
- LOGS_QDEBUG( "logs [UI] -> LogsBaseView::showFilterMenu()" );
- if ( mShowFilterMenu ) {
- QRectF toolbarGeometry = toolBar()->geometry();
- QSizeF menuSize = mShowFilterMenu->size();
- LOGS_QDEBUG_2("logs [UI] menusize:", menuSize)
-
- if ( layoutDirection() == Qt::LeftToRight ){
- QPointF pos( toolbarGeometry.bottomRight().x(),
- toolbarGeometry.topRight().y() );
-
- mShowFilterMenu->setPreferredPos(pos,HbPopup::BottomRightCorner);
- LOGS_QDEBUG_2("logs [UI] menu br pos:", pos)
- } else {
- QPointF pos( toolbarGeometry.topLeft().x(),
- toolbarGeometry.topLeft().y() );
-
- mShowFilterMenu->setPreferredPos(pos,HbPopup::BottomLeftCorner);
- LOGS_QDEBUG_2("logs [UI] menu bl pos:", pos)
- }
- mShowFilterMenu->open();
- }
- LOGS_QDEBUG( "logs [UI] <- LogsBaseView::showFilterMenu()" );
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
void LogsBaseView::openDialpad()
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::openDialpad()" );
-
updateCallButton();
setDialpadPosition();
mDialpad->openDialpad();
-
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::openDialpad()" );
}
@@ -508,20 +578,6 @@
//
// -----------------------------------------------------------------------------
//
-void LogsBaseView::changeFilter(HbAction* action)
-{
- LOGS_QDEBUG( "logs [UI] -> LogsBaseView::changeFilter()" );
- XQService::LogsViewIndex view = mActionMap.key( action->objectName(),
- XQService::LogsViewAll );
- QVariant args(view);
- mViewManager.activateView( LogsRecentViewId, false, args );
- LOGS_QDEBUG( "logs [UI] <- LogsBaseView::changeFilter()" );
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
void LogsBaseView::addToContacts()
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::addToContacts()" );
@@ -545,11 +601,11 @@
void LogsBaseView::saveNumberInDialpadToContacts()
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::saveNumberInDialpadToContacts()" );
- if (mDialpad->editor().text().length() > 0){
+ if (currDialpadText().length() > 0){
delete mContact;
mContact = 0;
QString phoneNumber =
- HbStringUtil::convertDigitsTo(mDialpad->editor().text(), WesternDigit);
+ HbStringUtil::convertDigitsTo(currDialpadText(), WesternDigit);
mContact = logsModel()->createContact(phoneNumber);
saveContact();
}
@@ -681,7 +737,7 @@
//
void LogsBaseView::updateCallButton()
{
- mDialpad->setCallButtonEnabled( !mDialpad->editor().text().isEmpty() );
+ mDialpad->setCallButtonEnabled( !currDialpadText().isEmpty() );
}
// -----------------------------------------------------------------------------
@@ -695,7 +751,7 @@
if ( isDialpadInput() ){
// Call to inputted number
QString phoneNumber =
- HbStringUtil::convertDigitsTo(mDialpad->editor().text(), WesternDigit);
+ HbStringUtil::convertDigitsTo(currDialpadText(), WesternDigit);
LogsCall::callToNumber( callType, phoneNumber );
called = true;
}
@@ -715,8 +771,10 @@
if ( isDialpadInput() ){
// Message to inputted number
QString phoneNumber =
- HbStringUtil::convertDigitsTo(mDialpad->editor().text(), WesternDigit);
- LogsMessage::sendMessageToNumber( phoneNumber );
+ HbStringUtil::convertDigitsTo(currDialpadText(), WesternDigit);
+ delete mMessage;
+ mMessage = 0;
+ mMessage = LogsMessage::sendMessageToNumber( phoneNumber );
messageSent = true;
}
LOGS_QDEBUG_2( "logs [UI] <- LogsBaseView::tryMessageToDialpadNumber(), sent",
@@ -964,7 +1022,7 @@
}
QVariant arg = qVariantFromValue( mDetailsModel );
- if ( mViewManager.activateView(LogsDetailsViewId, false, arg) ){
+ if ( mViewManager.activateView(LogsDetailsViewId, false, arg, currDialpadText()) ){
mDetailsModel = 0;
}
@@ -1201,8 +1259,8 @@
{
LOGS_QDEBUG( "logs [UI] -> LogsBaseView::tryMatchesViewTransition()" );
bool viewChanged = false;
- if ( mDialpad->editor().text().length() > 0 && isContactSearchEnabled() ) {
- viewChanged = mViewManager.activateView( LogsMatchesViewId, true, QVariant() );
+ if ( currDialpadText().length() > 0 && isContactSearchEnabled() ) {
+ viewChanged = mViewManager.activateView( LogsMatchesViewId, true, QVariant(), currDialpadText() );
}
LOGS_QDEBUG( "logs [UI] <- LogsBaseView::tryMatchesViewTransition()" );
return viewChanged;
@@ -1214,7 +1272,7 @@
//
bool LogsBaseView::isDialpadInput() const
{
- return ( mDialpad->isOpen() && !mDialpad->editor().text().isEmpty() );
+ return ( mDialpad->isOpen() && !currDialpadText().isEmpty() );
}
// -----------------------------------------------------------------------------
@@ -1329,3 +1387,12 @@
mOptionsMenu = 0;
}
}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QString LogsBaseView::currDialpadText() const
+{
+ return mDialpad->editor().text();
+}
--- a/logsui/logsapp/src/logscomponentrepository.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/src/logscomponentrepository.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -23,6 +23,7 @@
#include "logsmodel.h"
#include "logsabstractviewmanager.h"
#include "logspageindicator.h"
+#include "logsbaseview.h"
//SYSTEM
#include <QObject>
@@ -282,6 +283,8 @@
if ( ok ) {
view = findWidget(viewName);
addToolbarToObjectList(viewComponents);
+ LogsBaseView* baseView = qobject_cast<LogsBaseView*>(view);
+ baseView->initToolbarExtension();
} else {
LOGS_QCRITICAL( "logs [UI] XML loading failed..." );
}
--- a/logsui/logsapp/src/logsdetailsview.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/src/logsdetailsview.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -73,11 +73,11 @@
//
// -----------------------------------------------------------------------------
//
-void LogsDetailsView::activated(bool showDialer, QVariant args)
+void LogsDetailsView::activated(bool showDialer, QVariant args, const QString& dialpadText)
{
LOGS_QDEBUG( "logs [UI] -> LogsDetailsView::activated()" );
//base class handling first
- LogsBaseView::activated(showDialer, args);
+ LogsBaseView::activated(showDialer, args, dialpadText);
LogsDetailsModel* model = qVariantValue<LogsDetailsModel*>(args);
if ( !model ){
@@ -231,7 +231,7 @@
{
LOGS_QDEBUG( "logs [UI] -> LogsDetailsView::copyNumberToClipboard()" );
if ( isDialpadInput() ){
- mDialpad->editor().setSelection(0, mDialpad->editor().text().length());
+ mDialpad->editor().setSelection(0, currDialpadText().length());
mDialpad->editor().copy();
mDialpad->editor().setSelection(0, 0);
} else if ( mDetailsModel ) {
@@ -268,7 +268,7 @@
//
void LogsDetailsView::handleBackSoftkey()
{
- mViewManager.activatePreviousView();
+ mViewManager.activatePreviousView(mDialpad->isOpen(), currDialpadText());
}
// -----------------------------------------------------------------------------
@@ -477,7 +477,6 @@
LOGS_QDEBUG( "logs [UI] -> LogsDetailsViewItem::updateChildItems(), groupbox" );
HbGroupBox* groupBox = new HbGroupBox(this);
groupBox->setHeading(modelIndex().data(Qt::DisplayRole).toString());
- //groupBox->setCollapsable(true);
HbWidget* content = new HbWidget();
content->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -492,7 +491,6 @@
mLayout->setContentsMargins(0,0,0,0);
}
- mLayout->addItem(layout());
mLayout->addItem(groupBox);
mLayout->setItemSpacing(0,0);
setLayout(mLayout);
@@ -510,3 +508,4 @@
model->setData(modelIndex(), QVariant(collapsed));
LOGS_QDEBUG( "logs [UI] <- LogsDetailsViewItem::groupBoxClicked()" );
}
+
--- a/logsui/logsapp/src/logseffecthandler.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/src/logseffecthandler.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -22,13 +22,13 @@
#include <QPropertyAnimation>
#include <QSequentialAnimationGroup>
#include <hbinstance.h>
+#include <hbmainwindow.h>
const int logsMoveByExtra = 10;
const int logsEffectDelayBetween = 200;
const int logsEffectAppearDurationInMs = 500;
const int logsEffectDissappearDurationInMs = 300;
const int logsEffectMoveNotPossibleDurationInMs = 200;
-const int logsMoveNotPossibleAmount = 30;
const int logsDissappearByMovingIndex = 0;
const int logsPauseBetweenDissappearAndAppearIndex = 1;
@@ -38,7 +38,7 @@
//
// -----------------------------------------------------------------------------
//
-LogsEffectHandler::LogsEffectHandler() : QObject()
+LogsEffectHandler::LogsEffectHandler(HbMainWindow& window) : QObject(), mWindow(window)
{
LOGS_QDEBUG( "logs [UI] -> LogsEffectHandler::LogsEffectHandler()" );
@@ -181,9 +181,9 @@
// Move a bit to attempted direction and then back
//
- //int origX = effectTarget.property("x").toInt();
+ const int logsMoveNotPossibleAmount = mWindow.layoutRect().width() / 6;
int moveNotPossiblePos =
- moveLeft ? -logsMoveNotPossibleAmount : logsMoveNotPossibleAmount;
+ moveLeft ? logsMoveNotPossibleAmount : -logsMoveNotPossibleAmount;
QEasingCurve easing(QEasingCurve::OutBack);
initMoveHorizontallyEffect(
*mItemMoveNotPossibleAnimationStart, &effectTarget, origX, moveNotPossiblePos,
--- a/logsui/logsapp/src/logsmatchesview.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/src/logsmatchesview.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -67,9 +67,10 @@
// LogsMatchesView::activated
// -----------------------------------------------------------------------------
//
-void LogsMatchesView::activated(bool showDialer, QVariant args)
-{
- LogsBaseView::activated(showDialer, args);
+void LogsMatchesView::activated(bool showDialer, QVariant args, const QString& dialpadText)
+{LOGS_QDEBUG( "logs [UI] -> LogsMatchesView::activated()" );
+ mShowDialpad = showDialer;
+ LogsBaseView::activated(showDialer, args, dialpadText);
LogsMatchesModel* model = qVariantValue<LogsMatchesModel*>(args);
updateModel(model);
@@ -80,6 +81,7 @@
scrollToTopItem(mListView);
LogsBaseView::activationCompleted();
+ LOGS_QDEBUG( "logs [UI] <- LogsMatchesView::activated()" );
}
// -----------------------------------------------------------------------------
@@ -195,21 +197,8 @@
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" );
- // Block aboutToClose signal to interfere with layout loading
- // at backstepping phase
- mDialpad->blockSignals(true);
- mDialpad->closeDialpad();
- mDialpad->blockSignals(false);
- }
-
- LogsBaseView::handleBackSoftkey();
-
+ mShowDialpad = false;
+ mDialpad->editor().setText(QString());
LOGS_QDEBUG( "logs [UI] <- LogsMatchesView::::handleBackSoftkey()" );
}
@@ -223,7 +212,7 @@
updateCallButton();
updateMenu();
- QString pattern = mDialpad->editor().text();
+ QString pattern = currDialpadText();
if ( pattern.isEmpty() ){
// Treat empty input field same way as back press
LogsBaseView::handleBackSoftkey();
--- a/logsui/logsapp/src/logsrecentcallsview.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/src/logsrecentcallsview.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -40,8 +40,9 @@
#include <hbmainwindow.h>
#include <hbswipegesture.h>
#include <hbmessagebox.h>
-#include <hbactivitymanager.h>
#include <hbstyleloader.h>
+#include <hblistwidget.h>
+#include <hblistwidgetitem.h>
#include <QTimer>
Q_DECLARE_METATYPE(LogsMatchesModel*)
@@ -106,13 +107,11 @@
// LogsRecentCallsView::activated
// -----------------------------------------------------------------------------
//
-void LogsRecentCallsView::activated(bool showDialer, QVariant args)
+void LogsRecentCallsView::activated(bool showDialer, QVariant args, const QString& dialpadText)
{
LOGS_QDEBUG( "logs [UI] -> LogsRecentCallsView::activated()" );
- HbStyleLoader::registerFilePath(":/hbgroupboxheadingwidget.css");
-
// base class handling first
- LogsBaseView::activated(showDialer, args);
+ LogsBaseView::activated(showDialer, args, dialpadText);
int internalViewId = args.toInt();
if ( internalViewId < 0 || internalViewId > XQService::LogsViewMissed ){
@@ -146,8 +145,6 @@
//
void LogsRecentCallsView::deactivated()
{
- HbStyleLoader::unregisterFilePath(":/hbgroupboxheadingwidget.css");
-
//base class handling first
LogsBaseView::deactivated();
@@ -216,7 +213,7 @@
addStringsToMap();
initListWidget();
- mEffectHandler = new LogsEffectHandler;
+ mEffectHandler = new LogsEffectHandler(mViewManager.mainWindow());
connect(mEffectHandler, SIGNAL(dissappearByMovingComplete()),
this, SLOT(dissappearByMovingComplete()));
connect(mEffectHandler, SIGNAL(dissappearByFadingComplete()),
@@ -299,9 +296,10 @@
void LogsRecentCallsView::dialpadEditorTextChanged()
{
LOGS_QDEBUG( "logs [UI] -> LogsRecentCallsView::dialpadEditorTextChanged()" );
- if ( mDialpad->editor().text().length() > 0 && isContactSearchEnabled() ) {
+ if ( currDialpadText().length() > 0 && isContactSearchEnabled() ) {
+ LOGS_QDEBUG( "logs [UI] -> LogsRecentCallsView::dialpadEditorTextChanged() editor().txt.length() > 0" );
QVariant arg = qVariantFromValue( mMatchesModel );
- if ( mViewManager.activateView( LogsMatchesViewId, true, arg ) ){
+ if ( mViewManager.activateView( LogsMatchesViewId, true, arg , currDialpadText()) ){
mMatchesModel = 0; // Ownership was given to matches view
}
} else {
@@ -377,25 +375,24 @@
LogsFilter::FilterType filter = getFilter( view );
updateFilter(filter);
updateViewName();
- updateContextMenuItems(mCurrentView);
+ updateViewSwitchList(mCurrentView);
handleMissedCallsCounter();
LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::updateView()" );
}
// -----------------------------------------------------------------------------
-// LogsRecentCallsView::changeFilter
+// LogsRecentCallsView::handleViewSwitchSelected
// -----------------------------------------------------------------------------
//
-void LogsRecentCallsView::changeFilter(HbAction* action)
+void LogsRecentCallsView::handleViewSwitchSelected(HbListWidgetItem* item)
{
- LOGS_QDEBUG( "logs [UI] -> LogsRecentCallsView::changeFilter()" );
- XQService::LogsViewIndex view = mActionMap.key( action->objectName(),
- XQService::LogsViewAll );
- updateContextMenuItems(view);
- changeView(view);
+ LOGS_QDEBUG( "logs [UI] -> LogsRecentCallsView::handleViewSwitchSelected()" );
+ XQService::LogsViewIndex viewId =
+ (XQService::LogsViewIndex)item->data(Qt::UserRole).toInt();
+ changeView(viewId);
+ LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::handleViewSwitchSelected()" );
+}
- LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::changeFilter()" );
-}
// -----------------------------------------------------------------------------
// LogsRecentCallsView::handleBackSoftkey
@@ -501,20 +498,23 @@
}
// -----------------------------------------------------------------------------
-// LogsRecentCallsView::updateContextMenuItems
+// LogsRecentCallsView::updateViewSwitchList
// -----------------------------------------------------------------------------
//
-void LogsRecentCallsView::updateContextMenuItems(XQService::LogsViewIndex view)
+void LogsRecentCallsView::updateViewSwitchList(XQService::LogsViewIndex view)
{
- LOGS_QDEBUG_2(
- "logs [UI] -> LogsRecentCallsView::updateContextMenuItems(), view:", view );
- if ( mShowFilterMenu ) {
- QString activeActionName = mActionMap.value(view);
- foreach (QAction* action, mShowFilterMenu->actions() ) {
- action->setChecked( action->objectName() == activeActionName );
- }
+ LOGS_QDEBUG_2( "logs [UI] -> LogsRecentCallsView::updateShowViewList(), view:", view );
+ if (mViewSwitchList) {
+ for (int i=0; i < mViewSwitchList->count(); i++) {
+ if (mViewSwitchList->item(i)->data(Qt::UserRole).toInt() == view) {
+ mViewSwitchList->setCurrentRow(i);
+ mViewSwitchList->selectionModel()->setCurrentIndex(
+ mViewSwitchList->currentIndex(),
+ QItemSelectionModel::SelectCurrent);
+ break;
+ }
+ }
}
- LOGS_QDEBUG( "logs [UI] <- LogsRecentCallsView::updateContextMenuItems()" );
}
// -----------------------------------------------------------------------------
@@ -844,7 +844,7 @@
//
void LogsRecentCallsView::updateCallButton()
{
- bool isVisible = !mDialpad->editor().text().isEmpty();
+ bool isVisible = !currDialpadText().isEmpty();
if ( !isVisible && mFilter ) {
isVisible = ( mFilter->rowCount() > 0 );
}
@@ -902,9 +902,11 @@
//
void LogsRecentCallsView::handleMissedCallsCounter()
{
- if (mModel && mCurrentView == XQService::LogsViewMissed) {
+ if (mModel && (mCurrentView == XQService::LogsViewMissed
+ || mCurrentView == XQService::LogsViewAll)) {
LOGS_QDEBUG( "logs [UI] <-> LogsRecentCallsView::clearMissedCallsCounter()" );
mModel->clearMissedCallsCounter();
}
}
+
--- a/logsui/logsapp/src/logsservicehandlerold.cpp Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +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:
-*
-*/
-//USER
-#include "logsservicehandlerold.h"
-#include "logslogger.h"
-#include <xqserviceutil.h>
-
-//SYSTEM
-
-// -----------------------------------------------------------------------------
-// LogsServiceHandlerOld::LogsServiceHandlerOld
-// deprecated Use "logs.com.nokia.symbian.ILogsView" interface and
-// "show(QVariantMap)" operation instead
-// -----------------------------------------------------------------------------
-//
-LogsServiceHandlerOld::LogsServiceHandlerOld()
- : XQServiceProvider(QLatin1String("com.nokia.services.logsservices.starter"),0)
-{
- 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 < XQService::LogsViewAll ||
- activatedView > XQService::LogsViewMissed ){
- LOGS_QDEBUG( "logs [UI] <- LogsServiceHandlerOld::start(), incorrect view" )
- return -1;
- }
- mIsAppStartedUsingService = true;
-
- emit activateView((XQService::LogsViewIndex)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 < XQService::LogsViewAll ||
- activatedView > XQService::LogsViewMissed ){
- LOGS_QDEBUG( "logs [UI] <- LogsServiceHandlerOld::startWithNum(), incorrect view" )
- return -1;
- }
- mIsAppStartedUsingService = true;
-
- 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 Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/src/logsviewmanager.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -24,7 +24,6 @@
#include "logsdefs.h"
#include "logslogger.h"
#include "logsservicehandler.h"
-#include "logsservicehandlerold.h"
#include "logsmainwindow.h"
#include "logsappsettings.h"
#include "logsforegroundwatcher.h"
@@ -35,9 +34,10 @@
#include <QApplication>
#include <hblineedit.h>
#include <dialpad.h>
-#include <hbactivitymanager.h>
#include <hbapplication.h>
#include <tstasksettings.h>
+#include <afactivation.h>
+#include <afactivitystorage.h>
// -----------------------------------------------------------------------------
// LogsViewManager::LogsViewManager
@@ -45,12 +45,11 @@
//
LogsViewManager::LogsViewManager(
LogsMainWindow& mainWindow, LogsServiceHandler& service,
- LogsServiceHandlerOld& serviceOld,
LogsAppSettings& settings) :
QObject( 0 ), mMainWindow( mainWindow ),
- mService( service ), mServiceOld( serviceOld ), mSettings( settings ),
+ mService( service ), mSettings( settings ),
mFirstActivation(true), mViewActivationShowDialpad(false),
- mBackgroundStartupWatcher(0)
+ mBackgroundStartupWatcher(0), mDialpadText(QString())
{
LOGS_QDEBUG( "logs [UI] -> LogsViewManager::LogsViewManager()" );
@@ -69,14 +68,11 @@
connect( &mService, SIGNAL( activateView(QString) ),
this, SLOT( changeMatchesViewViaService(QString) ));
- connect( &mServiceOld, SIGNAL( activateView(XQService::LogsViewIndex, bool, QString) ),
- this, SLOT( changeRecentViewViaService(XQService::LogsViewIndex, bool, QString) ) );
-
- connect( &mServiceOld, SIGNAL( activateView(QString) ),
- this, SLOT( changeMatchesViewViaService(QString) ));
-
QObject::connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(saveActivity()));
+ mActivityManager = new AfActivityStorage;
+ mActivation = new AfActivation;
+
handleFirstActivation();
LOGS_QDEBUG( "logs [UI] <- LogsViewManager::LogsViewManager()" );
@@ -90,7 +86,9 @@
LogsViewManager::~LogsViewManager()
{
LOGS_QDEBUG( "logs [UI] -> LogsViewManager::~LogsViewManager()" );
-
+
+ delete mActivation;
+ delete mActivityManager;
delete mComponentsRepository;
delete mBackgroundStartupWatcher;
@@ -160,9 +158,9 @@
// -----------------------------------------------------------------------------
//
bool LogsViewManager::activateView(
- LogsAppViewId viewId, bool showDialpad, QVariant args)
+ LogsAppViewId viewId, bool showDialpad, QVariant args, const QString& dialpadText)
{
- return doActivateView(viewId, showDialpad, args);
+ return doActivateView(viewId, showDialpad, args, dialpadText );
}
// -----------------------------------------------------------------------------
@@ -196,11 +194,11 @@
// Previously activated view is at slot 1 of view stack
// -----------------------------------------------------------------------------
//
-bool LogsViewManager::activatePreviousView()
+bool LogsViewManager::activatePreviousView(bool showDialpad, const QString& dialpadText)
{
LogsAppViewId viewId = ( mViewStack.count() > 1 ) ?
mViewStack.at(1)->viewId() : LogsRecentViewId;
- return doActivateView(viewId, false, QVariant());
+ return doActivateView(viewId, showDialpad, QVariant(), dialpadText);
}
// -----------------------------------------------------------------------------
@@ -249,6 +247,7 @@
mMainWindow.setInteractive(true);
mViewActivationArgs = args;
mViewActivationShowDialpad = showDialpad;
+ mDialpadText = dialpadText;
completeViewActivation();
activated = true;
}
@@ -274,7 +273,7 @@
} else {
disconnect( &mMainWindow, SIGNAL(viewReady()), this, SLOT(completeViewActivation()) );
LogsBaseView* newView = mViewStack.at(0);
- newView->activated(mViewActivationShowDialpad, mViewActivationArgs);
+ newView->activated(mViewActivationShowDialpad, mViewActivationArgs, mDialpadText);
connect( &mMainWindow, SIGNAL(callKeyPressed()),
newView, SLOT(callKeyPressed()),
Qt::UniqueConnection );
@@ -309,8 +308,7 @@
}
clearActivities();
-
- HbActivityManager* activityManager = static_cast<HbApplication*>(qApp)->activityManager();
+
QVariantHash metaData;
LOGS_QDEBUG( "logs [UI] Start taking screenshot" );
QImage* img = new QImage(mMainWindow.rect().size(), QImage::Format_ARGB32_Premultiplied);
@@ -318,7 +316,7 @@
// 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));
+ metaData.insert(QString("screenshot"), QPixmap::fromImage(*img));
delete img;
LOGS_QDEBUG( "logs [UI] End taking screenshot" );
@@ -334,7 +332,7 @@
QString activityId = mViewStack.at(0)->saveActivity(stream, metaData);
// add the activity to the activity manager
- bool ok = activityManager->addActivity(activityId, serializedActivity, metaData);
+ bool ok = mActivityManager->saveActivity(activityId, serializedActivity, metaData);
if ( !ok ){
LOGS_QDEBUG( "logs [UI] activity adding failed" );
}
@@ -348,9 +346,11 @@
bool LogsViewManager::loadActivity()
{
LOGS_QDEBUG( "logs [UI] -> LogsViewManager::loadActivity()" );
- HbApplication* hbApp = static_cast<HbApplication*>(qApp);
- QString activityId = hbApp->activateId();
- return doLoadActivity(activityId);
+ bool loaded = false;
+ if ( mActivation->reason() == Af::ActivationReasonActivity ){
+ loaded = doLoadActivity(mActivation->name());
+ }
+ return loaded;
}
// -----------------------------------------------------------------------------
@@ -359,11 +359,7 @@
//
LogsAppViewId LogsViewManager::checkMatchesViewTransition(
LogsAppViewId viewId, const QString& dialpadText)
-{
- if ( !dialpadText.isEmpty() ){
- mComponentsRepository->dialpad()->editor().setText(dialpadText);
- }
-
+{Q_UNUSED( dialpadText );
if ( viewId == LogsMatchesViewId ){
LogsModel* model = mComponentsRepository->model();
if ( model && model->predictiveSearchStatus() != logsContactSearchEnabled ){
@@ -391,17 +387,13 @@
setTaskSwitcherVisibility(false);
} else {
- Hb::ActivationReason reason = static_cast<HbApplication*>(qApp)->activateReason();
- bool isStartedByService(
- mService.isStartedUsingService() || mServiceOld.isStartedUsingService() );
-
// Start immediately using all possible resources
mComponentsRepository->model()->refreshData();
- if ( reason == Hb::ActivationReasonActivity && loadActivity() ){
+ if ( loadActivity() ){
LOGS_QDEBUG( "logs [UI] loaded saved activity" );
mMainWindow.bringAppToForeground();
- } else if ( mFirstActivation && !isStartedByService ) {
+ } else if ( mFirstActivation && !mService.isStartedUsingService() ) {
activateDefaultView();
mMainWindow.bringAppToForeground();
}
@@ -486,10 +478,13 @@
//
// -----------------------------------------------------------------------------
//
-void LogsViewManager::activityRequested(const QString &activityId)
+void LogsViewManager::activityRequested(
+ Af::ActivationReason reason, QString name, QVariantHash parameters)
{
LOGS_QDEBUG( "logs [UI] -> LogsViewManager::activityRequested()" );
- if ( doLoadActivity(activityId) ){
+ Q_UNUSED(reason);
+ Q_UNUSED(parameters);
+ if ( doLoadActivity(name) ){
mMainWindow.bringAppToForeground();
}
LOGS_QDEBUG( "logs [UI] <- LogsViewManager::activityRequested()" );
@@ -502,8 +497,6 @@
void LogsViewManager::bgStartupForegroundGained()
{
LOGS_QDEBUG( "logs [UI] -> LogsViewManager::bgStartupForegroundGained()" );
- delete mBackgroundStartupWatcher;
- mBackgroundStartupWatcher = 0;
endFakeExit();
mMainWindow.bringAppToForeground();
LOGS_QDEBUG( "logs [UI] <- LogsViewManager::bgStartupForegroundGained()" );
@@ -516,10 +509,9 @@
void LogsViewManager::doFakeExit()
{
saveActivity();
- HbActivityManager* activityManager =
- static_cast<HbApplication*>(qApp)->activityManager();
- connect( activityManager, SIGNAL(activityRequested(QString)),
- this, SLOT(activityRequested(QString)), Qt::UniqueConnection );
+ connect( mActivation, SIGNAL(activated(Af::ActivationReason,QString,QVariantHash)),
+ this, SLOT(activityRequested(Af::ActivationReason,QString,QVariantHash)),
+ Qt::UniqueConnection );
mComponentsRepository->model()->compressData();
setTaskSwitcherVisibility(false);
}
@@ -530,6 +522,8 @@
//
void LogsViewManager::endFakeExit()
{
+ delete mBackgroundStartupWatcher;
+ mBackgroundStartupWatcher = 0;
setTaskSwitcherVisibility(true);
mComponentsRepository->model()->refreshData();
if ( !mMainWindow.currentView() ){
@@ -544,14 +538,8 @@
//
bool LogsViewManager::doLoadActivity(const QString& activityId)
{
- LOGS_QDEBUG( "logs [UI] -> LogsViewManager::doLoadActivity()" );
+ LOGS_QDEBUG_2( "logs [UI] -> LogsViewManager::doLoadActivity():", activityId );
bool loaded = false;
- HbApplication* hbApp = static_cast<HbApplication*>(qApp);
- 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++ ){
@@ -560,8 +548,7 @@
}
}
- QList<QVariantHash> allParams = hbApp->activityManager()->activities();
- QVariantHash params = allParams.isEmpty() ? QVariantHash() : allParams.at(0);
+ QVariantHash params = mActivityManager->activityMetaData(activityId);
LOGS_QDEBUG_2( "logs [UI] Activity params", params );
if ( !matchingView ){
@@ -571,14 +558,11 @@
}
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();
+ QByteArray serializedActivity =
+ mActivityManager->activityData(activityId).toByteArray();
QDataStream stream(&serializedActivity, QIODevice::ReadOnly);
QVariant args = matchingView->loadActivity(activityId, stream, params);
@@ -596,13 +580,11 @@
//
void LogsViewManager::clearActivities()
{
- HbApplication* hbApp = static_cast<HbApplication*>(qApp);
- HbActivityManager* activityManager = hbApp->activityManager();
foreach ( LogsBaseView* view, mViewStack ){
- view->clearActivity(*activityManager);
+ view->clearActivity(*mActivityManager);
}
- disconnect( activityManager, SIGNAL(activityRequested(QString)),
- this, SLOT(activityRequested(QString)) );
+ disconnect( mActivation, SIGNAL(activated(Af::ActivationReason,QString,QVariantHash)),
+ this, SLOT(activityRequested(Af::ActivationReason,QString,QVariantHash)) );
}
// -----------------------------------------------------------------------------
@@ -616,12 +598,7 @@
LOGS_QDEBUG_2( "logs [UI] -> LogsViewManager::activateViewViaService()", viewId );
clearActivities();
closeEmbeddedApplication();
- Dialpad* dpad = mComponentsRepository->dialpad();
- if ( !showDialpad ){
- dpad->closeDialpad();
- }
- dpad->editor().setText(dialpadText);
- if ( doActivateView(viewId, showDialpad, args, QString(), true) ){
+ if ( doActivateView(viewId, showDialpad, args, dialpadText, true) ){
mMainWindow.bringAppToForeground();
}
LOGS_QDEBUG( "logs [UI] <- LogsViewManager::activateViewViaService()" );
--- a/logsui/logsapp/src/main.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/src/main.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -20,7 +20,6 @@
#include "logsmainwindow.h"
#include "logsviewmanager.h"
#include "logsservicehandler.h"
-#include "logsservicehandlerold.h"
#include "logslogger.h"
#include "logsdefs.h"
@@ -76,8 +75,7 @@
// This can cause problem of service request not coming through if
// HbApplication creation takes long time.
LogsServiceHandler service;
- LogsServiceHandlerOld serviceOld;
- LogsViewManager viewManager(window, service, serviceOld, appSettings);
+ LogsViewManager viewManager(window, service, appSettings);
// Don't show window yet as app might be started at background
int err = app.exec();
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/logsviewmanagerstub.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/logsviewmanagerstub.h Fri Oct 15 14:47:48 2010 +0300
@@ -52,15 +52,16 @@
mViewId = viewId;
return true;
}
- virtual bool activateView(LogsAppViewId viewId, bool showDialer, QVariant args)
- {
+ virtual bool activateView(LogsAppViewId viewId, bool showDialer, QVariant args, const QString& dialpadText = QString())
+ {Q_UNUSED( dialpadText );
mViewId = viewId;
mShowDialer = showDialer;
mArgs = args;
return true;
}
- virtual bool activatePreviousView()
- {
+ virtual bool activatePreviousView(bool showDialpad, const QString& dialpadText)
+ { Q_UNUSED( showDialpad );
+ Q_UNUSED( dialpadText );
mPreviousActivated = true;
return true;
}
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsbaseview.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsbaseview.h Fri Oct 15 14:47:48 2010 +0300
@@ -54,13 +54,14 @@
void testActivated();
void testDeactivated();
void testResetView();
- void testShowFilterMenu();
+ void testInitToolbarExtension();
+ void testPopulateViewSwitchList();
void testOpenDialpad();
void testSetDialpadPostion();
void testDialpadClosed();
void testDialpadOpened();
void testDialpadEditorTextChanged();
- void testChangeFilter();
+ void testHandleViewSwitchSelected();
void testOpenContactsApp();
void testModel();
void testInitiateCall();
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsdetailsview.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsdetailsview.h Fri Oct 15 14:47:48 2010 +0300
@@ -60,7 +60,7 @@
void testUpdateMenu();
void testDeleteEventAnswer();
void testCopyNumberToClipboard();
- void testChangeFilter();
+ void testHandleViewSwitchSelected();
void testContactActionCompleted();
void testModel();
void testUpdateWidgetsSizeAndLayout();
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logseffecthandler.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logseffecthandler.h Fri Oct 15 14:47:48 2010 +0300
@@ -22,7 +22,7 @@
class LogsEffectHandler;
class HbLabel;
-class HbMainWindow;
+class LogsMainWindow;
class UT_LogsEffectHandler : public QObject
{
@@ -58,7 +58,7 @@
LogsEffectHandler* mEffect;
HbLabel* mLabel;
HbLabel* mLabel2;
- HbMainWindow* mMainWindow;
+ LogsMainWindow* mMainWindow;
};
#endif //UT_LOGSEFFECTHANDLER_H
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsrecentcallsview.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsrecentcallsview.h Fri Oct 15 14:47:48 2010 +0300
@@ -57,7 +57,7 @@
void testInitListWidget();
void testUpdateFilter();
void testUpdateViewName();
- void testChangeFilter();
+ void testHandleViewSwitchSelected();
void testInitiateCallback();
void testCallKeyPressed();
void testShowCallDetails();
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsservicehandler.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsservicehandler.h Fri Oct 15 14:47:48 2010 +0300
@@ -21,8 +21,6 @@
#include <QObject>
class LogsServiceHandler;
-class LogsServiceHandlerOld;
-
class LogsViewManager;
class LogsMainWindow;
class LogsAppSettings;
@@ -53,17 +51,11 @@
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;
LogsAppSettings* mSettings;
--- a/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsviewmanager.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/inc/ut_logsviewmanager.h Fri Oct 15 14:47:48 2010 +0300
@@ -24,7 +24,6 @@
class LogsViewManager;
class LogsMainWindow;
class LogsServiceHandler;
-class LogsServiceHandlerOld;
class LogsAppSettings;
class UT_LogsViewManager : public QObject
@@ -71,7 +70,6 @@
LogsViewManager* mLogsViewManager;
LogsServiceHandler* mService;
- LogsServiceHandlerOld* mServiceOld;
LogsAppSettings* mSettings;
};
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsdetailsmodel.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsdetailsmodel.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -45,8 +45,9 @@
//
LogsDetailsModel::LogsDetailsModel()
: LogsAbstractModel(),
- mEvent( 0 ),
- mDetailItemsCount( 0 )
+ mEvent(0),
+ mDetailItemsCount(0),
+ mSeparatorCollapsed(true)
{
LOGS_QDEBUG( "logs [ENG] -> LogsDetailsModel::LogsDetailsModel()" )
mLastCallName = QString();
@@ -165,4 +166,5 @@
if (value.isValid() && value.toBool() != mSeparatorCollapsed) {
mSeparatorCollapsed = !mSeparatorCollapsed;
}
+ return true;
}
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmessage.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmessage.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -23,6 +23,7 @@
bool logsTestMessageSent = false;
bool defaultMessageSent = false;
QString lostTestMessageNumber;
+bool LogsMessage::mServiceRequestCanceled = false;
// -----------------------------------------------------------------------------
//
@@ -65,7 +66,7 @@
//
// ----------------------------------------------------------------------------
//
-bool LogsMessage::sendMessageToNumber(
+LogsMessage* LogsMessage::sendMessageToNumber(
const QString& number, const QString& displayName, unsigned int contactId)
{
Q_UNUSED(number);
@@ -73,6 +74,7 @@
Q_UNUSED(contactId);
logsTestMessageSent = true;
lostTestMessageNumber = number;
+ return new LogsMessage();
}
bool LogsMessage::isMessageSent()
@@ -96,5 +98,10 @@
return lostTestMessageNumber;
}
+void LogsMessage::cancelServiceRequest()
+{
+ mServiceRequestCanceled = true;
+}
+
// End of file
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmessage.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmessage.h Fri Oct 15 14:47:48 2010 +0300
@@ -43,8 +43,10 @@
* @return true if sent succesfully
*/
bool sendMessage();
- static bool sendMessageToNumber(
+ static LogsMessage* sendMessageToNumber(
const QString& number, const QString& displayName = QString(), unsigned int contactId = 0);
+
+ void cancelServiceRequest();
private: //data
LogsEvent mEvent;
@@ -55,6 +57,8 @@
static bool isDefaultMessageSent();
static QString sentToNumber();
+ static bool mServiceRequestCanceled;
+
private:
friend class UT_LogsMessage;
--- a/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmodel.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/logsengine_stub/logsmodel.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -91,7 +91,7 @@
// -----------------------------------------------------------------------------
//
LogsDetailsModel* LogsModel::logsDetailsModel(LogsEvent& event)
-{
+{Q_UNUSED( event );
return new LogsDetailsModel();
}
--- a/logsui/logsapp/tsrc/ut_logsapp/src/main.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/main.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -37,7 +37,7 @@
QApplication app(argc, argv);
QStringList args = app.arguments();
- QString combinedOutputFileName;
+ QString combinedOutputFileName = "C:/shared/eunit/logs/ut_logsapp_log.xml"; // ATS default
for ( int i = 0; i < args.count(); i++ ){
QString arg = args.at(i);
if ( arg == QString("-o") && i + 1 < args.count() ){
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsbaseview.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsbaseview.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -27,6 +27,8 @@
#include "logsmodel.h"
#include "logsdetailsmodel.h"
#include "logsmainwindow.h"
+#include "logsrecentcallsview.h"
+#include "af_stub_helper.h"
//SYSTEM
#include <QtTest/QtTest>
@@ -40,7 +42,10 @@
#include <hbmessagebox.h>
#include <QStringListModel>
#include <hbapplication.h>
-#include <hbactivitymanager.h>
+#include <afactivitystorage.h>
+#include <hblistwidget.h>
+#include <hblistwidgetitem.h>
+#include <hbtoolbar.h>
void UT_LogsBaseView::initTestCase()
{
@@ -72,9 +77,8 @@
void UT_LogsBaseView::testConstructor()
{
QVERIFY( mBaseView );
- QVERIFY( !mBaseView->mShowFilterMenu );
+ QVERIFY( !mBaseView->mViewSwitchList );
QVERIFY( !mBaseView->mInitialized );
- QVERIFY( mBaseView->mActionMap.isEmpty() );
QVERIFY( mBaseView->viewId() == LogsRecentViewId );
QVERIFY( mBaseView->mDialpad );
QVERIFY( !mBaseView->mCall );
@@ -86,13 +90,12 @@
void UT_LogsBaseView::testActivated()
{
- mBaseView->activated(false, QVariant());
+ mBaseView->activated(false, QVariant(), mBaseView->mDialpad->editor().text());
QVERIFY( !mBaseView->mDialpad->isVisible() );
QVERIFY( mBaseView->mInitialized );
- QVERIFY( !mBaseView->mShowFilterMenu );
- QVERIFY( mBaseView->mActionMap.count() == 4 );
+ QVERIFY( !mBaseView->mViewSwitchList );
- mBaseView->activated(true, QVariant());
+ mBaseView->activated(true, QVariant(), mBaseView->mDialpad->editor().text());
QVERIFY( mBaseView->mDialpad->isOpen() );
}
@@ -106,35 +109,43 @@
mBaseView->resetView(); // NOP
}
-void UT_LogsBaseView::testShowFilterMenu()
+void UT_LogsBaseView::testInitToolbarExtension()
{
- HbStubHelper::reset();
- mBaseView->setLayoutDirection(Qt::LeftToRight);
+ //1. List with check icon as toolbar extension
+ mBaseView->mViewId = LogsRecentViewId;
+ //1.1. No logsDialerActionId action, extension can't be added
+ mBaseView->initToolbarExtension();
+ QVERIFY( !mBaseView->mViewSwitchList );
+ QVERIFY( mBaseView->toolBar()->actions().count() == 0 );
- //no context menu
- QVERIFY( !mBaseView->mShowFilterMenu );
- mBaseView->showFilterMenu();
- QVERIFY( !HbStubHelper::menuShown() );
+ //1.2. logsDialerActionId action exists, extension added
+ LogsRecentCallsView* view = mRepository->recentCallsView();
+
+ mBaseView->initToolbarExtension();
+ QVERIFY( mBaseView->mViewSwitchList );
+ QVERIFY( mBaseView->mViewSwitchList->selectionMode() ==
+ HbAbstractItemView::SingleSelection );
- //contect menu exists
- mBaseView->mShowFilterMenu = new HbMenu();
- QVERIFY( mBaseView->mShowFilterMenu );
- mBaseView->showFilterMenu();
- QVERIFY( HbStubHelper::menuShown() );
- QVERIFY( HbStubHelper::menuShownPlacement() == HbPopup::BottomRightCorner );
-
- // RTL layout dir
- HbStubHelper::reset();
- mBaseView->setLayoutDirection(Qt::RightToLeft);
- mBaseView->showFilterMenu();
- QVERIFY( HbStubHelper::menuShown() );
- QVERIFY( HbStubHelper::menuShownPlacement() == HbPopup::BottomLeftCorner );
-
- delete mBaseView->mShowFilterMenu;
- mBaseView->mShowFilterMenu = 0;
-
+ //list without check icon as toolbar extension
+ mBaseView->mViewId = LogsDetailsViewId;
+ mBaseView->setToolBar(0);
+ mBaseView->mViewSwitchList = 0;
+ mBaseView->initToolbarExtension();
+ QVERIFY( mBaseView->mViewSwitchList );
+ QVERIFY( mBaseView->mViewSwitchList->selectionMode() ==
+ HbAbstractItemView::NoSelection );
+ delete view;
}
+void UT_LogsBaseView::testPopulateViewSwitchList()
+{
+ HbListWidget* list = new HbListWidget();
+ QVERIFY( mBaseView->populateViewSwitchList(*list) > 0 );
+ QVERIFY( list->count() == 4 );
+ delete list;
+}
+
+
void UT_LogsBaseView::testOpenDialpad()
{
QVERIFY( !mBaseView->mDialpad->isOpen() );
@@ -161,7 +172,7 @@
{
mBaseView->mDialpad->editor().setText( QString("hello") );
mBaseView->dialpadClosed();
- QVERIFY( !mBaseView->mDialpad->editor().text().isEmpty() );
+ QVERIFY( !mBaseView->currDialpadText().isEmpty() );
}
void UT_LogsBaseView::testDialpadOpened()
@@ -195,13 +206,20 @@
QVERIFY( mBaseView->mDialpad->mIsCallButtonEnabled );
}
-void UT_LogsBaseView::testChangeFilter()
+void UT_LogsBaseView::testHandleViewSwitchSelected()
{
QVERIFY( mViewManager->mViewId == LogsUnknownViewId );
- HbAction* action = new HbAction();
- action->setObjectName(logsShowFilterMissedMenuActionId);
- mBaseView->changeFilter(action);
+ mBaseView->mViewSwitchList = new HbListWidget();
+ HbListWidgetItem* item = new HbListWidgetItem();
+ item->setData(QVariant(XQService::LogsViewReceived), Qt::UserRole);
+ mBaseView->mViewSwitchList->addItem(item);
+
+ mBaseView->handleViewSwitchSelected(item);
+
QVERIFY( mViewManager->mViewId == LogsRecentViewId );
+ QVERIFY( mViewManager->mArgs.toInt() == (int)XQService::LogsViewReceived );
+ delete mBaseView->mViewSwitchList;
+ mBaseView->mViewSwitchList = 0;
}
void UT_LogsBaseView::testModel()
@@ -256,7 +274,7 @@
QVERIFY( !HbStubHelper::menuShown() );
//check that dialpad has closed
QVERIFY( !mBaseView->mDialpad->isVisible() );
-
+ delete item;
//menu has actions and can be executed should be tested in derived class
}
@@ -534,6 +552,7 @@
mBaseView->sendMessageToCurrentNum();
QVERIFY( LogsMessage::isMessageSent() );
QCOMPARE( LogsMessage::sentToNumber(), QString("conv") + number );
+ QVERIFY( mBaseView->mMessage );
}
void UT_LogsBaseView::testSaveNumberInDialpadToContacts()
@@ -620,13 +639,14 @@
void UT_LogsBaseView::testClearActivity()
{
- HbStubHelper::reset();
- HbActivityManager* manager = static_cast<HbApplication*>(qApp)->activityManager();
- manager->addActivity("someact", QVariant(), QVariantHash());
- QCOMPARE( manager->activities().count(), 1 );
+ AfStubHelper::reset();
+ AfActivityStorage manager;
+
+ manager.saveActivity("testActivity1", QVariant(), QVariantHash());
+ QCOMPARE( manager.allActivities().count(), 1 );
mBaseView->mActivities.append( "testActivity1" );
- mBaseView->clearActivity(*manager);
- QCOMPARE( manager->activities().count(), 0 );
+ mBaseView->clearActivity(manager);
+ QCOMPARE( manager.allActivities().count(), 0 );
}
void UT_LogsBaseView::testEnsureListPositioning()
@@ -653,7 +673,7 @@
// Content found, no visible items, nop
mRepository->recentCallsView();
- mBaseView->activated(false, QVariant());
+ mBaseView->activated(false, QVariant(), mBaseView->mDialpad->editor().text());
mBaseView->ensureListPositioning(list, false);
QVERIFY( !HbStubHelper::listEnsureVisibleCalled() );
QVERIFY( !HbStubHelper::listScrollBarPolicySet() );
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsdetailsview.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsdetailsview.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -37,6 +37,8 @@
#include <hbgroupbox.h>
#include <dialpad.h>
#include <hbmessagebox.h>
+#include <hblistwidget.h>
+#include <hblistwidgetitem.h>
#include <QGraphicsLinearLayout>
Q_DECLARE_METATYPE(LogsDetailsModel *)
@@ -91,12 +93,11 @@
QVariant arg2 = qVariantFromValue( model2 );
LogsDetailsView* view = mRepository->detailsView();
QVERIFY( !view->mInitialized );
- view->activated(false, arg2);
+ view->activated(false, arg2, view->mDialpad->editor().text());
QVERIFY( view->mInitialized );
QVERIFY(view->mListView);
QVERIFY(view->mDetailsModel == model2);
QVERIFY(view->mListView->model() == model2);
- QVERIFY(view->mActionMap.count() == 4);
LogsDetailsModel* model3 = new LogsDetailsModel();
delete model3->mEvent;
@@ -104,10 +105,10 @@
model3->mEvent = new LogsEvent();
model3->mEvent->mIsPrivate = false;
QVariant arg3 = qVariantFromValue( model3 );
- mDetailsView->activated(false, arg3);
+ mDetailsView->activated(false, arg3, view->mDialpad->editor().text());
QVERIFY( mDetailsView->mDetailsModel == model3);
QVERIFY(view->mListView->model() == model3);
- //QT_NO_DEBUG_OUTPUT
+ delete view;
}
void UT_LogsDetailsView::testDeactivated()
@@ -125,11 +126,12 @@
model->mEvent = 0;
model->mEvent = new LogsEvent();
QVariant arg = qVariantFromValue( model );
- view->activated(false, arg);
+ view->activated(false, arg, view->mDialpad->editor().text());
QVERIFY( view->mListView );
view->deactivated();
QVERIFY( view->mListView );
QVERIFY( !view->mDetailsModel );
+ delete view;
}
void UT_LogsDetailsView::testHandleBackSoftkey()
@@ -152,11 +154,12 @@
model->mEvent = new LogsEvent();
model->mEvent->mEventType = LogsEvent::TypeVoiceCall;
QVariant arg = qVariantFromValue( model );
- mRepository->detailsView();
- mDetailsView->activated(false, arg);
+ LogsDetailsView* view = mRepository->detailsView();
+ mDetailsView->activated(false, arg, mDetailsView->mDialpad->editor().text());
QVERIFY( mDetailsView->mCall );
mDetailsView->callKeyPressed();
QVERIFY( mDetailsView->mCall->mTestLastCallType != -1 );
+ delete view;
}
void UT_LogsDetailsView::testInitiateVoiceCall()
@@ -190,14 +193,14 @@
// No call, call actions disabled
QVERIFY( !mDetailsView->mCall );
- mRepository->detailsView(); // Set correct object tree
+ LogsDetailsView* view = mRepository->detailsView(); // Set correct object tree
LogsDetailsModel* model = new LogsDetailsModel();
delete model->mEvent;
model->mEvent = 0;
model->mEvent = new LogsEvent();
QVariant arg = qVariantFromValue( model );
- mDetailsView->activated(false, arg);
+ mDetailsView->activated(false, arg, mDetailsView->mDialpad->editor().text());
mDetailsView->updateMenu();
QObject* obj = mRepository->findObject( logsDetailsViewVoiceCallMenuActionId );
HbAction* voiceCallAction = qobject_cast<HbAction*>( obj );
@@ -237,6 +240,7 @@
QVERIFY( openContactAction->isVisible() );
QVERIFY( voiceCallAction->isVisible() );
LogsContact::reset();
+ delete view;
}
void UT_LogsDetailsView::testDeleteEventAnswer()
@@ -275,16 +279,21 @@
QVERIFY( LogsDetailsModel::mLastCallName.isEmpty() );
}
-
-
-void UT_LogsDetailsView::testChangeFilter()
+void UT_LogsDetailsView::testHandleViewSwitchSelected()
{
mViewManager->reset();
- HbAction action;
- action.setObjectName(logsShowFilterMissedMenuActionId);
- mDetailsView->changeFilter(&action);
+ QVERIFY( mViewManager->mViewId == LogsUnknownViewId );
+ HbListWidgetItem* item = new HbListWidgetItem();
+ item->setData(QVariant(XQService::LogsViewReceived), Qt::UserRole);
+ mDetailsView->mViewSwitchList = new HbListWidget();
+ mDetailsView->mViewSwitchList->addItem(item);
+
+ mDetailsView->handleViewSwitchSelected(item);
+
QVERIFY( mViewManager->mViewId == LogsRecentViewId );
- QVERIFY( mViewManager->mArgs.toInt() == (int)XQService::LogsViewAll );
+ QVERIFY( mViewManager->mArgs.toInt() == (int)XQService::LogsViewReceived );
+ delete mDetailsView->mViewSwitchList;
+ mDetailsView->mViewSwitchList = 0;
}
void UT_LogsDetailsView::testContactActionCompleted()
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logseffecthandler.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logseffecthandler.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -22,7 +22,7 @@
//SYSTEM
#include <QtTest/QtTest>
#include <hblabel.h>
-#include <hbmainwindow.h>
+#include "logsmainwindow.h"
void UT_LogsEffectHandler::initTestCase()
@@ -36,7 +36,8 @@
void UT_LogsEffectHandler::init()
{
- mEffect = new LogsEffectHandler();
+ mMainWindow = new LogsMainWindow();
+ mEffect = new LogsEffectHandler(*mMainWindow);
mLabel = new HbLabel();
mLabel2 = new HbLabel();
}
@@ -49,6 +50,8 @@
mLabel = 0;
delete mLabel2;
mLabel2 = 0;
+ delete mMainWindow;
+ mMainWindow = 0;
}
void UT_LogsEffectHandler::testConstructor()
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsmatchesview.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsmatchesview.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -68,7 +68,6 @@
QVERIFY( mMatchesView->viewId() == LogsMatchesViewId );
QVERIFY( !mMatchesView->mListView );
QVERIFY( !mMatchesView->mModel );
- QVERIFY( mMatchesView->mActionMap.count() == 0 );
QVERIFY( mMatchesView->mLayoutSectionName == "" );
QVERIFY( !mMatchesView->mAddToContactsButton );
QCOMPARE( mMatchesView->mActivities.at(0), QString(logsActivityIdViewMatches) );
@@ -82,12 +81,10 @@
QVERIFY( !mMatchesView->mInitialized );
QVERIFY( !mMatchesView->mListView );
QVERIFY( !mMatchesView->mModel );
- QVERIFY( mMatchesView->mActionMap.count() == 0 );
- mMatchesView->activated( false,QVariant() );
+ mMatchesView->activated( false,QVariant(), mMatchesView->mDialpad->editor().text() );
QVERIFY( mMatchesView->mInitialized );
QVERIFY( mMatchesView->mListView );
QVERIFY( mMatchesView->mModel );
- QVERIFY( mMatchesView->mActionMap.count() == 4 );
QVERIFY( mMatchesView->mListView->layoutName() == logsListDefaultLayout );
QVERIFY( mMatchesView->mLayoutSectionName == logsViewDefaultSection );
QVERIFY( mMatchesView->mAddToContactsButton );
@@ -96,11 +93,10 @@
//activate once again, model recreated
mMatchesView->mViewManager.mainWindow().setOrientation( Qt::Horizontal );
LogsModel::setMatchesModelCreated(false);
- mMatchesView->activated( true,QVariant() );
+ mMatchesView->activated( true,QVariant(), mMatchesView->mDialpad->editor().text() );
QVERIFY( mMatchesView->mListView );
QVERIFY( mMatchesView->mModel );
QVERIFY( LogsModel::isMatchesModelCreated() ); //model recreated
- QVERIFY( mMatchesView->mActionMap.count() == 4 );
QVERIFY( mMatchesView->mListView->layoutName() == logsListLandscapeDialpadLayout );
QVERIFY( mMatchesView->mLayoutSectionName == logsViewLandscapeDialpadSection );
QVERIFY( !mMatchesView->mAddToContactsButton->isVisible() );
@@ -110,7 +106,7 @@
LogsMatchesModel* model1 = new LogsMatchesModel(*dbConnector);
model1->resetLastCall();
QVariant arg = qVariantFromValue( model1 );
- mMatchesView->activated( true, arg );
+ mMatchesView->activated( true, arg , mMatchesView->mDialpad->editor().text());
QVERIFY( mMatchesView->mListView );
QVERIFY( mMatchesView->mModel == model1 );
QVERIFY( mMatchesView->mModel->mLastCall.isEmpty() );
@@ -118,7 +114,7 @@
LogsMatchesModel* model2 = new LogsMatchesModel(*dbConnector);
model2->resetLastCall();
QVariant arg2 = qVariantFromValue( model2 );
- mMatchesView->activated( true, arg2 );
+ mMatchesView->activated( true, arg2, mMatchesView->mDialpad->editor().text() );
QVERIFY( mMatchesView->mListView );
QVERIFY( mMatchesView->mModel == model2 );
QVERIFY( mMatchesView->mModel->mLastCall.isEmpty() );
@@ -126,7 +122,7 @@
// After passing model as input arg, do not pass model
mMatchesView->mActivating = true;
- mMatchesView->activated( true,QVariant() );
+ mMatchesView->activated( true,QVariant(), mMatchesView->mDialpad->editor().text() );
QVERIFY( mMatchesView->mListView );
QVERIFY( mMatchesView->mModel );
QVERIFY( mMatchesView->mModel->mLastCall == QLatin1String("constructor") );
@@ -218,7 +214,7 @@
{
// Nothing happens if there is no text in dialpad
QVERIFY(!mMatchesView->mContact);
- QCOMPARE(mMatchesView->mDialpad->editor().text().length(), 0);
+ QCOMPARE(mMatchesView->currDialpadText().length(), 0);
mMatchesView->saveNumberInDialpadToContacts();
QVERIFY(!mMatchesView->mContact);
@@ -263,7 +259,7 @@
mMatchesView->dialpadClosed();
- QVERIFY( mMatchesView->mDialpad->editor().text() == hello );
+ QVERIFY( mMatchesView->currDialpadText() == hello );
QVERIFY( mMatchesView->mLayoutSectionName == logsViewDefaultSection );
QVERIFY( !mMatchesView->mAddToContactsButton->isVisible() );
delete view;
@@ -431,7 +427,7 @@
LogsDbConnector* dbConnector = 0;
LogsMatchesModel* model1 = new LogsMatchesModel(*dbConnector);
QVariant arg = qVariantFromValue( model1 );
- view->activated( true, arg );
+ view->activated( true, arg , view->mDialpad->editor().text());
int status = view->mModel->predictiveSearchStatus();
QVERIFY( status == 1 );
@@ -442,7 +438,7 @@
status = view->mModel->predictiveSearchStatus();
QVERIFY( status == 2 );
QVERIFY( mViewManager->mViewId == LogsRecentViewId );
- QVERIFY( mMatchesView->mDialpad->editor().text() == "1234" );
+ QVERIFY( mMatchesView->currDialpadText() == "1234" );
delete view;
}
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsrecentcallsview.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsrecentcallsview.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -43,19 +43,14 @@
#include <hbgroupbox.h>
#include <hbmessagebox.h>
#include <xqaiwdecl.h>
+#include <hblistwidget.h>
+#include <hblistwidgetitem.h>
-#define VERIFY_CHECKED_ACTION( v, actionName ) { \
-QVERIFY( v->mShowFilterMenu );\
-QVERIFY( v->mShowFilterMenu->actions().count() > 0 );\
-QAction* action = 0;\
-foreach ( action, v->mShowFilterMenu->actions() ){ \
- if ( action->objectName() == actionName ){ \
- QVERIFY( action->isChecked() ); \
- } else { \
- QVERIFY( !action->isChecked() ); \
- } \
-}}
-
+#define VERIFY_SELECTED_VIEW( list, viewIndex ) {\
+QVERIFY(list);\
+QVERIFY(list->selectionModel()->selectedIndexes().count() ==1 );\
+QCOMPARE(list->currentItem()->data(Qt::UserRole).toInt(),(int)viewIndex);\
+}
void UT_LogsRecentCallsView::initTestCase()
{
@@ -90,7 +85,6 @@
QVERIFY( !mRecentCallsView->mListView );
QVERIFY( !mRecentCallsView->mFilter );
QVERIFY( mRecentCallsView->mModel );
- QVERIFY( !mRecentCallsView->mShowFilterMenu );
QVERIFY( mRecentCallsView->mCurrentView == XQService::LogsViewAll );
QVERIFY( mRecentCallsView->viewId() == LogsRecentViewId );
QVERIFY( mRecentCallsView->mLayoutSectionName == "" );
@@ -107,16 +101,12 @@
QVERIFY( view );
QVERIFY( !view->mInitialized );
QVERIFY( !view->mFilter );
- QVERIFY( !view->mShowFilterMenu );
QVERIFY( view->mTitleMap.isEmpty() );
- QVERIFY( view->mActionMap.isEmpty() );
view->initView();
QVERIFY( view->mInitialized );
QVERIFY( !view->mFilter );
- QVERIFY( view->mShowFilterMenu );
QVERIFY( view->mTitleMap.count() == 4 );
- QVERIFY( view->mActionMap.count() == 4 );
-
+ delete view;
//TODO: Init twice not allowed
}
@@ -128,50 +118,52 @@
QVERIFY( !view->mInitialized );
QVERIFY( !view->mFilter );
QVERIFY( !view->mEmptyListLabel );
- view->activated(false, QVariant(XQService::LogsViewAll));
+ view->activated(false, QVariant(XQService::LogsViewAll), view->mDialpad->editor().text());
QVERIFY( view->mInitialized );
QVERIFY( view->mFilter );
QVERIFY( view->mEmptyListLabel );
- QVERIFY( !view->mModel->mMissedCallsCounterCleared );
- VERIFY_CHECKED_ACTION( view, logsShowFilterRecentMenuActionId )
+ QVERIFY( view->mModel->mMissedCallsCounterCleared );
+ VERIFY_SELECTED_VIEW(view->mViewSwitchList, XQService::LogsViewAll);
// Change views
- view->activated(false, QVariant(XQService::LogsViewReceived));
+ view->mModel->mMissedCallsCounterCleared = false;
+ view->activated(false, QVariant(XQService::LogsViewReceived), view->mDialpad->editor().text());
QVERIFY( view->mFilter );
QVERIFY( view->mFilter->filterType() == LogsFilter::Received );
QVERIFY( !view->mModel->mMissedCallsCounterCleared );
- VERIFY_CHECKED_ACTION( view, logsShowFilterReceivedMenuActionId )
-
- view->activated(false, QVariant(XQService::LogsViewMissed));
+ VERIFY_SELECTED_VIEW(view->mViewSwitchList, XQService::LogsViewReceived);
+
+ view->activated(false, QVariant(XQService::LogsViewMissed), view->mDialpad->editor().text());
QVERIFY( view->mFilter->filterType() == LogsFilter::Missed );
QVERIFY( view->mModel->mMissedCallsCounterCleared );
- VERIFY_CHECKED_ACTION( view, logsShowFilterMissedMenuActionId )
+ VERIFY_SELECTED_VIEW(view->mViewSwitchList, XQService::LogsViewMissed);
// Change to missed view again, no need to update view, only
// missed call counter updated
view->mModel->mMissedCallsCounterCleared = false;
view->updateFilter(LogsFilter::Received);
- view->activated(false, QVariant(XQService::LogsViewMissed));
+ view->activated(false, QVariant(XQService::LogsViewMissed), view->mDialpad->editor().text());
QVERIFY( view->mFilter->filterType() == LogsFilter::Received );
QVERIFY( view->mModel->mMissedCallsCounterCleared );
view->mModel->mMissedCallsCounterCleared = false;
- view->activated(false, QVariant(XQService::LogsViewCalled));
+ view->activated(false, QVariant(XQService::LogsViewCalled), view->mDialpad->editor().text());
QVERIFY( view->mFilter->filterType() == LogsFilter::Called );
QVERIFY( !view->mModel->mMissedCallsCounterCleared );
- VERIFY_CHECKED_ACTION( view, logsShowFilterDialledMenuActionId )
-
+ VERIFY_SELECTED_VIEW(view->mViewSwitchList, XQService::LogsViewCalled);
+
view->mViewManager.mainWindow().setOrientation( Qt::Horizontal );
view->mDialpad->editor().setText( QString("hello") );
view->mActivating = true;
- view->activated(false, QVariant(XQService::LogsViewAll));
+ view->activated(false, QVariant(XQService::LogsViewAll), view->mDialpad->editor().text());
QVERIFY( view->mFilter->filterType() == LogsFilter::All );
- QVERIFY( !view->mModel->mMissedCallsCounterCleared );
- VERIFY_CHECKED_ACTION( view, logsShowFilterRecentMenuActionId )
- QVERIFY( !view->mDialpad->editor().text().isEmpty() );
+ QVERIFY( view->mModel->mMissedCallsCounterCleared );
+ VERIFY_SELECTED_VIEW(view->mViewSwitchList, XQService::LogsViewAll);
+ QVERIFY( !view->currDialpadText().isEmpty() );
QVERIFY( view->mListView->layoutName() == logsListLandscapeLayout );
QVERIFY( view->mLayoutSectionName == logsViewDefaultSection );
QVERIFY( !view->mActivating );
+ delete view;
}
void UT_LogsRecentCallsView::testDeactivated()
@@ -255,16 +247,21 @@
mRecentCallsView->mViewName = 0;
}
-void UT_LogsRecentCallsView::testChangeFilter()
-{
- mRepository->recentCallsView();
- mRecentCallsView->activated( false, QVariant(XQService::LogsViewAll) );
+void UT_LogsRecentCallsView::testHandleViewSwitchSelected()
+{
+ LogsRecentCallsView* view = mRepository->recentCallsView();
+ mRecentCallsView->initToolbarExtension();
+ mRecentCallsView->activated( false, QVariant(XQService::LogsViewAll), mRecentCallsView->mDialpad->editor().text() );
QVERIFY( mRecentCallsView->mFilter );
QVERIFY( mRecentCallsView->mFilter->filterType() == LogsFilter::All );
+
+ QVERIFY( mRecentCallsView->mViewSwitchList );
+ HbListWidgetItem* item = new HbListWidgetItem();
+ item->setData(QVariant(XQService::LogsViewMissed), Qt::UserRole);
+
+ mRecentCallsView->handleViewSwitchSelected(item);
- HbAction* action = new HbAction();
- action->setObjectName(logsShowFilterMissedMenuActionId);
- mRecentCallsView->changeFilter(action);
+ delete item;
// Scrollbar is disbaled while changing the list and is restored when appearByMoving slot is called
QVERIFY( mRecentCallsView->mListView->verticalScrollBarPolicy() == HbScrollArea::ScrollBarAlwaysOff );
@@ -281,12 +278,8 @@
QVERIFY( !mRecentCallsView->mEmptyListLabel->isVisible() ); // Still hidden as list has data
mRecentCallsView->appearByMovingComplete();
QVERIFY( mRecentCallsView->mListView->verticalScrollBarPolicy() != HbScrollArea::ScrollBarAlwaysOff );
-
- delete action;
- delete mRecentCallsView->mListView;
- mRecentCallsView->mListView = 0;
- delete mRecentCallsView->mViewName;
- mRecentCallsView->mViewName = 0;
+
+ delete view;
}
void UT_LogsRecentCallsView::testInitiateCallback()
@@ -314,7 +307,7 @@
// No any item where to call
LogsCall::resetTestData();
- view->activated( false, QVariant(XQService::LogsViewAll) );
+ view->activated( false, QVariant(XQService::LogsViewAll), view->mDialpad->editor().text() );
view->callKeyPressed();
QVERIFY( LogsCall::lastCalledFunction() != "initiateCallback" );
@@ -359,6 +352,8 @@
view->callKeyPressed();
QVERIFY( !LogsCall::isCallToNumberCalled() );
QVERIFY( LogsCall::lastCalledFunction() == "initiateCallback" );
+
+ delete view;
}
void UT_LogsRecentCallsView::testShowCallDetails()
@@ -427,7 +422,7 @@
{
LogsRecentCallsView* view = mRepository->recentCallsView();
view->setLayoutDirection(Qt::LeftToRight);
- view->activated( false, QVariant(XQService::LogsViewCalled) );
+ view->activated( false, QVariant(XQService::LogsViewCalled), view->mDialpad->editor().text() );
view->mCurrentView = XQService::LogsViewCalled;
view->mAppearingView = XQService::LogsViewCalled;
@@ -519,6 +514,7 @@
QVERIFY(event2.isAccepted(Qt::SwipeGesture));
qDeleteAll(list);
+ delete view;
}
void UT_LogsRecentCallsView::testViewChangeByFlicking()
@@ -528,7 +524,7 @@
// At leftmost list, moving to left not possible
// List not empty, starting list animation
LogsRecentCallsView* view = mRepository->recentCallsView();
- view->activated( false, QVariant(XQService::LogsViewAll) );
+ view->activated( false, QVariant(XQService::LogsViewAll), view->mDialpad->editor().text() );
view->mCurrentView = XQService::LogsViewAll;
QVERIFY(view->model() && view->model()->rowCount()>0);
view->moveBackwardInLists();
@@ -605,17 +601,17 @@
QVERIFY(view->mCurrentView == XQService::LogsViewCalled);
QVERIFY(view->mAppearingView == XQService::LogsViewAll);
QVERIFY(!view->mMoveLeftInList);
-
-
+ delete view;
}
void UT_LogsRecentCallsView::testModel()
{
LogsRecentCallsView* view = mRepository->recentCallsView();
- view->activated(false, QVariant(XQService::LogsViewAll));
+ view->activated(false, QVariant(XQService::LogsViewAll), view->mDialpad->editor().text());
QVERIFY( view->mFilter );
QVERIFY( view->model() == view->mFilter );
+ delete view;
}
void UT_LogsRecentCallsView::testShowListItemMenu()
@@ -731,6 +727,7 @@
QVERIFY( view->mEmptyListLabel );
QVERIFY( !view->mEmptyListLabel->isVisible() );
QVERIFY(action && action->isVisible());
+ delete view;
}
void UT_LogsRecentCallsView::testUpdateMenu()
@@ -764,7 +761,8 @@
view->updateMenu();
QVERIFY(action && action->isVisible());
QVERIFY(addToContactsAction && addToContactsAction->isVisible());
- QVERIFY(contactsSearchAction && contactsSearchAction->isVisible());
+ QVERIFY(contactsSearchAction && contactsSearchAction->isVisible());
+ delete view;
}
@@ -810,6 +808,7 @@
view->mDialpad->editor().setText( hello );
view->updateWidgetsSizeAndLayout();
QVERIFY(action && action->isVisible());
+ delete view;
}
@@ -850,7 +849,7 @@
QString hello("hello");
mRecentCallsView->mDialpad->editor().setText( hello );
mRecentCallsView->dialpadClosed();
- QVERIFY( !mRecentCallsView->mDialpad->editor().text().isEmpty() );
+ QVERIFY( !mRecentCallsView->currDialpadText().isEmpty() );
QVERIFY( mRecentCallsView->mLayoutSectionName == logsViewDefaultSection );
}
@@ -957,13 +956,13 @@
view->toggleContactSearch();
status = view->mModel->predictiveSearchStatus();
QVERIFY( status == 1 );
-
+ delete view;
}
void UT_LogsRecentCallsView::testDialpadOpened()
{
- mRepository->recentCallsView();
- mRecentCallsView->activated( false, QVariant(XQService::LogsViewAll) );
+ LogsRecentCallsView* view = mRepository->recentCallsView();
+ mRecentCallsView->activated( false, QVariant(XQService::LogsViewAll), mRecentCallsView->mDialpad->editor().text() );
// If contact search is disabled, opening dialpad containing input
// does not cause going to matches view
@@ -986,6 +985,7 @@
mRecentCallsView->mDialpad->editor().setText( "" );
mRecentCallsView->dialpadOpened();
QVERIFY( mViewManager->mViewId == LogsUnknownViewId );
+ delete view;
}
void UT_LogsRecentCallsView::testSaveActivity()
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsservicehandler.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsservicehandler.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -18,7 +18,6 @@
//USER
#include "ut_logsservicehandler.h"
#include "logsservicehandler.h"
-#include "logsservicehandlerold.h"
#include "qthighway_stub_helper.h"
#include "ut_logsviewmanager.h"
#include "logsviewmanager.h"
@@ -47,11 +46,10 @@
{
mMainWindow = new LogsMainWindow();
mService = new LogsServiceHandler();
- mServiceOld = new LogsServiceHandlerOld();
char* argv = 0;
int argc = 0;
mSettings = new LogsAppSettings(argc, &argv);
- mLogsViewManager = new LogsViewManager(*mMainWindow, *mService, *mServiceOld, *mSettings);
+ mLogsViewManager = new LogsViewManager(*mMainWindow, *mService, *mSettings);
}
@@ -59,8 +57,6 @@
{
delete mService;
mService = 0;
- delete mServiceOld;
- mServiceOld = 0;
delete mMainWindow;
mMainWindow = 0;
delete mLogsViewManager;
@@ -76,48 +72,11 @@
QVERIFY( mService );
QVERIFY( !mService->mIsAppStartedUsingService );
QVERIFY( !mService->isStartedUsingService() );
-
- QVERIFY( mServiceOld );
- QVERIFY( !mServiceOld->mIsAppStartedUsingService );
- QVERIFY( !mServiceOld->isStartedUsingService() );
-
QtHighwayStubHelper::setIsService(true);
LogsServiceHandler serviceHandler;
QVERIFY( serviceHandler.mIsAppStartedUsingService );
QVERIFY( serviceHandler.isStartedUsingService() );
-
- LogsServiceHandlerOld serviceHandlerOld;
- QVERIFY( serviceHandlerOld.mIsAppStartedUsingService );
- QVERIFY( serviceHandlerOld.isStartedUsingService() );
-}
-
-void UT_LogsServiceHandler::testStart()
-{
- qRegisterMetaType< XQService::LogsViewIndex >("XQService::LogsViewIndex");
- QSignalSpy spy(mServiceOld, SIGNAL(activateView(XQService::LogsViewIndex, bool, QString)));
-
- // Wrong view
- QVERIFY( mServiceOld->start( 9999, true ) != 0 );
- QVERIFY( spy.count() == 0 );
-
- // Correct view
- QVERIFY( mServiceOld->start( (int)XQService::LogsViewReceived, true ) == 0 );
- QVERIFY( spy.count() == 1 );
- XQService::LogsViewIndex view =
- qvariant_cast< XQService::LogsViewIndex >(spy.at(0).at(0));
- QVERIFY( view == XQService::LogsViewReceived );
-}
-
-void UT_LogsServiceHandler::testStartWithNum()
-{
- qRegisterMetaType< XQService::LogsViewIndex >("XQService::LogsViewIndex");
- QSignalSpy spy2(mServiceOld, SIGNAL(activateView(QString)));
-
- QVERIFY( mServiceOld->startWithNum( (int)XQService::LogsViewReceived, true,
- QString("+123456") ) == 0 );
- QVERIFY( spy2.count() == 1 );
- QVERIFY( spy2.at(0).at(0).toString() == QString("+123456"));
}
void UT_LogsServiceHandler::testShow()
--- a/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsviewmanager.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/src/ut_logsviewmanager.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -19,7 +19,6 @@
#include "ut_logsviewmanager.h"
#include "logsviewmanager.h"
#include "logsservicehandler.h"
-#include "logsservicehandlerold.h"
#include "logsmainwindow.h"
#include "logscomponentrepository.h"
#include "logsrecentcallsview.h"
@@ -27,16 +26,18 @@
#include "logsdetailsview.h"
#include "hbstubs_helper.h"
#include "logscontact.h"
+#include "logsmessage.h"
#include "qthighway_stub_helper.h"
#include "hbapplication.h"
#include "logsappsettings.h"
#include "logsforegroundwatcher.h"
+#include "af_stub_helper.h"
//SYSTEM
#include <QtTest/QtTest>
#include <HbView.h>
#include <hbapplication.h>
-#include <hbactivitymanager.h>
+#include <afactivitystorage.h>
#include <dialpad.h>
void UT_LogsViewManager::initTestCase()
@@ -52,11 +53,10 @@
{
mMainWindow = new LogsMainWindow();
mService = new LogsServiceHandler();
- mServiceOld = new LogsServiceHandlerOld();
int argc = 0;
char* argv = 0;
mSettings = new LogsAppSettings(argc, &argv);
- mLogsViewManager = new LogsViewManager(*mMainWindow, *mService, *mServiceOld, *mSettings);
+ mLogsViewManager = new LogsViewManager(*mMainWindow, *mService, *mSettings);
}
void UT_LogsViewManager::cleanup()
@@ -65,8 +65,6 @@
mLogsViewManager = 0;
delete mService;
mService = 0;
- delete mServiceOld;
- mServiceOld = 0;
delete mMainWindow;
mMainWindow = 0;
delete mSettings;
@@ -91,8 +89,8 @@
delete mMainWindow;
mMainWindow = 0;
mMainWindow = new LogsMainWindow();
- HbStubHelper::setActivityReason(Hb::ActivationReasonActivity);
- mLogsViewManager = new LogsViewManager(*mMainWindow, *mService, *mServiceOld, *mSettings);
+ AfStubHelper::setActivityReason(Af::ActivationReasonActivity);
+ mLogsViewManager = new LogsViewManager(*mMainWindow, *mService, *mSettings);
QVERIFY( mLogsViewManager->mComponentsRepository );
QVERIFY( static_cast<LogsBaseView*>( mLogsViewManager->mMainWindow.currentView() )->viewId() == LogsRecentViewId );
QVERIFY( mLogsViewManager->mViewStack.count() == 1 );
@@ -103,11 +101,11 @@
delete mMainWindow;
mMainWindow = 0;
mMainWindow = new LogsMainWindow();
- HbStubHelper::setActivityReason(Hb::ActivationReasonNormal);
+ AfStubHelper::setActivityReason(Af::ActivationReasonNormal);
QtHighwayStubHelper::setIsService(true);
LogsServiceHandler* handler2 = new LogsServiceHandler();
mLogsViewManager->mComponentsRepository->model()->mRefreshCalled = false;
- mLogsViewManager = new LogsViewManager(*mMainWindow, *handler2, *mServiceOld, *mSettings);
+ mLogsViewManager = new LogsViewManager(*mMainWindow, *handler2, *mSettings);
QVERIFY( mLogsViewManager->mComponentsRepository );
QVERIFY( static_cast<LogsBaseView*>( mLogsViewManager->mMainWindow.currentView() )->viewId() == LogsRecentViewId );
QVERIFY( mLogsViewManager->mViewStack.count() == 0 ); // Waiting for signal
@@ -123,7 +121,7 @@
mMainWindow = 0;
mMainWindow = new LogsMainWindow();
mLogsViewManager->mComponentsRepository->model()->mRefreshCalled = false;
- mLogsViewManager = new LogsViewManager(*mMainWindow, *mService, *mServiceOld, *mSettings);
+ mLogsViewManager = new LogsViewManager(*mMainWindow, *mService, *mSettings);
QVERIFY( mLogsViewManager->mComponentsRepository );
QVERIFY( static_cast<LogsBaseView*>( mLogsViewManager->mMainWindow.currentView() )->viewId() == LogsRecentViewId );
QVERIFY( mLogsViewManager->mViewStack.count() == 0 ); // Waiting for coming to foreground
@@ -162,7 +160,7 @@
mLogsViewManager->mComponentsRepository->detailsView() );
// Go back to previous view
- QVERIFY( mLogsViewManager->activatePreviousView() );
+ QVERIFY( mLogsViewManager->activatePreviousView(mLogsViewManager->mComponentsRepository->dialpad()->isOpen(), mLogsViewManager->mComponentsRepository->dialpad()->editor().text()) );
QVERIFY( mLogsViewManager->mMainWindow.views().count() == 2 );
QVERIFY( mLogsViewManager->mMainWindow.currentView() ==
mLogsViewManager->mComponentsRepository->recentCallsView() );
@@ -193,8 +191,10 @@
QtHighwayStubHelper::reset();
QVERIFY( mLogsViewManager->mViewStack.count() );
mLogsViewManager->mViewStack.at(0)->mContact = new LogsContact();
+ mLogsViewManager->mViewStack.at(0)->mMessage = new LogsMessage();
mLogsViewManager->changeMatchesViewViaService(QString("+123456"));
QVERIFY( LogsContact::mServiceRequestCanceled );
+ QVERIFY( LogsMessage::mServiceRequestCanceled );
QVERIFY( HbStubHelper::isWidgetRaised() );
//Open Matches view, view stack is empty, embedded service not canceled
@@ -212,7 +212,7 @@
QString dialString("+123456777");
mLogsViewManager->changeRecentViewViaService(XQService::LogsViewCalled, false, dialString);
QVERIFY( mLogsViewManager->mMainWindow.currentView() ==
- mLogsViewManager->mComponentsRepository->recentCallsView() );
+ mLogsViewManager->mComponentsRepository->matchesView() );
QVERIFY( mLogsViewManager->mComponentsRepository->mDialpad->mLineEdit->text() == dialString );
QVERIFY( HbStubHelper::isWidgetRaised() );
@@ -273,15 +273,15 @@
HbStubHelper::reset();
mLogsViewManager->mComponentsRepository->model()->mCompressCalled = false;
QtHighwayStubHelper::reset();
- HbApplication* app = static_cast<HbApplication*>( qApp );
- QCOMPARE( app->activityManager()->activities().count(), 0 );
+ AfStubHelper::reset();
+ QCOMPARE( mLogsViewManager->mActivityManager->allActivities().count(), 0 );
mLogsViewManager->exitApplication();
QVERIFY( !HbStubHelper::quitCalled() );
QVERIFY( QtHighwayStubHelper::utilToBackground() );
QVERIFY( mLogsViewManager->mComponentsRepository->model()->mCompressCalled );
QVERIFY( HbStubHelper::isTsTaskVisibilitySet() );
QVERIFY( !HbStubHelper::tsTaskVisibility() );
- QCOMPARE( app->activityManager()->activities().count(), 1 );
+ QCOMPARE( mLogsViewManager->mActivityManager->allActivities().count(), 1 );
}
@@ -292,9 +292,8 @@
LogsMainWindow window;
window.setCurrentView(0); // clear stub static data
LogsServiceHandler service;
- LogsServiceHandlerOld serviceOld;
service.mIsAppStartedUsingService = true;
- LogsViewManager vm(window, service, serviceOld, *mSettings);
+ LogsViewManager vm(window, service, *mSettings);
QVERIFY( vm.mComponentsRepository );
QVERIFY( vm.mMainWindow.views().count() == 0 );
QVERIFY( vm.mMainWindow.currentView() == 0 );
@@ -320,67 +319,67 @@
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 );
+ AfStubHelper::reset();
+ AfStubHelper::setActivityReason(Af::ActivationReasonActivity);
+ AfActivityStorage* afManager = mLogsViewManager->mActivityManager;
+ QCOMPARE( afManager->allActivities().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 );
+ QCOMPARE( afManager->allActivities().count(), 1 );
+ QVERIFY( !afManager->activityMetaData(QString()).value(logsActivityParamShowDialpad).toBool() );
+ QVERIFY( afManager->activityMetaData(QString()).value(logsActivityParamDialpadText).toString().isEmpty() );
+ QCOMPARE( afManager->activityMetaData(QString()).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 );
+ QCOMPARE( afManager->allActivities().count(), 1 );
+ QVERIFY( afManager->activityMetaData(QString()).value(logsActivityParamShowDialpad).toBool() );
+ QCOMPARE( afManager->activityMetaData(QString()).value(logsActivityParamDialpadText).toString(), QString("12345") );
+ QCOMPARE( afManager->activityMetaData(QString()).value(logsActivityParamInternalViewId).toInt(), (int)LogsMatchesViewId );
// No views, nothing to save
mLogsViewManager->mViewStack.clear();
mLogsViewManager->saveActivity();
- QCOMPARE( manager->activities().count(), 1 );
+ QCOMPARE( afManager->allActivities().count(), 1 );
}
void UT_LogsViewManager::testLoadActivity()
{
+ AfStubHelper::reset();
+ AfActivityStorage* afManager = mLogsViewManager->mActivityManager;
mLogsViewManager->mComponentsRepository->mModel->mPredectiveSearchStatus = 1;
- HbStubHelper::setActivityReason(Hb::ActivationReasonActivity);
- HbApplication* hbApp = static_cast<HbApplication*>(qApp);
- HbActivityManager* manager = hbApp->activityManager();
+ AfStubHelper::setActivityReason(Af::ActivationReasonActivity);
// View activity loaded, no dialpad shown, nor text in it
- HbStubHelper::setActivityId(logsActivityIdViewRecent);
+ AfStubHelper::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);
+ afManager->saveActivity(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());
+ AfStubHelper::setActivityId(logsActivityIdViewMatches);
+ afManager->removeActivity(QString());
QVariantHash params2;
params2.insert(logsActivityParamShowDialpad, true);
params2.insert(logsActivityParamDialpadText, QString("33333"));
params.insert(logsActivityParamInternalViewId, LogsMatchesViewId);
- manager->addActivity(QString(), QVariant(), params2);
+ afManager->saveActivity(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");
+ AfStubHelper::setActivityId("unknownActivity");
QVERIFY( !mLogsViewManager->loadActivity() );
}
@@ -425,23 +424,23 @@
void UT_LogsViewManager::testActivityRequested()
{
- HbApplication* hbApp = static_cast<HbApplication*>(qApp);
- HbActivityManager* manager = hbApp->activityManager();
-
HbStubHelper::reset();
- HbStubHelper::setActivityId("unknownActivity");
- mLogsViewManager->activityRequested("unknownActivity");
+ AfStubHelper::reset();
+ AfStubHelper::setActivityId("unknownActivity");
+ mLogsViewManager->activityRequested(
+ Af::ActivationReasonActivity, "unknownActivity", QVariantHash());
QVERIFY( !HbStubHelper::isWidgetRaised() );
- HbStubHelper::setActivityId(logsActivityIdViewRecent);
+ AfStubHelper::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);
- mLogsViewManager->activityRequested(logsActivityIdViewRecent);
+ mLogsViewManager->mActivityManager->saveActivity(QString(), QVariant(), params);
+ mLogsViewManager->activityRequested(
+ Af::ActivationReasonActivity, logsActivityIdViewRecent, QVariantHash());
QVERIFY( static_cast<LogsBaseView*>( mLogsViewManager->mMainWindow.currentView() )->viewId() == LogsRecentViewId );
QVERIFY( !mLogsViewManager->mComponentsRepository->dialpad()->mIsOpen );
QCOMPARE( mLogsViewManager->mComponentsRepository->dialpad()->mLineEdit->text(), QString("") );
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/af_stub_helper.h Fri Oct 15 14:47:48 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* 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 AF_STUB_HELPER_H
+#define AF_STUB_HELPER_H
+
+#include <afactivities_global.h>
+
+/**
+* Helper class to control stub behavior
+*
+*/
+class AfStubHelper
+{
+ public:
+ static void reset();
+ static void setActivityReason(Af::ActivationReason reason);
+ static void setActivityId(QString activityId);
+};
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/afactivation.h Fri Oct 15 14:47:48 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* 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 AFACTIVATION_H
+#define AFACTIVATION_H
+
+#include <QObject>
+#include <QString>
+#include <QStringList>
+#include <QVariant>
+#include <afactivities_global.h>
+
+class AfActivation : public QObject
+{
+ Q_OBJECT
+
+public:
+ AfActivation(QObject *parent = 0);
+
+signals:
+ void activated(Af::ActivationReason reason, QString name, QVariantHash parameters);
+
+public slots:
+ QVariantHash parameters() const;
+ Af::ActivationReason reason() const;
+ QString name() const;
+
+};
+
+#endif // AFACTIVATION_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/afactivities_global.h Fri Oct 15 14:47:48 2010 +0300
@@ -0,0 +1,29 @@
+/*
+ * 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 AFACTIVITIES_GLOBAL_H
+#define AFACTIVITIES_GLOBAL_H
+
+namespace Af {
+ enum ActivationReason {
+ ActivationReasonActivity = 0,
+ ActivationReasonService,
+ ActivationReasonNormal
+ };
+}
+
+#endif // AFACTIVITIES_GLOBAL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/afactivityfw_stub.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2008-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 <afactivation.h>
+#include <afactivitystorage.h>
+#include "af_stub_helper.h"
+
+QHash <QString, QVariantHash> testActivities;
+Af::ActivationReason testActivationReason = Af::ActivationReasonNormal;
+QString testActivityId = "LogsViewMatches";
+
+void AfStubHelper::reset()
+{
+ testActivationReason = Af::ActivationReasonNormal;
+ testActivityId = "LogsViewMatches";
+ testActivities.clear();
+}
+
+void AfStubHelper::setActivityReason(Af::ActivationReason reason)
+{
+ testActivationReason = reason;
+}
+
+void AfStubHelper::setActivityId(QString activityId)
+{
+ testActivityId = activityId;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+AfActivation::AfActivation(QObject *parent) : QObject(parent)
+{
+
+}
+
+QVariantHash AfActivation::parameters() const
+{
+ return QVariantHash();
+}
+Af::ActivationReason AfActivation::reason() const
+{
+ return testActivationReason;
+}
+
+QString AfActivation::name() const
+{
+ return testActivityId;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+AfActivityStorage::AfActivityStorage(QObject *parent) : QObject(parent)
+{
+
+}
+
+AfActivityStorage::~AfActivityStorage()
+{
+
+}
+
+bool AfActivityStorage::saveActivity(
+ const QString &activityId, const QVariant &activityData, const QVariantHash &metadata)
+{
+ Q_UNUSED( activityData );
+ testActivities.insert(activityId, metadata);
+ return true;
+}
+
+bool AfActivityStorage::removeActivity(const QString &activityId)
+{
+ if ( !testActivities.isEmpty() ){
+ testActivities.remove(activityId);
+ }
+ return true;
+}
+
+QStringList AfActivityStorage::allActivities() const
+{
+ QStringList activities;
+ QHash<QString, QVariantHash>::const_iterator it;
+ for (it = testActivities.begin(); it != testActivities.end(); ++it){
+ activities.append( it.key() );
+ }
+ return activities;
+}
+
+QVariant AfActivityStorage::activityData(const QString &activityId) const
+{
+ Q_UNUSED( activityId );
+ return QVariant();
+}
+
+QVariantHash AfActivityStorage::activityMetaData(const QString &activityId) const
+{
+ Q_UNUSED( activityId );
+ if ( !testActivities.isEmpty() ){
+ return testActivities.begin().value();
+ }
+ return QVariantHash();
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/afactivitystorage.h Fri Oct 15 14:47:48 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* 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 AFACTIVITYSTORAGE_H
+#define AFACTIVITYSTORAGE_H
+
+#include <QString>
+#include <QStringList>
+#include <QVariant>
+#include <QScopedPointer>
+#include <afactivities_global.h>
+
+class AfActivityStorage : public QObject
+{
+ Q_OBJECT
+
+public:
+ AfActivityStorage(QObject *parent = 0);
+ virtual ~AfActivityStorage();
+
+public slots:
+ bool saveActivity(const QString &activityId, const QVariant &activityData, const QVariantHash &metadata);
+ bool removeActivity(const QString &activityId);
+
+ QStringList allActivities() const;
+
+ QVariant activityData(const QString &activityId) const;
+ QVariantHash activityMetaData(const QString &activityId) const;
+
+};
+
+#endif // AFACTIVITYSTORAGE_H
--- a/logsui/logsapp/tsrc/ut_logsapp/stubs/hbapplication.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/hbapplication.h Fri Oct 15 14:47:48 2010 +0300
@@ -22,19 +22,11 @@
#include <qapplication.h>
#include <hbnamespace.h>
-class HbActivityManager;
-
class HbApplication : public QApplication
{
public:
HbApplication(int &/*argc*/, char */*argv*/[], Hb::ApplicationFlags flags = Hb::DefaultApplicationFlags);
- ~HbApplication();
-
- HbActivityManager *activityManager();
- Hb::ActivationReason activateReason() const;
- QVariantHash activateParams() const;
- QString activateId() const;
- QVariant activateData();
+ ~HbApplication();
static void quit();
--- a/logsui/logsapp/tsrc/ut_logsapp/stubs/hbstubs.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/hbstubs.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -24,7 +24,6 @@
#include <hbapplication.h>
#include <hbcolorscheme.h>
#include <hbview.h>
-#include <hbactivitymanager.h>
#include <QCoreApplication>
#include <QApplication>
#include <QTimer>
@@ -54,10 +53,6 @@
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;
@@ -85,9 +80,6 @@
testIsWidgetRaised = false;
testDialogShown = false;
testColor = Qt::white;
- testActivationReason = Hb::ActivationReasonNormal;
- testActivityId = "LogsViewMatches";
- testActivities.clear();
qDeleteAll(testViewItems);
testViewItems.clear();
testScrollToCalled = false;
@@ -164,16 +156,6 @@
testColor = col;
}
-void HbStubHelper::setActivityReason(Hb::ActivationReason reason)
-{
- testActivationReason = reason;
-}
-
-void HbStubHelper::setActivityId(QString activityId)
-{
- testActivityId = activityId;
-}
-
QList<HbListViewItem*>& HbStubHelper::listItems()
{
return testViewItems;
@@ -317,42 +299,6 @@
//
// -----------------------------------------------------------------------------
//
-HbActivityManager::HbActivityManager(QObject *parent) : QObject(parent)
-{
-
-}
-HbActivityManager::~HbActivityManager()
-{
-
-}
-
-bool HbActivityManager::addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters)
-{
- testActivities.append(parameters);
- return true;
-}
-
-bool HbActivityManager::removeActivity(const QString &activityId)
-{
- if ( !testActivities.isEmpty() ){
- testActivities.takeFirst();
- }
- return true;
-}
-QList<QVariantHash> HbActivityManager::activities() const
-{
- return testActivities;
-}
-
-bool HbActivityManager::waitActivity()
-{
- return true;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
HbApplication::HbApplication(int &argc, char *argv[], Hb::ApplicationFlags flags) :
QApplication(0, argc, argv, 0), mTestFlags(flags)
{
@@ -366,28 +312,6 @@
{
testQuitCalled = true;
}
-
-HbActivityManager *HbApplication::activityManager()
-{
- return &testActivityManager;
-}
-
-Hb::ActivationReason HbApplication::activateReason() const
-{
- return testActivationReason;
-}
-QVariantHash HbApplication::activateParams() const
-{
- return QVariantHash();
-}
-QString HbApplication::activateId() const
-{
- return testActivityId;
-}
-QVariant HbApplication::activateData()
-{
- return QVariant();
-}
// -----------------------------------------------------------------------------
//
--- a/logsui/logsapp/tsrc/ut_logsapp/ut_logsapp.pro Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsapp/tsrc/ut_logsapp/ut_logsapp.pro Fri Oct 15 14:47:48 2010 +0300
@@ -44,6 +44,9 @@
HEADERS += ./stubs/xqsettingsmanager.h
HEADERS += ./stubs/tstasksettings.h
HEADERS += ./stubs/hbapplication.h
+HEADERS += ./stubs/afactivation.h
+HEADERS += ./stubs/afactivitystorage.h
+HEADERS += ./stubs/afactivities_global.h
HEADERS += inc/ut_logsmainwindow.h
HEADERS += inc/ut_logscomponentrepository.h
HEADERS += inc/ut_logsviewmanager.h
@@ -67,7 +70,6 @@
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
@@ -109,7 +111,6 @@
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
@@ -122,6 +123,7 @@
SOURCES += ./stubs/dialpad_stub.cpp
SOURCES += ./stubs/dialpadkeyhandler_stub.cpp
SOURCES += ./stubs/xqsettingsmanager_stub.cpp
+SOURCES += ./stubs/afactivityfw_stub.cpp
symbian: {
TARGET.UID2 = 0x100039CE
@@ -130,6 +132,8 @@
TARGET.EPOCALLOWDLLDATA = 1
LIBS += -lxqservice -lxqserviceutil -lxqkeycapture -lapparc -lcone
MMP_RULES += SMPSAFE
+ CONFIG += symbian_test
+ coverage: CONFIG -= symbian_test
}
DOCML += ../../resources/recentCallsView.docml
--- a/logsui/logscntfinder/inc/logscntentry.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/inc/logscntentry.h Fri Oct 15 14:47:48 2010 +0300
@@ -22,18 +22,17 @@
#include <QObject>
#include <QList>
#include <QString>
-
+#include "logspredictivetranslator.h"
class LogsCntEntry;
typedef QObject LogsCntEntryHandle;
-class LogsCntText
+class LogsCntText : public LogsCntToken
{
+
public:
-
inline LogsCntText() : mHighlights(0){}
- inline const QString& text() const {return mText;}
inline int highlights() const {return mHighlights;}
LOGSCNTFINDER_EXPORT QString richText( QString startTag = QString("<b><u>"),
QString endTag = QString("</u></b>")) const;
@@ -41,8 +40,6 @@
private:
- QString mText;
- QString mTranslatedText;
int mHighlights;
friend class LogsCntEntry;
@@ -91,8 +88,6 @@
void doSetHighlights( const QString& patternItem, QMutableListIterator<LogsCntText>& names );
void resetHighlights( LogsCntTextList& nameArray );
- bool doSimpleMatch( const QString& pattern ) const;
- bool doComplexMatch( const QStringList& patternArray ) const;
int startsWith( const LogsCntText& nameItem, const QString& pattern ) const;
private:
--- a/logsui/logscntfinder/inc/logspredictive12keytranslator.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/inc/logspredictive12keytranslator.h Fri Oct 15 14:47:48 2010 +0300
@@ -24,6 +24,9 @@
#include "logspredictivetranslator.h"
+const char StarKey = '*';
+const char HashKey = '#';
+
/**
* abstract translator for ITU-T 12 keys keyboard
@@ -38,10 +41,9 @@
public: //from LogsPredictiveTranslator
- QStringList patternTokens( const QString& pattern ) const;
- int hasPatternSeparators( const QString& pattern ) const;
- const QChar translateChar( const QChar character ) const;
- QString& trimPattern( QString& pattern, bool tailOnly ) const;
+ bool match( const QString& pattern,
+ LogsCntTokenIterator& names ) const;
+ const QString translateChar( const QChar character ) const;
protected:
@@ -49,8 +51,8 @@
private:
- void splitPattern( const QString& pattern, QString& car, QString& cdr ) const;
-
+ bool doSimpleMatch( const QString& pattern, LogsCntTokenIterator& names ) const;
+ bool doComplexMatch( const QStringList& patternArray, LogsCntTokenIterator& names ) const;
private:
--- a/logsui/logscntfinder/inc/logspredictivelatin12keytranslator.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/inc/logspredictivelatin12keytranslator.h Fri Oct 15 14:47:48 2010 +0300
@@ -18,12 +18,9 @@
#ifndef LOGSPREDICTIVELATIN12KEYTRANSLATOR_H
#define LOGSPREDICTIVELATIN12KEYTRANSLATOR_H
-#include <QObject>
-#include <QChar>
+#include "logspredictive12keytranslator.h"
#include <QHash>
-#include "logspredictive12keytranslator.h"
-class HbInputLanguage;
//Name: ISO_8859-1:1987 [RFC1345,KXS2]
//MIBenum: 4
@@ -45,18 +42,18 @@
public: //from LogsPredictiveTranslator
+ QStringList patternTokens( const QString& pattern ) const;
+ int hasPatternSeparators( const QString& pattern ) const;
+ QString& trimPattern( QString& pattern, bool tailOnly ) const;
QStringList nameTokens( const QString& name ) const;
inline int mib() const {return MIBenumLatin;}
-
-
-public: //from LogsPredictive12KeyTranslator
-
- const QChar translateChar( const QChar character, bool& ok ) const;
+ const QString translateChar( const QChar character, bool& ok ) const;
private:
void createSpecialMapping();
-
+ void splitPattern( const QString& pattern, QString& car, QString& cdr ) const;
+
private:
QHash<QChar,QChar> mSpecialKeyMap;
--- a/logsui/logscntfinder/inc/logspredictivethai12keytranslator.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/inc/logspredictivethai12keytranslator.h Fri Oct 15 14:47:48 2010 +0300
@@ -18,15 +18,8 @@
#ifndef LOGSPREDICTIVETHAI12KEYTRANSLATOR_H
#define LOGSPREDICTIVETHAI12KEYTRANSLATOR_H
-#include <QObject>
-#include <QChar>
-#include <QHash>
-
#include "logspredictive12keytranslator.h"
-class HbKeymap;
-class HbInputLanguage;
-
//Name: TIS-620
//MIBenum: 2259
@@ -50,8 +43,11 @@
public: //from LogsPredictiveTranslator
- const QChar translateChar( const QChar character, bool& ok ) const;
+ QStringList patternTokens( const QString& pattern ) const;
+ int hasPatternSeparators( const QString& pattern ) const;
+ QString& trimPattern( QString& pattern, bool tailOnly ) const;
QStringList nameTokens( const QString& name ) const;
+ const QString translateChar( const QChar character, bool& ok ) const;
inline int mib() const {return MIBenumThai;}
private:
--- a/logsui/logscntfinder/inc/logspredictivetranslator.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/inc/logspredictivetranslator.h Fri Oct 15 14:47:48 2010 +0300
@@ -22,9 +22,45 @@
#include <QChar>
#include <QList>
+
+
+class LogsCntToken
+{
+public:
+
+ const QString& text() const {return mText;}
+ const QString& translation() const {return mTranslatedText;}
+
+protected:
+
+ QString mText;
+ QString mTranslatedText;
+
+};
+
+typedef QList<LogsCntToken> LogsCntTokenArray;
+
+class LogsCntTokenIterator : public QListIterator<LogsCntToken>
+{
+public:
+
+ inline LogsCntTokenIterator( LogsCntTokenArray& container )
+ : QListIterator<LogsCntToken>( container ), mCount( container.count() ) {}
+ inline int count() const {return mCount;}
+
+private:
+
+ int mCount;
+
+};
+
+
class HbKeymap;
class HbInputLanguage;
+
+
+
/**
* predictive translator. Singelton
*
@@ -36,26 +72,32 @@
static LogsPredictiveTranslator* instance();
static void deleteInstance();
+ static HbInputLanguage currentLanguage();
~LogsPredictiveTranslator();
- const QString translatePattern( const QString& pattern ) const;
+ virtual const QString preparePattern( const QString& pattern ) const;
const QString translateText( const QString& text );
public: //abstracts
- virtual QStringList nameTokens( const QString& name ) const = 0;
+ virtual bool match( const QString& pattern,
+ LogsCntTokenIterator& names ) const = 0;
+
virtual QStringList patternTokens( const QString& pattern ) const = 0;
virtual QString& trimPattern( QString& pattern, bool tailOnly = false ) const = 0;
+ virtual QStringList nameTokens( const QString& name ) const = 0;
virtual int hasPatternSeparators( const QString& pattern ) const = 0;
- virtual const QChar translateChar( const QChar character, bool& ok ) const = 0;
virtual int mib() const = 0;
protected:
+ virtual const QString translateChar( const QChar character, bool& ok ) const = 0;
+
explicit LogsPredictiveTranslator( const HbInputLanguage& lang );
bool encodes( const QString& sniplet );
const QString translate( const QString& text, bool* ok = 0, int count = -1 ) const;
+ inline virtual void* keyMap() const { return (void*)mKeyMap; }
private:
--- a/logsui/logscntfinder/logscntfinder.pro Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/logscntfinder.pro Fri Oct 15 14:47:48 2010 +0300
@@ -26,8 +26,6 @@
INCLUDEPATH += ../inc
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-DEFINES += QT_NO_DEBUG_OUTPUT
-
# Input
HEADERS += inc/logscntfinder.h
HEADERS += inc/logscntentry.h
--- a/logsui/logscntfinder/src/logscntentry.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/src/logscntentry.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -356,97 +356,23 @@
//
bool LogsCntEntry::match( const QString& pattern ) const
{
- bool match = false;
+ bool match = false;
if ( pattern.length() > 0 ) {
- LogsPredictiveTranslator* translator = LogsPredictiveTranslator::instance();
-
- QString modifiedPattern = pattern;
- modifiedPattern = translator->trimPattern( modifiedPattern, true );
+
+ match = type() == EntryTypeHistory &&
+ mPhoneNumber.mTranslatedText.startsWith( pattern );
- //direct match with phone number is enough
- match = ( type() == EntryTypeHistory &&
- mPhoneNumber.mTranslatedText.startsWith( pattern ) ) ||
- doSimpleMatch( modifiedPattern );
-
- if (!match && translator->hasPatternSeparators( modifiedPattern ) ) {
- QStringList patternArray = translator->patternTokens( modifiedPattern );
- match = doComplexMatch( patternArray );
- if (!match ) {
- for(int i=0;i<patternArray.length();i++ ) {
- translator->trimPattern( patternArray[i] );
- }
- match = doComplexMatch( patternArray );
- }
+ if ( !match ) {
+ LogsCntTextList nameArray = mFirstName + mLastName; //with empties
+ LogsCntTokenArray* tokenArray = reinterpret_cast<LogsCntTokenArray*>( &nameArray );
+ LogsCntTokenIterator names( *tokenArray );
+ match = LogsPredictiveTranslator::instance()->match( pattern, names );
}
}
return match;
}
-// -----------------------------------------------------------------------------
-// LogsCntEntry::doSimpleMatch()
-// -----------------------------------------------------------------------------
-//
-bool LogsCntEntry::doSimpleMatch( const QString& pattern ) const
-{
- LogsCntTextList nameArray = mFirstName + mLastName; //with empties
- QListIterator<LogsCntText> names( nameArray );
- int matchCount = 0;
-
- while( names.hasNext() && !matchCount ) {
- matchCount = (int)names.next().mTranslatedText.startsWith( pattern );
- }
-
- return matchCount > 0;
-}
-
-
-// -----------------------------------------------------------------------------
-// LogsCntEntry::doComplexMatch()
-// -----------------------------------------------------------------------------
-//
-bool LogsCntEntry::doComplexMatch( const QStringList& patternArray ) const
-{
- const bool zero = false;
-
- LogsCntTextList nameArray = mFirstName + mLastName; //with empties
-
- int targetMatchCount = patternArray.count();
- int namesCount = nameArray.count();
-
- //if pattern has more tokens than name(s), it is a missmatch
- if ( namesCount < targetMatchCount ) {
- return false;
- }
-
- QListIterator<LogsCntText> names( nameArray );
- QListIterator<QString> patterns( patternArray );
- QVector<bool> matchVector(targetMatchCount, zero );
- int currentPattern = 0;
- int matchCount = 0;
- bool match = false;
-
- while( names.hasNext() && matchCount < targetMatchCount ) {
- LogsCntText name = names.next();
- currentPattern = 0;
- patterns.toFront();
- match = false;
- while ( !name.mText.isEmpty() &&
- patterns.hasNext() && !match ) {
- QString pattern = patterns.next();
- //unique match check
- if ( !matchVector.at( currentPattern ) ) {
- match = matchVector[ currentPattern ]
- = name.mTranslatedText.startsWith( pattern );
- matchCount = match ? matchCount+1 : matchCount;
- }
- currentPattern++;
- }
- }
- return matchCount >= targetMatchCount;
-
- }
-
// -----------------------------------------------------------------------------
--- a/logsui/logscntfinder/src/logscntfinder.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/src/logscntfinder.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -274,7 +274,7 @@
LogsPredictiveTranslator::instance();
mCurrentInputPattern = pattern;
- mCurrentPredictivePattern = translator->translatePattern( mCurrentInputPattern );
+ mCurrentPredictivePattern = translator->preparePattern( mCurrentInputPattern );
}
// -----------------------------------------------------------------------------
@@ -351,7 +351,8 @@
void LogsCntFinder::insertEntry( int index, LogsCntEntry* entry )
{
LOGS_QDEBUG( "logs [FINDER] -> LogsCntFinder::insertEntry()" )
- LOGS_QDEBUG_4( "logs [FINDER] handle=", entry->handle()," to index ", index )
+ LOGS_QDEBUG_4( "logs [FINDER] handle=", (entry ?
+ (long)entry->handle() : 0 ),"to index ", index )
mHistoryEvents.insert( index, entry );
@@ -376,7 +377,7 @@
const LogsCntEntryHandle& handle ) const
{
LOGS_QDEBUG( "logs [FINDER] -> LogsCntFinder::doGetEntry()" )
- LOGS_QDEBUG_2( "logs [FINDER] handle= ", &handle )
+ LOGS_QDEBUG_2( "logs [FINDER] handle= ", (long)&handle )
LogsCntEntry* entry = 0;
QListIterator<LogsCntEntry*> iter(list);
@@ -398,7 +399,7 @@
void LogsCntFinder::deleteEntry( const LogsCntEntryHandle& handle )
{
LOGS_QDEBUG( "logs [FINDER] -> LogsCntFinder::deleteEntry()" )
- LOGS_QDEBUG_2( "logs [FINDER] handle= ", &handle )
+ LOGS_QDEBUG_2( "logs [FINDER] handle= ", (long)&handle )
LogsCntEntry* toRemoveHistoryEv = doGetEntry( mHistoryEvents, handle );
mHistoryEvents.removeOne( toRemoveHistoryEv );
--- a/logsui/logscntfinder/src/logspredictive12keytranslator.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/src/logspredictive12keytranslator.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -25,8 +25,6 @@
#include "logspredictive12keytranslator.h"
#include "logslogger.h"
-const QChar ZeroSepar('0');
-const int NotAssigned = -1;
// -----------------------------------------------------------------------------
// LogsPredictive12KeyTranslator::LogsPredictive12KeyTranslator()
@@ -56,117 +54,114 @@
}
-// -----------------------------------------------------------------------------
-// LogsPredictive12KeyTranslator::patternTokens()
-// -----------------------------------------------------------------------------
-//
-QStringList LogsPredictive12KeyTranslator::patternTokens( const QString& pattern ) const
-{
-
- LOGS_QDEBUG( "logs [FINDER] -> LogsPredictive12KeyTranslator::\
-patternTokens()" )
- LOGS_QDEBUG_2( "logs [FINDER] pattern ", pattern );
- QString car;
- QString cdr;
-
- QStringList target;
- splitPattern( pattern, car, cdr );
- if ( car.length() ) {
- target.append( car );
- if ( cdr.length() ) {
- target.append( cdr );
- }
- }
- LOGS_QDEBUG( "logs [FINDER] <- LogsPredictive12KeyTranslator::\
-patternTokens()" )
- return target;
-}
-
-// -----------------------------------------------------------------------------
-// LogsPredictive12KeyTranslator::splitPattern()
-// -----------------------------------------------------------------------------
-//
-void LogsPredictive12KeyTranslator::splitPattern( const QString& pattern,
- QString& car, QString& cdr ) const
-{
- car = "";
- cdr = "";
-
- QChar current;
- QChar previous;
- int splitStart = NotAssigned;
- int splitEnd = NotAssigned;
- int index = 0;
- while( splitEnd == NotAssigned && index < pattern.length() ) {
- current = pattern[index];
- splitStart = splitStart == NotAssigned &&
- ( previous != ZeroSepar && previous != QChar() ) &&
- current == ZeroSepar ?
- index : splitStart;
- splitEnd = splitStart != NotAssigned &&
- previous == ZeroSepar &&
- current != ZeroSepar ?
- index : splitEnd;
- previous = current;
- index++;
- }
-
- if ( splitStart != NotAssigned && splitEnd != NotAssigned ) {
- car = pattern.left( splitStart );
- cdr = pattern.right( pattern.length() - splitEnd );
- } else {
- car = pattern;
- }
-}
-
-// -----------------------------------------------------------------------------
-// LogsPredictive12KeyTranslator::trimPattern()
-// -----------------------------------------------------------------------------
-//
-QString& LogsPredictive12KeyTranslator::trimPattern( QString& pattern,
- bool tailOnly ) const
-{
- QRegExp lead("^0*");//remove leading zeros
- QRegExp trail("0*$");//remove trailing zeros
-
- if ( pattern.length() ) {
- if ( !tailOnly ) {
- pattern.remove( lead );
- }
-
- pattern.remove( trail );
-
- if( !pattern.length() ) {
- pattern += ZeroSepar;
- }
- }
- return pattern;
-}
-
-
-// -----------------------------------------------------------------------------
-// LogsPredictive12KeyTranslator::hasPatternSeparators()
-// -----------------------------------------------------------------------------
-//
-int LogsPredictive12KeyTranslator::hasPatternSeparators(
- const QString& pattern ) const
-{
- return pattern.count( ZeroSepar );
-
-}
// -----------------------------------------------------------------------------
// LogsPredictive12KeyTranslator::translateChar()
// -----------------------------------------------------------------------------
//
-const QChar LogsPredictive12KeyTranslator::translateChar(
+const QString LogsPredictive12KeyTranslator::translateChar(
const QChar character ) const
{
const HbMappedKey* mappedKey = 0;
if ( mKeyMap ) {
mappedKey = mKeyMap->keyForCharacter( HbKeyboardVirtual12Key, character );
+ if ( !mappedKey ) {
+ mappedKey = mKeyMap->keyForCharacter( HbKeyboardSctPortrait, character );
+ return mappedKey ? QString( StarKey ) : QString();
+ }
}
- return mappedKey ? mappedKey->keycode : QChar();
+ return mappedKey ? QString( mappedKey->keycode ) : QString();
+}
+
+// -----------------------------------------------------------------------------
+// LogsPredictive12KeyTranslator::match()
+// -----------------------------------------------------------------------------
+//
+bool LogsPredictive12KeyTranslator::match(
+ const QString& pattern,
+ LogsCntTokenIterator& names ) const
+{
+ QString modifiedPattern = pattern;
+ modifiedPattern = trimPattern( modifiedPattern, true );
+
+ bool match = doSimpleMatch( modifiedPattern, names );
+
+ if (!match && hasPatternSeparators( modifiedPattern ) ) {
+ QStringList patternArray = patternTokens( modifiedPattern );
+ match = doComplexMatch( patternArray, names );
+ if (!match ) {
+ for(int i=0;i<patternArray.length();i++ ) {
+ trimPattern( patternArray[i] );
+ }
+ match = doComplexMatch( patternArray, names );
+ }
+ }
+
+ return match;
+}
+
+// -----------------------------------------------------------------------------
+// LogsPredictive12KeyTranslator::doSimpleMatch()
+// -----------------------------------------------------------------------------
+//
+bool LogsPredictive12KeyTranslator::doSimpleMatch(
+ const QString& pattern,
+ LogsCntTokenIterator& names ) const
+{
+ int matchCount = 0;
+ names.toFront();
+
+ while( names.hasNext() && !matchCount ) {
+ matchCount = (int)names.next().translation().startsWith( pattern );
+ }
+
+ return matchCount > 0;
}
+// -----------------------------------------------------------------------------
+// LogsPredictive12KeyTranslator::doComplexMatch()
+// -----------------------------------------------------------------------------
+//
+bool LogsPredictive12KeyTranslator::doComplexMatch(
+ const QStringList& patternArray,
+ LogsCntTokenIterator& names ) const
+{
+ const bool zero = false;
+ names.toFront();
+
+ int targetMatchCount = patternArray.count();
+ int namesCount = names.count();
+
+ //if pattern has more tokens than name(s), it is a missmatch
+ if ( namesCount < targetMatchCount ) {
+ return false;
+ }
+
+ QListIterator<QString> patterns( patternArray );
+ QVector<bool> matchVector(targetMatchCount, zero );
+ int currentPattern = 0;
+ int matchCount = 0;
+ bool match = false;
+
+ while( names.hasNext() && matchCount < targetMatchCount ) {
+ LogsCntToken name = names.next();
+ currentPattern = 0;
+ patterns.toFront();
+ match = false;
+ while ( !name.text().isEmpty() &&
+ patterns.hasNext() && !match ) {
+ QString pattern = patterns.next();
+ //unique match check
+ if ( !matchVector.at( currentPattern ) ) {
+ match = matchVector[ currentPattern ]
+ = name.translation().startsWith( pattern );
+ matchCount = match ? matchCount+1 : matchCount;
+ }
+ currentPattern++;
+ }
+ }
+ return matchCount >= targetMatchCount;
+
+ }
+
--- a/logsui/logscntfinder/src/logspredictivelatin12keytranslator.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/src/logspredictivelatin12keytranslator.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -14,9 +14,7 @@
* Description:
*
*/
-#include <QObject>
#include <QLocale>
-#include <QHash>
#include <hbinputkeymap.h>
#include <hbinputsettingproxy.h>
#include <QTextCodec>
@@ -24,10 +22,13 @@
#include "logspredictivelatin12keytranslator.h"
#include "logslogger.h"
+
//mapping char,key(name)
-const QChar SpecialMapping[] = {'+', '*', '*', '*','#','#','%','1'};
-const int SpecialsCount = 4;
+const QChar SpecialMapping[] = {'+', StarKey, '*', StarKey, '#',HashKey };
+const int SpecialsCount = 3;
const QChar SpaceSepar(' ');
+const QChar ZeroSepar('0');
+const int NotAssigned = -1;
// -----------------------------------------------------------------------------
@@ -94,18 +95,118 @@
}
// -----------------------------------------------------------------------------
+// LogsPredictiveLatin12KeyTranslator::patternTokens()
+// -----------------------------------------------------------------------------
+//
+QStringList LogsPredictiveLatin12KeyTranslator::patternTokens( const QString& pattern ) const
+{
+
+ LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveLatin12KeyTranslator::\
+patternTokens()" )
+ LOGS_QDEBUG_2( "logs [FINDER] pattern ", pattern );
+ QString car;
+ QString cdr;
+
+ QStringList target;
+ splitPattern( pattern, car, cdr );
+ if ( car.length() ) {
+ target.append( car );
+ if ( cdr.length() ) {
+ target.append( cdr );
+ }
+ }
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveLatin12KeyTranslator::\
+patternTokens()" )
+ return target;
+}
+
+// -----------------------------------------------------------------------------
+// LogsPredictiveLatin12KeyTranslator::splitPattern()
+// -----------------------------------------------------------------------------
+//
+void LogsPredictiveLatin12KeyTranslator::splitPattern( const QString& pattern,
+ QString& car, QString& cdr ) const
+{
+ car = "";
+ cdr = "";
+
+ QChar current;
+ QChar previous;
+ int splitStart = NotAssigned;
+ int splitEnd = NotAssigned;
+ int index = 0;
+ while( splitEnd == NotAssigned && index < pattern.length() ) {
+ current = pattern[index];
+ splitStart = splitStart == NotAssigned &&
+ ( previous != ZeroSepar && previous != QChar() ) &&
+ current == ZeroSepar ?
+ index : splitStart;
+ splitEnd = splitStart != NotAssigned &&
+ previous == ZeroSepar &&
+ current != ZeroSepar ?
+ index : splitEnd;
+ previous = current;
+ index++;
+ }
+
+ if ( splitStart != NotAssigned && splitEnd != NotAssigned ) {
+ car = pattern.left( splitStart );
+ cdr = pattern.right( pattern.length() - splitEnd );
+ } else {
+ car = pattern;
+ }
+}
+
+// -----------------------------------------------------------------------------
+// LogsPredictiveLatin12KeyTranslator::trimPattern()
+// -----------------------------------------------------------------------------
+//
+QString& LogsPredictiveLatin12KeyTranslator::trimPattern( QString& pattern,
+ bool tailOnly ) const
+{
+ QRegExp lead("^0*");//remove leading zeros
+ QRegExp trail("0*$");//remove trailing zeros
+
+ if ( pattern.length() ) {
+ if ( !tailOnly ) {
+ pattern.remove( lead );
+ }
+
+ pattern.remove( trail );
+
+ if( !pattern.length() ) {
+ pattern += ZeroSepar;
+ }
+ }
+ return pattern;
+}
+
+
+// -----------------------------------------------------------------------------
+// LogsPredictiveLatin12KeyTranslator::hasPatternSeparators()
+// -----------------------------------------------------------------------------
+//
+int LogsPredictiveLatin12KeyTranslator::hasPatternSeparators(
+ const QString& pattern ) const
+{
+ return pattern.count( ZeroSepar );
+
+}
+
+// -----------------------------------------------------------------------------
// LogsPredictiveLatin12KeyTranslator::translateChar()
// -----------------------------------------------------------------------------
//
-const QChar LogsPredictiveLatin12KeyTranslator::translateChar(
+const QString LogsPredictiveLatin12KeyTranslator::translateChar(
const QChar character,
bool& ok ) const
{
ok = true;
- QChar keycode = mSpecialKeyMap[ character ];
- if ( keycode.isNull() ) {
+ QChar sch = mSpecialKeyMap[ character ];
+ QString keycode( sch );
+ if ( sch.isNull() ) {
keycode = LogsPredictive12KeyTranslator::translateChar( character );
- if ( keycode.isNull() ) {
+ if ( keycode.isEmpty() ) {
QString decomposed = character.decomposition();
if (decomposed.isEmpty()) {
ok = false;
--- a/logsui/logscntfinder/src/logspredictivethai12keytranslator.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/src/logspredictivethai12keytranslator.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -75,17 +75,17 @@
// LogsPredictiveThai12KeyTranslator::translateChar()
// -----------------------------------------------------------------------------
//
-const QChar LogsPredictiveThai12KeyTranslator::translateChar(
+const QString LogsPredictiveThai12KeyTranslator::translateChar(
const QChar character,
bool& ok ) const
{
ok = true;
- QChar keycode;
+ QString keycode;
if ( !isIgnored( character ) ) {
keycode = LogsPredictive12KeyTranslator::translateChar( character );
- ok = !keycode.isNull();
- keycode = !keycode.isNull() && !isIgnored( keycode ) ?
- keycode : QChar();
+ ok = !keycode.isEmpty();
+ keycode = !keycode.isEmpty() && !isIgnored( *keycode.data() ) ?
+ keycode : QString();
}
return keycode;
}
@@ -101,6 +101,38 @@
}
+// -----------------------------------------------------------------------------
+// LogsPredictiveThai12KeyTranslator::patternTokens()
+// -----------------------------------------------------------------------------
+//
+QStringList LogsPredictiveThai12KeyTranslator::patternTokens(
+ const QString& pattern ) const
+{
+ return QStringList( pattern );
+}
+
+// -----------------------------------------------------------------------------
+// LogsPredictiveThai12KeyTranslator::hasPatternSeparators()
+// -----------------------------------------------------------------------------
+//
+int LogsPredictiveThai12KeyTranslator::hasPatternSeparators(
+ const QString& pattern ) const
+{
+ Q_UNUSED( pattern )
+ return 0;
+}
+
+// -----------------------------------------------------------------------------
+// LogsPredictiveThai12KeyTranslator::trimPattern()
+// -----------------------------------------------------------------------------
+//
+QString& LogsPredictiveThai12KeyTranslator::trimPattern(
+ QString& pattern, bool tailOnly ) const
+{
+ Q_UNUSED( tailOnly )
+ return pattern;
+}
+
// -----------------------------------------------------------------------------
// LogsPredictiveThai12KeyTranslator::isIgnored()
--- a/logsui/logscntfinder/src/logspredictivetranslator.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/src/logspredictivetranslator.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -39,10 +39,8 @@
LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveTranslator::\
instance()" )
if ( !mInstance ) {
- HbInputLanguage lang =
- HbInputSettingProxy::instance()->globalInputLanguage();
- LOGS_QDEBUG_2( "logs [FINDER] Input lang is %d",
- lang.language() )
+ HbInputLanguage lang = currentLanguage();
+ LOGS_QDEBUG_2( "logs [FINDER] Current lang is %d",lang.language() )
switch( lang.language() ) {
case QLocale::Thai:
mInstance = new LogsPredictiveThai12KeyTranslator( lang );
@@ -143,7 +141,7 @@
} else {
delete mNameTranslator;
mNameTranslator = new LogsPredictiveLatin12KeyTranslator();
- if( mNameTranslator->mKeyMap &&
+ if( mNameTranslator->keyMap() &&
mNameTranslator->encodes( name ) ) {
nameTranslator = mNameTranslator;
LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::\
@@ -152,7 +150,7 @@
}
delete mNameTranslator;
mNameTranslator = new LogsPredictiveThai12KeyTranslator();
- if( mNameTranslator->mKeyMap &&
+ if( mNameTranslator->keyMap() &&
mNameTranslator->encodes( name ) ) {
nameTranslator = mNameTranslator;
LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::\
@@ -182,20 +180,21 @@
return ok;
}
+
// -----------------------------------------------------------------------------
-// LogsPredictiveTranslator::translatePattern()
+// LogsPredictiveTranslator::preparePattern()
// -----------------------------------------------------------------------------
//
-const QString LogsPredictiveTranslator::translatePattern(
+const QString LogsPredictiveTranslator::preparePattern(
const QString& pattern ) const
{
- LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveTranslator::translatePattern()" )
+ LOGS_QDEBUG( "logs [FINDER] -> LogsPredictiveTranslator::preparePattern()" )
QString result = translate( pattern );
if ( !result.length() ) {
result = pattern;
}
- LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::translatePattern()" )
+ LOGS_QDEBUG( "logs [FINDER] <- LogsPredictiveTranslator::preparePattern()" )
return result;
}
@@ -215,8 +214,8 @@
const QChar* content = text.data();
int index = 0;
while( index < count && isok ) {
- QChar ch = translateChar( *content++, isok );
- if ( !ch.isNull() ) {
+ QString ch = translateChar( *content++, isok );
+ if ( !ch.isEmpty() ) {
result.append( ch );
}
index++;
@@ -230,3 +229,15 @@
}
+// -----------------------------------------------------------------------------
+// LogsPredictiveTranslator::currentLanguage()
+// -----------------------------------------------------------------------------
+//
+HbInputLanguage LogsPredictiveTranslator::currentLanguage()
+{
+ HbInputLanguage lang =
+ HbInputSettingProxy::instance()->globalInputLanguage();
+
+ return lang;
+}
+
--- a/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinder.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinder.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -79,8 +79,7 @@
void ST_LogsCntFinder::init()
{
- HbInputLanguage eng( QLocale::English );
- HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+ ST_LOGSCNTFINDER_SET_LANGUAGE( QLocale::English );
m_finder = 0;
m_finder = new LogsCntFinder(*m_manager);
@@ -109,8 +108,7 @@
{
delete m_finder;
m_finder = 0;
- HbInputLanguage eng( QLocale::English );
- HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+ ST_LOGSCNTFINDER_SET_LANGUAGE( QLocale::English );
}
@@ -991,15 +989,15 @@
m_finder->predictiveSearchQuery( QString("") );
QCOMPARE( m_finder->resultsCount(), 0 );
- m_finder->predictiveSearchQuery( QString("1") );
+ m_finder->predictiveSearchQuery( QString("*") );
QCOMPARE( m_finder->resultsCount(), 1 );
CHECK_RESULTS( 1, "%Hannu", "", 1 ); //SET: cache size, CHECK: 1. result fn, 1. result ln, highlights
- m_finder->predictiveSearchQuery( QString("14") );
+ m_finder->predictiveSearchQuery( QString("*4") );
QCOMPARE( m_finder->resultsCount(), 1 );
CHECK_RESULTS( 1, "%Hannu", "", 2 ); //SET: cache size, CHECK: 1. result fn, 1. result ln, highlights
- m_finder->predictiveSearchQuery( QString("1") );
+ m_finder->predictiveSearchQuery( QString("*") );
QCOMPARE( m_finder->resultsCount(), 1 );
CHECK_RESULTS( 1, "%Hannu", "", 1 ); //SET: cache size, CHECK: 1. result fn, 1. result ln, highlights
--- a/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinderqwerty.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinderqwerty.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -69,8 +69,7 @@
void ST_LogsCntFinderQwerty::init()
{
- HbInputLanguage eng( QLocale::English );
- HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+ ST_LOGSCNTFINDER_SET_LANGUAGE( QLocale::English );
//open symbian database
m_manager = new QContactManager("symbian");
@@ -87,8 +86,7 @@
{
delete m_manager;
m_manager = 0;
- HbInputLanguage eng( QLocale::English );
- HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+ ST_LOGSCNTFINDER_SET_LANGUAGE( QLocale::English );
}
--- a/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinderthai.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/st_logscntfinder/src/st_logscntfinderthai.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -20,7 +20,6 @@
#include <qtcontacts.h>
#include <QtTest/QtTest>
-#include <hbinputsettingproxy.h>
void ST_LogsCntFinderThai::initTestCase()
{
@@ -34,8 +33,7 @@
void ST_LogsCntFinderThai::init()
{
- HbInputLanguage eng( QLocale::Thai );
- HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+ ST_LOGSCNTFINDER_SET_LANGUAGE( QLocale::Thai );
m_finder = 0;
//open symbian database
@@ -62,8 +60,8 @@
m_manager = 0;
delete m_finder;
m_finder = 0;
- HbInputLanguage eng( QLocale::English );
- HbInputSettingProxy::instance()->setGlobalInputLanguage( eng );
+
+ ST_LOGSCNTFINDER_SET_LANGUAGE( QLocale::English );
}
@@ -124,9 +122,6 @@
void ST_LogsCntFinderThai::testPredictiveThaiSearchQuery()
{
- HbInputLanguage thai( QLocale::Thai );
- HbInputSettingProxy::instance()->setGlobalInputLanguage( thai );
-
createThaiContacts();
QEXPECT_FAIL("", "Not supported yet. Issues", Abort );
--- a/logsui/logscntfinder/tsrc/stubs/qtcontacts_stubs.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/stubs/qtcontacts_stubs.h Fri Oct 15 14:47:48 2010 +0300
@@ -24,6 +24,9 @@
const QString cntDetailPhoneNumber = "555789987";
const QString cntPhoneNumberWithActionCall = "98765";
+#define LOGS_CNTFINDER_SET_PHONE_LANGUAGE( lang )\
+ HbInputSettingProxy::instance()->setGlobalInputLanguage( HbInputLanguage( lang ) )
+
class ContactStubHelper
{
public:
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logscntentry.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logscntentry.h Fri Oct 15 14:47:48 2010 +0300
@@ -64,7 +64,6 @@
private:
LogsCntEntry* mEntry;
- HbInputLanguage mOrigLang;
};
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logscntfinder.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logscntfinder.h Fri Oct 15 14:47:48 2010 +0300
@@ -52,6 +52,7 @@
//with latin 12 keys
void testPredictiveSearchQuery_latin12k();
void testResultAt_latin12k();
+
void testPhoneNumber();
void testSetPreferDefaultNumber();
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictive12keytranslator.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictive12keytranslator.h Fri Oct 15 14:47:48 2010 +0300
@@ -46,17 +46,12 @@
private slots: //test methods
void testConstructor();
- void testPatternTokens();
- void testHasPatternSeparators();
void testTranslateChar();
- void testSplitPattern();
- void testTrimPattern();
private:
LogsPredictive12KeyTranslator* mTranslator;
- HbInputLanguage mOrigLang;
};
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivelatin12keytranslator.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivelatin12keytranslator.h Fri Oct 15 14:47:48 2010 +0300
@@ -45,8 +45,14 @@
private slots: //test methods
void testConstructor();
+ void testPatternTokens();
+ void testHasPatternSeparators();
+ void testSplitPattern();
+ void testTrimPattern();
+
void testTranslateText();
- void testTranslatePattern();
+ void testPreparePattern();
+
void testTranslateChar();
void testEncodes();
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivethai12keytranslator.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivethai12keytranslator.h Fri Oct 15 14:47:48 2010 +0300
@@ -47,7 +47,7 @@
void testConstructor();
void testTranslateText();
- void testTranslatePattern();
+ void testPreparePattern();
void testTranslateChar();
void testEncodes();
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivetranslator.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/inc/ut_logspredictivetranslator.h Fri Oct 15 14:47:48 2010 +0300
@@ -47,13 +47,12 @@
void testConstructor();
void testTranslate();
- void testTranslatePattern();
+ void testPreparePattern();
void testTranslateText();
void testNameTranslator();
private:
- HbInputLanguage mOrigLang;
LogsPredictiveTranslator* mTranslator;
};
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/main.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/main.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -34,7 +34,7 @@
QApplication app(argc, argv);
QStringList args = app.arguments();
- QString combinedOutputFileName;
+ QString combinedOutputFileName = "C:/shared/eunit/logs/ut_logscntfinder_log.xml"; // ATS default
for ( int i = 0; i < args.count(); i++ ){
QString arg = args.at(i);
if ( arg == QString("-o") && i + 1 < args.count() ){
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logscntentry.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logscntentry.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -21,26 +21,27 @@
#include "logspredictivetranslator.h"
#include <QtTest/QtTest>
+#include "qtcontacts_stubs.h"
#define PATTERN( pattern )\
- LogsPredictiveTranslator::instance()->translatePattern( QString( pattern ) )
+ LogsPredictiveTranslator::instance()->preparePattern( QString( pattern ) )
void UT_LogsCntEntry::initTestCase()
{
- mOrigLang = HbInputSettingProxy::instance()->globalInputLanguage();
}
void UT_LogsCntEntry::cleanupTestCase()
{
- HbInputSettingProxy::instance()->setGlobalInputLanguage( mOrigLang );
+ LOGS_CNTFINDER_SET_PHONE_LANGUAGE( QLocale::English );
}
void UT_LogsCntEntry::init()
{
+ LOGS_CNTFINDER_SET_PHONE_LANGUAGE( QLocale::English );
mEntry = new LogsCntEntry( 0 );
}
@@ -48,8 +49,6 @@
{
delete mEntry;
mEntry = 0;
- LogsPredictiveTranslator::deleteInstance();
- HbInputSettingProxy::instance()->setGlobalInputLanguage( mOrigLang );
}
@@ -417,6 +416,33 @@
QVERIFY( mEntry->firstName()[0].highlights() == 0);
QVERIFY( mEntry->firstName()[1].highlights() == 0);
QVERIFY( mEntry->lastName()[0].highlights() == 0);
+
+ mEntry->setFirstName( QString( "Alice M%ing" ) );
+ mEntry->setHighlights( PATTERN( "6+" ) );
+ QVERIFY( mEntry->firstName()[0].highlights() == 0);
+ QVERIFY( mEntry->firstName()[1].highlights() == 2);
+ QVERIFY( mEntry->lastName()[0].highlights() == 0);
+
+ mEntry->setHighlights( PATTERN( "6*" ) );
+ QVERIFY( mEntry->firstName()[0].highlights() == 0);
+ QVERIFY( mEntry->firstName()[1].highlights() == 2);
+ QVERIFY( mEntry->lastName()[0].highlights() == 0);
+
+ mEntry->setHighlights( PATTERN( "6#" ) );
+ QVERIFY( mEntry->firstName()[0].highlights() == 0);
+ QVERIFY( mEntry->firstName()[1].highlights() == 0);
+ QVERIFY( mEntry->lastName()[0].highlights() == 0);
+
+ mEntry->setHighlights( PATTERN( "6**" ) );
+ QVERIFY( mEntry->firstName()[0].highlights() == 0);
+ QVERIFY( mEntry->firstName()[1].highlights() == 0);
+ QVERIFY( mEntry->lastName()[0].highlights() == 0);
+
+ mEntry->setHighlights( PATTERN( "61" ) );
+ QVERIFY( mEntry->firstName()[0].highlights() == 0);
+ QVERIFY( mEntry->firstName()[1].highlights() == 0);
+ QVERIFY( mEntry->lastName()[0].highlights() == 0);
+
}
void UT_LogsCntEntry::testSetPhoneNumber()
@@ -710,6 +736,14 @@
QVERIFY( !mEntry->match( PATTERN( "00202" ) ) );
QVERIFY( mEntry->match( PATTERN( "0025000000000" ) ) );
+ mEntry->setFirstName( QString("Alice") );
+ mEntry->setLastName( QString( "M[ng" ) );
+ QVERIFY( mEntry->match( PATTERN( "6" ) ) );
+ QVERIFY( mEntry->match( PATTERN( "6*" ) ) );
+ QVERIFY( mEntry->match( PATTERN( "6+" ) ) );
+ QVERIFY( !mEntry->match( PATTERN( "61" ) ) );
+
+
}
void UT_LogsCntEntry::testStartsWith_latin12k()
@@ -734,8 +768,10 @@
{
LogsPredictiveTranslator::deleteInstance();
- HbInputLanguage thai( QLocale::Thai );
- HbInputSettingProxy::instance()->setGlobalInputLanguage( thai );
+ LOGS_CNTFINDER_SET_PHONE_LANGUAGE( QLocale::Thai );
+
+
+ QEXPECT_FAIL("", "No proper Thai keymap yet", Abort );
mEntry->mType = LogsCntEntry::EntryTypeHistory;
@@ -749,7 +785,6 @@
QVERIFY( mEntry->match( PATTERN( "05" ) ) );
QVERIFY( mEntry->match( PATTERN( "6" ) ) );
- QEXPECT_FAIL("", "No proper Thai keymap yet", Abort );
QVERIFY( mEntry->match( PATTERN( "*#*#*#*5*#*#*#**#*#" ) ) );
QVERIFY( mEntry->match( PATTERN( "*#*#*****#6" ) ) );
@@ -769,8 +804,7 @@
QEXPECT_FAIL("", "No proper Thai keymap yet", Abort );
LogsPredictiveTranslator::deleteInstance();
- HbInputLanguage thai( QLocale::Thai );
- HbInputSettingProxy::instance()->setGlobalInputLanguage( thai );
+ LOGS_CNTFINDER_SET_PHONE_LANGUAGE( QLocale::Thai );
mEntry->mType = LogsCntEntry::EntryTypeHistory;
mEntry->setFirstName( QString( "5643 456456" ) );
@@ -789,4 +823,3 @@
}
-
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictive12keytranslator.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictive12keytranslator.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -22,6 +22,7 @@
#include <QtTest/QtTest>
#include <QSignalSpy>
+#include "qtcontacts_stubs.h"
class LogsPredictive12KeyTranslator_mock : public LogsPredictive12KeyTranslator
{
@@ -32,13 +33,21 @@
{
}
- inline QStringList nameTokens( const QString& /*name*/ ) const
- {return QStringList();}
- inline const QChar translateChar( const QChar /*character*/, bool& /*ok*/ ) const
- {return QChar();}
+ inline QStringList nameTokens( const QString& name ) const
+ {return QStringList(name);}
+ inline const QString translateChar( const QChar /*character*/, bool& /*ok*/ ) const
+ {return QString();}
inline bool encodes( const QString& /*sniplet*/ )
{return true;}
- inline int mib() const {return 0;}
+ inline int mib() const
+ {return 0;}
+ inline QString& trimPattern( QString& pattern, bool /*tailOnly*/ ) const
+ {return pattern;}
+ inline int hasPatternSeparators( const QString& pattern ) const
+ {return pattern.length();}
+ inline QStringList patternTokens( const QString& pattern ) const
+ {return QStringList( pattern );}
+
};
@@ -46,14 +55,12 @@
void UT_LogsPredictive12KeyTranslator::initTestCase()
{
- mOrigLang = HbInputSettingProxy::instance()->globalInputLanguage();
}
void UT_LogsPredictive12KeyTranslator::cleanupTestCase()
{
- HbInputSettingProxy::instance()->setGlobalInputLanguage( mOrigLang );
-
+ LOGS_CNTFINDER_SET_PHONE_LANGUAGE( QLocale::English );
}
@@ -66,7 +73,6 @@
{
delete mTranslator;
mTranslator = 0;
- HbInputSettingProxy::instance()->setGlobalInputLanguage( mOrigLang );
}
@@ -76,140 +82,15 @@
QVERIFY( mTranslator->mKeyMap );
}
-void UT_LogsPredictive12KeyTranslator::testSplitPattern()
-{
- QString car;
- QString cdr;
-
- mTranslator->splitPattern( QString( "122" ), car, cdr );
- QCOMPARE( car, QString("122" ) );
- QCOMPARE( cdr, QString("" ) );
-
- mTranslator->splitPattern( QString( "01220" ), car, cdr );
- QCOMPARE( car, QString("01220" ) );
- QCOMPARE( cdr, QString("" ) );
-
- mTranslator->splitPattern( QString( "0122020" ), car, cdr );
- QCOMPARE( car, QString("0122" ) );
- QCOMPARE( cdr, QString("20" ) );
-
- mTranslator->splitPattern( QString( "012200020" ), car, cdr );
- QCOMPARE( car, QString("0122" ) );
- QCOMPARE( cdr, QString("20" ) );
-
- mTranslator->splitPattern( QString( "0122050020" ), car, cdr );
- QCOMPARE( car, QString("0122" ) );
- QCOMPARE( cdr, QString("50020" ) );
-
- mTranslator->splitPattern( QString( "00000" ), car, cdr );
- QCOMPARE( car, QString("00000" ) );
- QCOMPARE( cdr, QString("" ) );
-
- mTranslator->splitPattern( QString( "0" ), car, cdr );
- QCOMPARE( car, QString("0" ) );
- QCOMPARE( cdr, QString("" ) );
-
- mTranslator->splitPattern( QString( "" ), car, cdr );
- QCOMPARE( car, QString("" ) );
- QCOMPARE( cdr, QString("" ) );
-
-}
-
-void UT_LogsPredictive12KeyTranslator::testTrimPattern()
-{
- QString pattern;
-
- pattern = "1";
- QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "1") );
-
- pattern = "122";
- QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "122") );
-
- pattern = "0122";
- QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "122") );
-
- pattern = "0122";
- QCOMPARE( mTranslator->trimPattern( pattern, true ), QString( "0122") );
-
- pattern = "1220";
- QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "122") );
-
- pattern = "1220";
- QCOMPARE( mTranslator->trimPattern( pattern, true ), QString( "122") );
-
- pattern = "01220";
- QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "122") );
-
- pattern = "01220";
- QCOMPARE( mTranslator->trimPattern( pattern, true ), QString( "0122") );
-
- pattern = "012020";
- QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "1202") );
-
- pattern = "012020";
- QCOMPARE( mTranslator->trimPattern( pattern, true ), QString( "01202") );
-
- pattern = "000120200";
- QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "1202") );
-
- pattern = "00012000200";
- QCOMPARE( mTranslator->trimPattern( pattern , false), QString( "120002") );
-
- pattern = "0001200024500";
- QCOMPARE( mTranslator->trimPattern( pattern , false), QString( "12000245") );
-
- pattern = "000";
- QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "0") );
-
- pattern = "0";
- QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "0") );
-
- pattern = "";
- QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "") );
-
-
-}
-
-void UT_LogsPredictive12KeyTranslator::testPatternTokens()
-{
-
- QCOMPARE( mTranslator->patternTokens( QString("122" ) ).length(), 1 );
- QCOMPARE( mTranslator->patternTokens( QString("122" ) )[0], QString("122" ) );
- QCOMPARE( mTranslator->patternTokens( QString("01220" ) ).length(), 1 );
- QCOMPARE( mTranslator->patternTokens( QString("01220" ) )[0], QString("01220" ) );
- QCOMPARE( mTranslator->patternTokens( QString("102" ) ).length(), 2 );
- QCOMPARE( mTranslator->patternTokens( QString("102" ) )[0], QString("1" ) );
- QCOMPARE( mTranslator->patternTokens( QString("102" ) )[1], QString("2" ) );
- QCOMPARE( mTranslator->patternTokens( QString("0010200" ) ).length(), 2 );
- QCOMPARE( mTranslator->patternTokens( QString("0010200" ) )[0], QString("001" ) );
- QCOMPARE( mTranslator->patternTokens( QString("0010200" ) )[1], QString("200" ) );
- QCOMPARE( mTranslator->patternTokens( QString("0010200564760635" ) ).length(), 2 );
- QCOMPARE( mTranslator->patternTokens( QString("0010200564760635" ) )[0], QString("001" ) );
- QCOMPARE( mTranslator->patternTokens( QString("0010200564760635" ) )[1], QString("200564760635" ) );
- QCOMPARE( mTranslator->patternTokens( QString("0" ) ).length(), 1 );
- QCOMPARE( mTranslator->patternTokens( QString("0" ) )[0], QString("0" ) );
- QCOMPARE( mTranslator->patternTokens( QString("000" ) ).length(), 1 );
- QCOMPARE( mTranslator->patternTokens( QString("000" ) )[0], QString("000" ) );
- QCOMPARE( mTranslator->patternTokens( QString("001" ) ).length(), 1 );
- QCOMPARE( mTranslator->patternTokens( QString("001" ) )[0], QString("001" ) );
-
-}
-
-void UT_LogsPredictive12KeyTranslator::testHasPatternSeparators()
-{
- QVERIFY( !mTranslator->hasPatternSeparators( QString("122" ) ) );
- QVERIFY( mTranslator->hasPatternSeparators( QString("1022" ) ) );
- QCOMPARE( mTranslator->hasPatternSeparators( QString("0010200" ) ), 5 );
- QCOMPARE( mTranslator->hasPatternSeparators( QString("0000" ) ), 4 );
- QCOMPARE( mTranslator->hasPatternSeparators( QString("345345" ) ), 0 );
-
-}
void UT_LogsPredictive12KeyTranslator::testTranslateChar()
{
//latin
- QCOMPARE( mTranslator->translateChar( QChar('0') ), QChar('0') );
- QCOMPARE( mTranslator->translateChar( QChar(0x4E0F) ), QChar() );
+ QCOMPARE( mTranslator->translateChar( QChar('0') ), QString('0') );
+ QCOMPARE( mTranslator->translateChar( QChar('%') ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x4E0F) ), QString() );
+ mTranslator->mKeyMap = 0;
+ QCOMPARE( mTranslator->translateChar( QChar('0') ), QString() );
}
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivelatin12keytranslator.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivelatin12keytranslator.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -33,8 +33,9 @@
void UT_LogsPredictiveLatin12KeyTranslator::init()
{
- mTranslator = new LogsPredictiveLatin12KeyTranslator(
- HbInputSettingProxy::instance()->globalInputLanguage() );
+ mTranslator =
+ new LogsPredictiveLatin12KeyTranslator(
+ LogsPredictiveTranslator::currentLanguage() );
}
void UT_LogsPredictiveLatin12KeyTranslator::cleanup()
@@ -52,90 +53,90 @@
void UT_LogsPredictiveLatin12KeyTranslator::testTranslateText()
{
- 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" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Nokia" ) ), QString( "66542" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Aarne" ) ), QString( "22763" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Bertta" ) ), QString( "237882" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Celsius" ) ), QString( "2357487" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Daavid" ) ), QString( "322843" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Eemeli" ) ), QString( "336354" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Faarao" ) ), QString( "322726" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Gideon" ) ), QString( "443366" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Heikki" ) ), QString( "434554" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Iivari" ) ), QString( "448274" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Jussi" ) ), QString( "58774" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Kalle" ) ), QString( "52553" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Lauri" ) ), QString( "52874" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Matti" ) ), QString( "62884" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Niilo" ) ), QString( "64456" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Otto" ) ), QString( "6886" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Paavo" ) ), QString( "72286" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Kuu" ) ), QString( "588" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Risto" ) ), QString( "74786" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Sakari" ) ), QString( "725274" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Tyyne" ) ), QString( "89963" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Urho" ) ), QString( "8746" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Vihtori" ) ), QString( "8448674" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Wiski" ) ), QString( "94754" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Yrjö" ) ), QString( "9756" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Tseta" ) ), QString( "87382" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Åke" ) ), QString( "253" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Äiti" ) ), QString( "2484" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Öljy" ) ), QString( "6559" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Adam" ) ), QString( "2326" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Bertil" ) ), QString( "237845" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Cesar" ) ), QString( "23727" ) );
+ QCOMPARE( mTranslator->translateText( QString( "David" ) ), QString( "32843" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Erik" ) ), QString( "3745" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Filip" ) ), QString( "34547" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Gustav" ) ), QString( "487828" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Helge" ) ), QString( "43543" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Ivar" ) ), QString( "4827" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Johan" ) ), QString( "56426" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Kalle" ) ), QString( "52553" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Ludvig" ) ), QString( "583844" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Martin" ) ), QString( "627846" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Niklas" ) ), QString( "645527" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Olof" ) ), QString( "6563" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Petter" ) ), QString( "738837" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Quintus" ) ), QString( "7846887" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Rudolf" ) ), QString( "783653" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Sigurd" ) ), QString( "744873" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Tore" ) ), QString( "8673" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Urban" ) ), QString( "87226" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Viktor" ) ), QString( "845867" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Wilhelm" ) ), QString( "9454356" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Xerxes" ) ), QString( "937937" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Yngve" ) ), QString( "96483" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Zäta" ) ), QString( "9282" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Ärlig" ) ), QString( "27544" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Östen" ) ), QString( "67836" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Alpha" ) ), QString( "25742" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Bravo" ) ), QString( "27286" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Charlie" ) ), QString( "2427543" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Delta" ) ), QString( "33582" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Echo" ) ), QString( "3246" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Foxtrot" ) ), QString( "3698768" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Golf" ) ), QString( "4653" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Hotel" ) ), QString( "46835" ) );
+ QCOMPARE( mTranslator->translateText( QString( "India" ) ), QString( "46342" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Juliet" ) ), QString( "585438" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Kilo" ) ), QString( "5456" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Lima" ) ), QString( "5462" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Mike" ) ), QString( "6453" ) );
+ QCOMPARE( mTranslator->translateText( QString( "November" ) ), QString( "66836237" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Oscar" ) ), QString( "67227" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Papa" ) ), QString( "7272" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Quebec" ) ), QString( "783232" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Romeo" ) ), QString( "76636" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Sierra" ) ), QString( "743772" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Tanga" ) ), QString( "82642" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Uniform" ) ), QString( "8643676" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Vârlan" ) ), QString( "827526" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Victor" ) ), QString( "842867" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Whiskey" ) ), QString( "9447539" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Xray" ) ), QString( "9729" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Yankee" ) ), QString( "926533" ) );
+ QCOMPARE( mTranslator->translateText( QString( "Zulu" ) ), QString( "9858" ) );
QString uni;
uni.append(QChar(0x0219));
@@ -155,17 +156,146 @@
}
-void UT_LogsPredictiveLatin12KeyTranslator::testTranslatePattern()
+void UT_LogsPredictiveLatin12KeyTranslator::testPreparePattern()
{
- 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( "**##" ) );
+ QCOMPARE( mTranslator->preparePattern( QString( "1234567890" ) ), QString( "1234567890" ) );
+ QCOMPARE( mTranslator->preparePattern( QString( "+1234567890" ) ) ,QString( "*1234567890" ) );
+ QCOMPARE( mTranslator->preparePattern( QString( "*1234567890" ) ) ,QString( "*1234567890" ) );
+ QCOMPARE( mTranslator->preparePattern( QString( "#1234567890" ) ), QString( "#1234567890" ) );
+ QCOMPARE( mTranslator->preparePattern( QString( "++##" ) ), QString( "**##" ) );
+ QCOMPARE( mTranslator->preparePattern( QString( "-+##" ) ), QString( "1*##" ) );
+ QCOMPARE( mTranslator->preparePattern( QString( "/+##" ) ), QString( "1*##" ) );
+ QCOMPARE( mTranslator->preparePattern( QString( "*+##" ) ), QString( "**##" ) );
+
+}
+
+void UT_LogsPredictiveLatin12KeyTranslator::testSplitPattern()
+{
+ QString car;
+ QString cdr;
+
+ mTranslator->splitPattern( QString( "122" ), car, cdr );
+ QCOMPARE( car, QString("122" ) );
+ QCOMPARE( cdr, QString("" ) );
+
+ mTranslator->splitPattern( QString( "01220" ), car, cdr );
+ QCOMPARE( car, QString("01220" ) );
+ QCOMPARE( cdr, QString("" ) );
+
+ mTranslator->splitPattern( QString( "0122020" ), car, cdr );
+ QCOMPARE( car, QString("0122" ) );
+ QCOMPARE( cdr, QString("20" ) );
+
+ mTranslator->splitPattern( QString( "012200020" ), car, cdr );
+ QCOMPARE( car, QString("0122" ) );
+ QCOMPARE( cdr, QString("20" ) );
+
+ mTranslator->splitPattern( QString( "0122050020" ), car, cdr );
+ QCOMPARE( car, QString("0122" ) );
+ QCOMPARE( cdr, QString("50020" ) );
+
+ mTranslator->splitPattern( QString( "00000" ), car, cdr );
+ QCOMPARE( car, QString("00000" ) );
+ QCOMPARE( cdr, QString("" ) );
+
+ mTranslator->splitPattern( QString( "0" ), car, cdr );
+ QCOMPARE( car, QString("0" ) );
+ QCOMPARE( cdr, QString("" ) );
+
+ mTranslator->splitPattern( QString( "" ), car, cdr );
+ QCOMPARE( car, QString("" ) );
+ QCOMPARE( cdr, QString("" ) );
+
+}
+
+void UT_LogsPredictiveLatin12KeyTranslator::testTrimPattern()
+{
+ QString pattern;
+
+ pattern = "1";
+ QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "1") );
+
+ pattern = "122";
+ QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "122") );
+
+ pattern = "0122";
+ QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "122") );
+
+ pattern = "0122";
+ QCOMPARE( mTranslator->trimPattern( pattern, true ), QString( "0122") );
+
+ pattern = "1220";
+ QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "122") );
+
+ pattern = "1220";
+ QCOMPARE( mTranslator->trimPattern( pattern, true ), QString( "122") );
+
+ pattern = "01220";
+ QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "122") );
+
+ pattern = "01220";
+ QCOMPARE( mTranslator->trimPattern( pattern, true ), QString( "0122") );
+
+ pattern = "012020";
+ QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "1202") );
+
+ pattern = "012020";
+ QCOMPARE( mTranslator->trimPattern( pattern, true ), QString( "01202") );
+
+ pattern = "000120200";
+ QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "1202") );
+
+ pattern = "00012000200";
+ QCOMPARE( mTranslator->trimPattern( pattern , false), QString( "120002") );
+
+ pattern = "0001200024500";
+ QCOMPARE( mTranslator->trimPattern( pattern , false), QString( "12000245") );
+
+ pattern = "000";
+ QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "0") );
+
+ pattern = "0";
+ QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "0") );
+
+ pattern = "";
+ QCOMPARE( mTranslator->trimPattern( pattern, false ), QString( "") );
+
+
+}
+
+void UT_LogsPredictiveLatin12KeyTranslator::testPatternTokens()
+{
+
+ QCOMPARE( mTranslator->patternTokens( QString("122" ) ).length(), 1 );
+ QCOMPARE( mTranslator->patternTokens( QString("122" ) )[0], QString("122" ) );
+ QCOMPARE( mTranslator->patternTokens( QString("01220" ) ).length(), 1 );
+ QCOMPARE( mTranslator->patternTokens( QString("01220" ) )[0], QString("01220" ) );
+ QCOMPARE( mTranslator->patternTokens( QString("102" ) ).length(), 2 );
+ QCOMPARE( mTranslator->patternTokens( QString("102" ) )[0], QString("1" ) );
+ QCOMPARE( mTranslator->patternTokens( QString("102" ) )[1], QString("2" ) );
+ QCOMPARE( mTranslator->patternTokens( QString("0010200" ) ).length(), 2 );
+ QCOMPARE( mTranslator->patternTokens( QString("0010200" ) )[0], QString("001" ) );
+ QCOMPARE( mTranslator->patternTokens( QString("0010200" ) )[1], QString("200" ) );
+ QCOMPARE( mTranslator->patternTokens( QString("0010200564760635" ) ).length(), 2 );
+ QCOMPARE( mTranslator->patternTokens( QString("0010200564760635" ) )[0], QString("001" ) );
+ QCOMPARE( mTranslator->patternTokens( QString("0010200564760635" ) )[1], QString("200564760635" ) );
+ QCOMPARE( mTranslator->patternTokens( QString("0" ) ).length(), 1 );
+ QCOMPARE( mTranslator->patternTokens( QString("0" ) )[0], QString("0" ) );
+ QCOMPARE( mTranslator->patternTokens( QString("000" ) ).length(), 1 );
+ QCOMPARE( mTranslator->patternTokens( QString("000" ) )[0], QString("000" ) );
+ QCOMPARE( mTranslator->patternTokens( QString("001" ) ).length(), 1 );
+ QCOMPARE( mTranslator->patternTokens( QString("001" ) )[0], QString("001" ) );
+
+}
+
+void UT_LogsPredictiveLatin12KeyTranslator::testHasPatternSeparators()
+{
+ QVERIFY( !mTranslator->hasPatternSeparators( QString("122" ) ) );
+ QVERIFY( mTranslator->hasPatternSeparators( QString("1022" ) ) );
+ QCOMPARE( mTranslator->hasPatternSeparators( QString("0010200" ) ), 5 );
+ QCOMPARE( mTranslator->hasPatternSeparators( QString("0000" ) ), 4 );
+ QCOMPARE( mTranslator->hasPatternSeparators( QString("345345" ) ), 0 );
}
@@ -173,22 +303,49 @@
{
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') );
- QCOMPARE( mTranslator->translateChar( QChar('%'), ok ), QChar('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('+'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('*'), ok ), QString('*') );
+
+ QCOMPARE( mTranslator->translateChar( QChar('#'), ok ), QString('#') );
+ QCOMPARE( mTranslator->translateChar( QChar('0'), ok ), QString('0') );
+ QCOMPARE( mTranslator->translateChar( QChar('a'), ok ), QString('2') );
+ QCOMPARE( mTranslator->translateChar( QChar('A'), ok ), QString('2') );
+ QCOMPARE( mTranslator->translateChar( QChar('1'), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('ä'), ok ), QString('2') );
+ QCOMPARE( mTranslator->translateChar( QChar('Ä'), ok ), QString('2') );
+ QCOMPARE( mTranslator->translateChar( QChar('?'), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('!'), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('\''), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('"'), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('-'), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('('), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar(')'), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('@'), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('/'), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar(':'), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('_'), ok ), QString('1') );
+ QCOMPARE( mTranslator->translateChar( QChar(';'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('&'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('%'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('='), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('<'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('>'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('['), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar(']'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('{'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('}'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('\\'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('~'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('^'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('¡'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('¿'), ok ), QString('*') );
+ QCOMPARE( mTranslator->translateChar( QChar('|'), ok ), QString('*') );
+
// Romanian unicode character "sh"
- QCOMPARE( mTranslator->translateChar( QChar(0x0219), ok ), QChar('7') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0219), ok ), QString('7') );
// Chinese unicode character
QChar chn(0x4E0F);
- QCOMPARE( mTranslator->translateChar( QChar(0x4E0F), ok ), QChar() );
+ QCOMPARE( mTranslator->translateChar( QChar(0x4E0F), ok ), QString() );
QVERIFY( !ok );
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivethai12keytranslator.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivethai12keytranslator.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -73,12 +73,12 @@
}
-void UT_LogsPredictiveThai12KeyTranslator::testTranslatePattern()
+void UT_LogsPredictiveThai12KeyTranslator::testPreparePattern()
{
QEXPECT_FAIL("", "No proper Thai keymap yet", Abort );
- QCOMPARE( mTranslator->translatePattern( QString( "0123456789" ) ), QString( "0123456789" ) );
- QCOMPARE( mTranslator->translatePattern( QString( "*0123##456*789*" ) ), QString( "0123456789" ) );
+ QCOMPARE( mTranslator->preparePattern( QString( "0123456789" ) ), QString( "0123456789" ) );
+ QCOMPARE( mTranslator->preparePattern( QString( "*0123##456*789*" ) ), QString( "0123456789" ) );
}
@@ -87,29 +87,29 @@
QEXPECT_FAIL("", "No proper Thai keymap yet", Abort );
bool ok;
- QCOMPARE( mTranslator->translateChar( QChar('0'), ok ), QChar('0') );
+ QCOMPARE( mTranslator->translateChar( QChar('0'), ok ), QString('0') );
QVERIFY( ok );
- QCOMPARE( mTranslator->translateChar( QChar('1'), ok ), QChar('1') );
+ QCOMPARE( mTranslator->translateChar( QChar('1'), ok ), QString('1') );
QVERIFY( ok );
- QCOMPARE( mTranslator->translateChar( QChar('N'), ok ), QChar() );
+ QCOMPARE( mTranslator->translateChar( QChar('N'), ok ), QString() );
QVERIFY( !ok );
- QCOMPARE( mTranslator->translateChar( QChar('*'), ok ), QChar() );
+ QCOMPARE( mTranslator->translateChar( QChar('*'), ok ), QString() );
QVERIFY( ok );
- QCOMPARE( mTranslator->translateChar( QChar('#'), ok ), QChar() );
+ QCOMPARE( mTranslator->translateChar( QChar('#'), ok ), QString() );
QVERIFY( ok );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E01), ok ), QChar('1') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E01), ok ), QString('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() );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E06), ok ), QString('2') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E0A), ok ), QString('3') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E0E), ok ), QString('4') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E14), ok ), QString('5') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E19), ok ), QString('6') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E1E), ok ), QString('7') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E23), ok ), QString('8') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E2A), ok ), QString('9') );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E2F), ok ), QString() );
QVERIFY( ok );
- QCOMPARE( mTranslator->translateChar( QChar(0x0E30), ok ), QChar() );
+ QCOMPARE( mTranslator->translateChar( QChar(0x0E30), ok ), QString() );
QVERIFY( ok );
}
@@ -117,6 +117,8 @@
void UT_LogsPredictiveThai12KeyTranslator::testEncodes()
{
+ QCOMPARE( mTranslator->mib(), MIBenumThai );
+
//china
QString uni1;
uni1.append(QChar(0x4E0E));
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivetranslator.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/src/ut_logspredictivetranslator.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -23,18 +23,17 @@
#include "logspredictivethai12keytranslator.h"
#include <QtTest/QtTest>
+#include "qtcontacts_stubs.h"
void UT_LogsPredictiveTranslator::initTestCase()
{
- mOrigLang = HbInputSettingProxy::instance()->globalInputLanguage();
}
void UT_LogsPredictiveTranslator::cleanupTestCase()
{
- HbInputSettingProxy::instance()->setGlobalInputLanguage( mOrigLang );
-
+ LOGS_CNTFINDER_SET_PHONE_LANGUAGE( QLocale::English );
}
@@ -46,13 +45,14 @@
void UT_LogsPredictiveTranslator::cleanup()
{
LogsPredictiveTranslator::deleteInstance();
- HbInputSettingProxy::instance()->setGlobalInputLanguage( mOrigLang );
+ LOGS_CNTFINDER_SET_PHONE_LANGUAGE( QLocale::English );
}
void UT_LogsPredictiveTranslator::testConstructor()
{
QVERIFY( mTranslator );
+ QCOMPARE( mTranslator->mib(), MIBenumLatin );
QVERIFY( mTranslator->mKeyMap );
QVERIFY( mTranslator->mNameTranslator == 0 );
QVERIFY( LogsPredictiveTranslator::mInstance != 0 );
@@ -60,11 +60,11 @@
QVERIFY( LogsPredictiveTranslator::mInstance == 0 );
mTranslator = 0;
- HbInputLanguage thai( QLocale::Thai );
- HbInputSettingProxy::instance()->setGlobalInputLanguage( thai );
+ LOGS_CNTFINDER_SET_PHONE_LANGUAGE( QLocale::Thai );
mTranslator = LogsPredictiveTranslator::instance();
QVERIFY( mTranslator );
+ QCOMPARE( mTranslator->mib(), MIBenumThai );
//temp off QVERIFY( mTranslator->mKeyMap );
QVERIFY( mTranslator->mNameTranslator == 0 );
QVERIFY( LogsPredictiveTranslator::mInstance != 0 );
@@ -72,6 +72,7 @@
LogsPredictiveTranslator::deleteInstance();
QVERIFY( LogsPredictiveTranslator::mInstance == 0 );
mTranslator = 0;
+
}
@@ -98,11 +99,11 @@
}
-void UT_LogsPredictiveTranslator::testTranslatePattern()
+void UT_LogsPredictiveTranslator::testPreparePattern()
{
QString test1( "%12345" );
- QCOMPARE( mTranslator->LogsPredictiveTranslator::translatePattern( test1 ).length(),
+ QCOMPARE( mTranslator->LogsPredictiveTranslator::preparePattern( test1 ).length(),
test1.length() );
}
@@ -113,13 +114,18 @@
QString test1( "%12345" );
QCOMPARE( mTranslator->translateText( test1 ).length(), test1.length() );
+ 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->translateText( QString( thaiName1,ucsize ) ), QString( "123456789" ) );
+ //china
+ QString uni;
+ uni.append(QChar(0x0219));
+ uni.append(QChar(0x4E0F));
+
+ mTranslator->translateText( uni );
+ QVERIFY( !mTranslator->mNameTranslator );
+ QCOMPARE( mTranslator->mib(), MIBenumLatin );
+
}
@@ -140,7 +146,6 @@
QVERIFY( !mTranslator->mNameTranslator );
QCOMPARE( mTranslator->mib(), MIBenumLatin );
-
QEXPECT_FAIL("", "No proper Thai keymap yet", Abort );
//text is thai, input lang latin
--- a/logsui/logscntfinder/tsrc/ut_logscntfinder/ut_logscntfinder.pro Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logscntfinder/tsrc/ut_logscntfinder/ut_logscntfinder.pro Fri Oct 15 14:47:48 2010 +0300
@@ -71,4 +71,6 @@
TARGET.EPOCALLOWDLLDATA = 1
LIBS += -lflogger -lqtcontacts
MMP_RULES += SMPSAFE
+ CONFIG += symbian_test
+ coverage: CONFIG -= symbian_test
}
--- a/logsui/logsengine/bwins/logsengineu.def Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/bwins/logsengineu.def Fri Oct 15 14:47:48 2010 +0300
@@ -4,69 +4,70 @@
??0LogsEvent@@QAE@ABV0@@Z @ 3 NONAME ; LogsEvent::LogsEvent(class LogsEvent const &)
??0LogsFilter@@QAE@W4FilterType@0@@Z @ 4 NONAME ; LogsFilter::LogsFilter(enum LogsFilter::FilterType)
?logsDetailsModel@LogsModel@@QAEPAVLogsDetailsModel@@AAVLogsEvent@@@Z @ 5 NONAME ; class LogsDetailsModel * LogsModel::logsDetailsModel(class LogsEvent &)
- ?sendMessage@LogsMessage@@QAE_NXZ @ 6 NONAME ; bool LogsMessage::sendMessage(void)
- ?contactLocalId@LogsEvent@@QBEIXZ @ 7 NONAME ; unsigned int LogsEvent::contactLocalId(void) const
- ?open@LogsContact@@QAE_NXZ @ 8 NONAME ; bool LogsContact::open(void)
- ?logId@LogsEvent@@QBEHXZ @ 9 NONAME ; int LogsEvent::logId(void) const
- ?allowedCallTypes@LogsCall@@QAE?AV?$QList@W4CallType@LogsCall@@@@XZ @ 10 NONAME ; class QList<enum LogsCall::CallType> LogsCall::allowedCallTypes(void)
- ??1LogsModel@@UAE@XZ @ 11 NONAME ; LogsModel::~LogsModel(void)
- ?compressData@LogsModel@@QAEHXZ @ 12 NONAME ; int LogsModel::compressData(void)
- ?addNew@LogsContact@@QAE_NXZ @ 13 NONAME ; bool LogsContact::addNew(void)
- ?getLogsEvent@LogsDetailsModel@@QBE?AVLogsEvent@@XZ @ 14 NONAME ; class LogsEvent LogsDetailsModel::getLogsEvent(void) const
- ?ringDuration@LogsEvent@@QBEHXZ @ 15 NONAME ; int LogsEvent::ringDuration(void) const
- ?logsMatchesModel@LogsModel@@QAEPAVLogsMatchesModel@@XZ @ 16 NONAME ; class LogsMatchesModel * LogsModel::logsMatchesModel(void)
- ??1LogsFilter@@UAE@XZ @ 17 NONAME ; LogsFilter::~LogsFilter(void)
- ??1LogsMessage@@UAE@XZ @ 18 NONAME ; LogsMessage::~LogsMessage(void)
- ?cancelServiceRequest@LogsContact@@QAEXXZ @ 19 NONAME ; void LogsContact::cancelServiceRequest(void)
- ?logsMatches@LogsMatchesModel@@QAEXABVQString@@@Z @ 20 NONAME ; void LogsMatchesModel::logsMatches(class QString const &)
- ?listItemTextWidth@LogsConfigurationParams@@QBEHXZ @ 21 NONAME ; int LogsConfigurationParams::listItemTextWidth(void) const
- ?clearEvent@LogsDetailsModel@@QAEXXZ @ 22 NONAME ; void LogsDetailsModel::clearEvent(void)
- ?clearMissedCallsCounter@LogsModel@@QAEHXZ @ 23 NONAME ; int LogsModel::clearMissedCallsCounter(void)
- ?filterType@LogsFilter@@QBE?AW4FilterType@1@XZ @ 24 NONAME ; enum LogsFilter::FilterType LogsFilter::filterType(void) const
- ?setLocaleChanged@LogsConfigurationParams@@QAEX_N@Z @ 25 NONAME ; void LogsConfigurationParams::setLocaleChanged(bool)
- ?eventType@LogsEvent@@QBE?AW4LogsEventType@1@XZ @ 26 NONAME ; enum LogsEvent::LogsEventType LogsEvent::eventType(void) const
- ??1LogsCall@@UAE@XZ @ 27 NONAME ; LogsCall::~LogsCall(void)
- ??1LogsContact@@UAE@XZ @ 28 NONAME ; LogsContact::~LogsContact(void)
- ?localeChanged@LogsConfigurationParams@@QBE_NXZ @ 29 NONAME ; bool LogsConfigurationParams::localeChanged(void) const
- ?time@LogsEvent@@QBE?AVQDateTime@@XZ @ 30 NONAME ; class QDateTime LogsEvent::time(void) const
- ?setPredictiveSearch@LogsAbstractModel@@QAEH_N@Z @ 31 NONAME ; int LogsAbstractModel::setPredictiveSearch(bool)
- ??0LogsCustomFilter@@QAE@XZ @ 32 NONAME ; LogsCustomFilter::LogsCustomFilter(void)
- ?clearEvents@LogsCustomFilter@@QAE_NXZ @ 33 NONAME ; bool LogsCustomFilter::clearEvents(void)
- ?ALS@LogsEvent@@QBE_NXZ @ 34 NONAME ; bool LogsEvent::ALS(void) const
- ?updateExisting@LogsContact@@QAE_NXZ @ 35 NONAME ; bool LogsContact::updateExisting(void)
- ?allowedRequestType@LogsContact@@QAE?AW4RequestType@1@XZ @ 36 NONAME ; enum LogsContact::RequestType LogsContact::allowedRequestType(void)
- ?markEventsSeen@LogsModel@@QAE_NW4ClearType@1@@Z @ 37 NONAME ; bool LogsModel::markEventsSeen(enum LogsModel::ClearType)
- ?getNumberToClipboard@LogsDetailsModel@@QAEXXZ @ 38 NONAME ; void LogsDetailsModel::getNumberToClipboard(void)
- ?updateConfiguration@LogsAbstractModel@@UAEHAAVLogsConfigurationParams@@@Z @ 39 NONAME ; int LogsAbstractModel::updateConfiguration(class LogsConfigurationParams &)
- ??1LogsMatchesModel@@UAE@XZ @ 40 NONAME ; LogsMatchesModel::~LogsMatchesModel(void)
- ?duration@LogsEvent@@QBEHXZ @ 41 NONAME ; int LogsEvent::duration(void) const
- ?call@LogsCall@@QAEXW4CallType@1@@Z @ 42 NONAME ; void LogsCall::call(enum LogsCall::CallType)
- ?setContactId@LogsCustomFilter@@QAEXI@Z @ 43 NONAME ; void LogsCustomFilter::setContactId(unsigned int)
- ?serialize@LogsEvent@@QAE_NAAVQDataStream@@@Z @ 44 NONAME ; bool LogsEvent::serialize(class QDataStream &)
- ??1LogsConfigurationParams@@UAE@XZ @ 45 NONAME ; LogsConfigurationParams::~LogsConfigurationParams(void)
- ?callToNumber@LogsCall@@SAXW4CallType@1@ABVQString@@II@Z @ 46 NONAME ; void LogsCall::callToNumber(enum LogsCall::CallType, class QString const &, unsigned int, unsigned int)
- ?remoteParty@LogsEvent@@QBEABVQString@@XZ @ 47 NONAME ; class QString const & LogsEvent::remoteParty(void) const
- ?updateConfiguration@LogsModel@@UAEHAAVLogsConfigurationParams@@@Z @ 48 NONAME ; int LogsModel::updateConfiguration(class LogsConfigurationParams &)
- ?setListItemTextWidth@LogsConfigurationParams@@QAEXH@Z @ 49 NONAME ; void LogsConfigurationParams::setListItemTextWidth(int)
- ?isRead@LogsEvent@@QBE_NXZ @ 50 NONAME ; bool LogsEvent::isRead(void) const
- ??1LogsDetailsModel@@UAE@XZ @ 51 NONAME ; LogsDetailsModel::~LogsDetailsModel(void)
- ?markEventsSeen@LogsCustomFilter@@QAE_NXZ @ 52 NONAME ; bool LogsCustomFilter::markEventsSeen(void)
- ?createContact@LogsAbstractModel@@QAEPAVLogsContact@@ABVQString@@@Z @ 53 NONAME ; class LogsContact * LogsAbstractModel::createContact(class QString const &)
- ?number@LogsEvent@@QBEABVQString@@XZ @ 54 NONAME ; class QString const & LogsEvent::number(void) const
- ?getNumberForCalling@LogsEvent@@QAE?AVQString@@XZ @ 55 NONAME ; class QString LogsEvent::getNumberForCalling(void)
- ?duplicates@LogsEvent@@QBEHXZ @ 56 NONAME ; int LogsEvent::duplicates(void) const
- ?direction@LogsEvent@@QBE?AW4LogsDirection@1@XZ @ 57 NONAME ; enum LogsEvent::LogsDirection LogsEvent::direction(void) const
- ?refreshData@LogsModel@@QAEHXZ @ 58 NONAME ; int LogsModel::refreshData(void)
- ??4LogsConfigurationParams@@QAEAAV0@ABV0@@Z @ 59 NONAME ; class LogsConfigurationParams & LogsConfigurationParams::operator=(class LogsConfigurationParams const &)
- ??1LogsEvent@@UAE@XZ @ 60 NONAME ; LogsEvent::~LogsEvent(void)
- ??0LogsEvent@@QAE@AAVQDataStream@@@Z @ 61 NONAME ; LogsEvent::LogsEvent(class QDataStream &)
- ?initiateCallback@LogsCall@@QAEXXZ @ 62 NONAME ; void LogsCall::initiateCallback(void)
+ ?sendMessageToNumber@LogsMessage@@SAPAV1@ABVQString@@0I@Z @ 6 NONAME ; class LogsMessage * LogsMessage::sendMessageToNumber(class QString const &, class QString const &, unsigned int)
+ ?sendMessage@LogsMessage@@QAE_NXZ @ 7 NONAME ; bool LogsMessage::sendMessage(void)
+ ?contactLocalId@LogsEvent@@QBEIXZ @ 8 NONAME ; unsigned int LogsEvent::contactLocalId(void) const
+ ?open@LogsContact@@QAE_NXZ @ 9 NONAME ; bool LogsContact::open(void)
+ ?logId@LogsEvent@@QBEHXZ @ 10 NONAME ; int LogsEvent::logId(void) const
+ ?allowedCallTypes@LogsCall@@QAE?AV?$QList@W4CallType@LogsCall@@@@XZ @ 11 NONAME ; class QList<enum LogsCall::CallType> LogsCall::allowedCallTypes(void)
+ ??1LogsModel@@UAE@XZ @ 12 NONAME ; LogsModel::~LogsModel(void)
+ ?compressData@LogsModel@@QAEHXZ @ 13 NONAME ; int LogsModel::compressData(void)
+ ?addNew@LogsContact@@QAE_NXZ @ 14 NONAME ; bool LogsContact::addNew(void)
+ ?getLogsEvent@LogsDetailsModel@@QBE?AVLogsEvent@@XZ @ 15 NONAME ; class LogsEvent LogsDetailsModel::getLogsEvent(void) const
+ ?ringDuration@LogsEvent@@QBEHXZ @ 16 NONAME ; int LogsEvent::ringDuration(void) const
+ ?logsMatchesModel@LogsModel@@QAEPAVLogsMatchesModel@@XZ @ 17 NONAME ; class LogsMatchesModel * LogsModel::logsMatchesModel(void)
+ ??1LogsFilter@@UAE@XZ @ 18 NONAME ; LogsFilter::~LogsFilter(void)
+ ??1LogsMessage@@UAE@XZ @ 19 NONAME ; LogsMessage::~LogsMessage(void)
+ ?cancelServiceRequest@LogsContact@@QAEXXZ @ 20 NONAME ; void LogsContact::cancelServiceRequest(void)
+ ?logsMatches@LogsMatchesModel@@QAEXABVQString@@@Z @ 21 NONAME ; void LogsMatchesModel::logsMatches(class QString const &)
+ ?listItemTextWidth@LogsConfigurationParams@@QBEHXZ @ 22 NONAME ; int LogsConfigurationParams::listItemTextWidth(void) const
+ ?clearEvent@LogsDetailsModel@@QAEXXZ @ 23 NONAME ; void LogsDetailsModel::clearEvent(void)
+ ?clearMissedCallsCounter@LogsModel@@QAEHXZ @ 24 NONAME ; int LogsModel::clearMissedCallsCounter(void)
+ ?filterType@LogsFilter@@QBE?AW4FilterType@1@XZ @ 25 NONAME ; enum LogsFilter::FilterType LogsFilter::filterType(void) const
+ ?setLocaleChanged@LogsConfigurationParams@@QAEX_N@Z @ 26 NONAME ; void LogsConfigurationParams::setLocaleChanged(bool)
+ ?eventType@LogsEvent@@QBE?AW4LogsEventType@1@XZ @ 27 NONAME ; enum LogsEvent::LogsEventType LogsEvent::eventType(void) const
+ ??1LogsCall@@UAE@XZ @ 28 NONAME ; LogsCall::~LogsCall(void)
+ ??1LogsContact@@UAE@XZ @ 29 NONAME ; LogsContact::~LogsContact(void)
+ ?localeChanged@LogsConfigurationParams@@QBE_NXZ @ 30 NONAME ; bool LogsConfigurationParams::localeChanged(void) const
+ ?time@LogsEvent@@QBE?AVQDateTime@@XZ @ 31 NONAME ; class QDateTime LogsEvent::time(void) const
+ ?setPredictiveSearch@LogsAbstractModel@@QAEH_N@Z @ 32 NONAME ; int LogsAbstractModel::setPredictiveSearch(bool)
+ ??0LogsCustomFilter@@QAE@XZ @ 33 NONAME ; LogsCustomFilter::LogsCustomFilter(void)
+ ?clearEvents@LogsCustomFilter@@QAE_NXZ @ 34 NONAME ; bool LogsCustomFilter::clearEvents(void)
+ ?ALS@LogsEvent@@QBE_NXZ @ 35 NONAME ; bool LogsEvent::ALS(void) const
+ ?updateExisting@LogsContact@@QAE_NXZ @ 36 NONAME ; bool LogsContact::updateExisting(void)
+ ?allowedRequestType@LogsContact@@QAE?AW4RequestType@1@XZ @ 37 NONAME ; enum LogsContact::RequestType LogsContact::allowedRequestType(void)
+ ?markEventsSeen@LogsModel@@QAE_NW4ClearType@1@@Z @ 38 NONAME ; bool LogsModel::markEventsSeen(enum LogsModel::ClearType)
+ ?getNumberToClipboard@LogsDetailsModel@@QAEXXZ @ 39 NONAME ; void LogsDetailsModel::getNumberToClipboard(void)
+ ?updateConfiguration@LogsAbstractModel@@UAEHAAVLogsConfigurationParams@@@Z @ 40 NONAME ; int LogsAbstractModel::updateConfiguration(class LogsConfigurationParams &)
+ ??1LogsMatchesModel@@UAE@XZ @ 41 NONAME ; LogsMatchesModel::~LogsMatchesModel(void)
+ ?duration@LogsEvent@@QBEHXZ @ 42 NONAME ; int LogsEvent::duration(void) const
+ ?call@LogsCall@@QAEXW4CallType@1@@Z @ 43 NONAME ; void LogsCall::call(enum LogsCall::CallType)
+ ?setContactId@LogsCustomFilter@@QAEXI@Z @ 44 NONAME ; void LogsCustomFilter::setContactId(unsigned int)
+ ?serialize@LogsEvent@@QAE_NAAVQDataStream@@@Z @ 45 NONAME ; bool LogsEvent::serialize(class QDataStream &)
+ ??1LogsConfigurationParams@@UAE@XZ @ 46 NONAME ; LogsConfigurationParams::~LogsConfigurationParams(void)
+ ?callToNumber@LogsCall@@SAXW4CallType@1@ABVQString@@II@Z @ 47 NONAME ; void LogsCall::callToNumber(enum LogsCall::CallType, class QString const &, unsigned int, unsigned int)
+ ?remoteParty@LogsEvent@@QBEABVQString@@XZ @ 48 NONAME ; class QString const & LogsEvent::remoteParty(void) const
+ ?updateConfiguration@LogsModel@@UAEHAAVLogsConfigurationParams@@@Z @ 49 NONAME ; int LogsModel::updateConfiguration(class LogsConfigurationParams &)
+ ?setListItemTextWidth@LogsConfigurationParams@@QAEXH@Z @ 50 NONAME ; void LogsConfigurationParams::setListItemTextWidth(int)
+ ?isRead@LogsEvent@@QBE_NXZ @ 51 NONAME ; bool LogsEvent::isRead(void) const
+ ??1LogsDetailsModel@@UAE@XZ @ 52 NONAME ; LogsDetailsModel::~LogsDetailsModel(void)
+ ?markEventsSeen@LogsCustomFilter@@QAE_NXZ @ 53 NONAME ; bool LogsCustomFilter::markEventsSeen(void)
+ ?createContact@LogsAbstractModel@@QAEPAVLogsContact@@ABVQString@@@Z @ 54 NONAME ; class LogsContact * LogsAbstractModel::createContact(class QString const &)
+ ?number@LogsEvent@@QBEABVQString@@XZ @ 55 NONAME ; class QString const & LogsEvent::number(void) const
+ ?getNumberForCalling@LogsEvent@@QAE?AVQString@@XZ @ 56 NONAME ; class QString LogsEvent::getNumberForCalling(void)
+ ?duplicates@LogsEvent@@QBEHXZ @ 57 NONAME ; int LogsEvent::duplicates(void) const
+ ?direction@LogsEvent@@QBE?AW4LogsDirection@1@XZ @ 58 NONAME ; enum LogsEvent::LogsDirection LogsEvent::direction(void) const
+ ?refreshData@LogsModel@@QAEHXZ @ 59 NONAME ; int LogsModel::refreshData(void)
+ ??4LogsConfigurationParams@@QAEAAV0@ABV0@@Z @ 60 NONAME ; class LogsConfigurationParams & LogsConfigurationParams::operator=(class LogsConfigurationParams const &)
+ ??1LogsEvent@@UAE@XZ @ 61 NONAME ; LogsEvent::~LogsEvent(void)
+ ??0LogsEvent@@QAE@AAVQDataStream@@@Z @ 62 NONAME ; LogsEvent::LogsEvent(class QDataStream &)
?setMaxSize@LogsFilter@@QAEXH@Z @ 63 NONAME ; void LogsFilter::setMaxSize(int)
- ??1LogsCustomFilter@@UAE@XZ @ 64 NONAME ; LogsCustomFilter::~LogsCustomFilter(void)
- ?defaultCallType@LogsCall@@QAE?AW4CallType@1@XZ @ 65 NONAME ; enum LogsCall::CallType LogsCall::defaultCallType(void)
- ?sendMessageToNumber@LogsMessage@@SA_NABVQString@@0I@Z @ 66 NONAME ; bool LogsMessage::sendMessageToNumber(class QString const &, class QString const &, unsigned int)
+ ?initiateCallback@LogsCall@@QAEXXZ @ 64 NONAME ; void LogsCall::initiateCallback(void)
+ ??1LogsCustomFilter@@UAE@XZ @ 65 NONAME ; LogsCustomFilter::~LogsCustomFilter(void)
+ ?defaultCallType@LogsCall@@QAE?AW4CallType@1@XZ @ 66 NONAME ; enum LogsCall::CallType LogsCall::defaultCallType(void)
??0LogsConfigurationParams@@QAE@PAVQObject@@@Z @ 67 NONAME ; LogsConfigurationParams::LogsConfigurationParams(class QObject *)
?isRemotePartyPrivate@LogsEvent@@QBE_NXZ @ 68 NONAME ; bool LogsEvent::isRemotePartyPrivate(void) const
?clearList@LogsModel@@QAE_NW4ClearType@1@@Z @ 69 NONAME ; bool LogsModel::clearList(enum LogsModel::ClearType)
?clearType@LogsFilter@@QBE?AW4ClearType@LogsModel@@XZ @ 70 NONAME ; enum LogsModel::ClearType LogsFilter::clearType(void) const
+ ?cancelServiceRequest@LogsMessage@@QAEXXZ @ 71 NONAME ; void LogsMessage::cancelServiceRequest(void)
--- a/logsui/logsengine/eabi/logsengineu.def Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/eabi/logsengineu.def Fri Oct 15 14:47:48 2010 +0300
@@ -15,84 +15,85 @@
_ZN11LogsContactD2Ev @ 14 NONAME
_ZN11LogsMessage11sendMessageEv @ 15 NONAME
_ZN11LogsMessage19sendMessageToNumberERK7QStringS2_j @ 16 NONAME
- _ZN11LogsMessageD0Ev @ 17 NONAME
- _ZN11LogsMessageD1Ev @ 18 NONAME
- _ZN11LogsMessageD2Ev @ 19 NONAME
- _ZN16LogsCustomFilter11clearEventsEv @ 20 NONAME
- _ZN16LogsCustomFilter12setContactIdEj @ 21 NONAME
- _ZN16LogsCustomFilter14markEventsSeenEv @ 22 NONAME
- _ZN16LogsCustomFilterC1Ev @ 23 NONAME
- _ZN16LogsCustomFilterC2Ev @ 24 NONAME
- _ZN16LogsCustomFilterD0Ev @ 25 NONAME
- _ZN16LogsCustomFilterD1Ev @ 26 NONAME
- _ZN16LogsCustomFilterD2Ev @ 27 NONAME
- _ZN16LogsDetailsModel10clearEventEv @ 28 NONAME
- _ZN16LogsDetailsModel20getNumberToClipboardEv @ 29 NONAME
- _ZN16LogsDetailsModelD0Ev @ 30 NONAME
- _ZN16LogsDetailsModelD1Ev @ 31 NONAME
- _ZN16LogsDetailsModelD2Ev @ 32 NONAME
- _ZN16LogsMatchesModel11logsMatchesERK7QString @ 33 NONAME
- _ZN16LogsMatchesModelD0Ev @ 34 NONAME
- _ZN16LogsMatchesModelD1Ev @ 35 NONAME
- _ZN16LogsMatchesModelD2Ev @ 36 NONAME
- _ZN17LogsAbstractModel13createContactERK7QString @ 37 NONAME
- _ZN17LogsAbstractModel19setPredictiveSearchEb @ 38 NONAME
- _ZN17LogsAbstractModel19updateConfigurationER23LogsConfigurationParams @ 39 NONAME
- _ZN17LogsAbstractModel22predictiveSearchStatusEv @ 40 NONAME
- _ZN23LogsConfigurationParams16setLocaleChangedEb @ 41 NONAME
- _ZN23LogsConfigurationParams20setListItemTextWidthEi @ 42 NONAME
- _ZN23LogsConfigurationParamsC1EP7QObject @ 43 NONAME
- _ZN23LogsConfigurationParamsC2EP7QObject @ 44 NONAME
- _ZN23LogsConfigurationParamsD0Ev @ 45 NONAME
- _ZN23LogsConfigurationParamsD1Ev @ 46 NONAME
- _ZN23LogsConfigurationParamsD2Ev @ 47 NONAME
- _ZN23LogsConfigurationParamsaSERKS_ @ 48 NONAME
- _ZN8LogsCall12callToNumberENS_8CallTypeERK7QStringjj @ 49 NONAME
- _ZN8LogsCall15defaultCallTypeEv @ 50 NONAME
- _ZN8LogsCall16allowedCallTypesEv @ 51 NONAME
- _ZN8LogsCall16initiateCallbackEv @ 52 NONAME
- _ZN8LogsCall4callENS_8CallTypeE @ 53 NONAME
- _ZN8LogsCallD0Ev @ 54 NONAME
- _ZN8LogsCallD1Ev @ 55 NONAME
- _ZN8LogsCallD2Ev @ 56 NONAME
- _ZN9LogsEvent19getNumberForCallingEv @ 57 NONAME
- _ZN9LogsEvent9serializeER11QDataStream @ 58 NONAME
- _ZN9LogsEventC1ER11QDataStream @ 59 NONAME
- _ZN9LogsEventC1ERKS_ @ 60 NONAME
- _ZN9LogsEventC2ER11QDataStream @ 61 NONAME
- _ZN9LogsEventC2ERKS_ @ 62 NONAME
- _ZN9LogsEventD0Ev @ 63 NONAME
- _ZN9LogsEventD1Ev @ 64 NONAME
- _ZN9LogsEventD2Ev @ 65 NONAME
- _ZN9LogsModel11refreshDataEv @ 66 NONAME
- _ZN9LogsModel12compressDataEv @ 67 NONAME
- _ZN9LogsModel14markEventsSeenENS_9ClearTypeE @ 68 NONAME
- _ZN9LogsModel16logsDetailsModelER9LogsEvent @ 69 NONAME
- _ZN9LogsModel16logsMatchesModelEv @ 70 NONAME
- _ZN9LogsModel19updateConfigurationER23LogsConfigurationParams @ 71 NONAME
- _ZN9LogsModel23clearMissedCallsCounterEv @ 72 NONAME
- _ZN9LogsModel9clearListENS_9ClearTypeE @ 73 NONAME
- _ZN9LogsModelC1ENS_13LogsModelTypeEb @ 74 NONAME
- _ZN9LogsModelC2ENS_13LogsModelTypeEb @ 75 NONAME
- _ZN9LogsModelD0Ev @ 76 NONAME
- _ZN9LogsModelD1Ev @ 77 NONAME
- _ZN9LogsModelD2Ev @ 78 NONAME
- _ZNK10LogsFilter10filterTypeEv @ 79 NONAME
- _ZNK10LogsFilter9clearTypeEv @ 80 NONAME
- _ZNK16LogsDetailsModel12getLogsEventEv @ 81 NONAME
- _ZNK23LogsConfigurationParams13localeChangedEv @ 82 NONAME
- _ZNK23LogsConfigurationParams17listItemTextWidthEv @ 83 NONAME
- _ZNK9LogsEvent10duplicatesEv @ 84 NONAME
- _ZNK9LogsEvent11remotePartyEv @ 85 NONAME
- _ZNK9LogsEvent12ringDurationEv @ 86 NONAME
- _ZNK9LogsEvent14contactLocalIdEv @ 87 NONAME
- _ZNK9LogsEvent20isRemotePartyPrivateEv @ 88 NONAME
- _ZNK9LogsEvent3ALSEv @ 89 NONAME
- _ZNK9LogsEvent4timeEv @ 90 NONAME
- _ZNK9LogsEvent5logIdEv @ 91 NONAME
- _ZNK9LogsEvent6isReadEv @ 92 NONAME
- _ZNK9LogsEvent6numberEv @ 93 NONAME
- _ZNK9LogsEvent8durationEv @ 94 NONAME
- _ZNK9LogsEvent9directionEv @ 95 NONAME
- _ZNK9LogsEvent9eventTypeEv @ 96 NONAME
+ _ZN11LogsMessage20cancelServiceRequestEv @ 17 NONAME
+ _ZN11LogsMessageD0Ev @ 18 NONAME
+ _ZN11LogsMessageD1Ev @ 19 NONAME
+ _ZN11LogsMessageD2Ev @ 20 NONAME
+ _ZN16LogsCustomFilter11clearEventsEv @ 21 NONAME
+ _ZN16LogsCustomFilter12setContactIdEj @ 22 NONAME
+ _ZN16LogsCustomFilter14markEventsSeenEv @ 23 NONAME
+ _ZN16LogsCustomFilterC1Ev @ 24 NONAME
+ _ZN16LogsCustomFilterC2Ev @ 25 NONAME
+ _ZN16LogsCustomFilterD0Ev @ 26 NONAME
+ _ZN16LogsCustomFilterD1Ev @ 27 NONAME
+ _ZN16LogsCustomFilterD2Ev @ 28 NONAME
+ _ZN16LogsDetailsModel10clearEventEv @ 29 NONAME
+ _ZN16LogsDetailsModel20getNumberToClipboardEv @ 30 NONAME
+ _ZN16LogsDetailsModelD0Ev @ 31 NONAME
+ _ZN16LogsDetailsModelD1Ev @ 32 NONAME
+ _ZN16LogsDetailsModelD2Ev @ 33 NONAME
+ _ZN16LogsMatchesModel11logsMatchesERK7QString @ 34 NONAME
+ _ZN16LogsMatchesModelD0Ev @ 35 NONAME
+ _ZN16LogsMatchesModelD1Ev @ 36 NONAME
+ _ZN16LogsMatchesModelD2Ev @ 37 NONAME
+ _ZN17LogsAbstractModel13createContactERK7QString @ 38 NONAME
+ _ZN17LogsAbstractModel19setPredictiveSearchEb @ 39 NONAME
+ _ZN17LogsAbstractModel19updateConfigurationER23LogsConfigurationParams @ 40 NONAME
+ _ZN17LogsAbstractModel22predictiveSearchStatusEv @ 41 NONAME
+ _ZN23LogsConfigurationParams16setLocaleChangedEb @ 42 NONAME
+ _ZN23LogsConfigurationParams20setListItemTextWidthEi @ 43 NONAME
+ _ZN23LogsConfigurationParamsC1EP7QObject @ 44 NONAME
+ _ZN23LogsConfigurationParamsC2EP7QObject @ 45 NONAME
+ _ZN23LogsConfigurationParamsD0Ev @ 46 NONAME
+ _ZN23LogsConfigurationParamsD1Ev @ 47 NONAME
+ _ZN23LogsConfigurationParamsD2Ev @ 48 NONAME
+ _ZN23LogsConfigurationParamsaSERKS_ @ 49 NONAME
+ _ZN8LogsCall12callToNumberENS_8CallTypeERK7QStringjj @ 50 NONAME
+ _ZN8LogsCall15defaultCallTypeEv @ 51 NONAME
+ _ZN8LogsCall16allowedCallTypesEv @ 52 NONAME
+ _ZN8LogsCall16initiateCallbackEv @ 53 NONAME
+ _ZN8LogsCall4callENS_8CallTypeE @ 54 NONAME
+ _ZN8LogsCallD0Ev @ 55 NONAME
+ _ZN8LogsCallD1Ev @ 56 NONAME
+ _ZN8LogsCallD2Ev @ 57 NONAME
+ _ZN9LogsEvent19getNumberForCallingEv @ 58 NONAME
+ _ZN9LogsEvent9serializeER11QDataStream @ 59 NONAME
+ _ZN9LogsEventC1ER11QDataStream @ 60 NONAME
+ _ZN9LogsEventC1ERKS_ @ 61 NONAME
+ _ZN9LogsEventC2ER11QDataStream @ 62 NONAME
+ _ZN9LogsEventC2ERKS_ @ 63 NONAME
+ _ZN9LogsEventD0Ev @ 64 NONAME
+ _ZN9LogsEventD1Ev @ 65 NONAME
+ _ZN9LogsEventD2Ev @ 66 NONAME
+ _ZN9LogsModel11refreshDataEv @ 67 NONAME
+ _ZN9LogsModel12compressDataEv @ 68 NONAME
+ _ZN9LogsModel14markEventsSeenENS_9ClearTypeE @ 69 NONAME
+ _ZN9LogsModel16logsDetailsModelER9LogsEvent @ 70 NONAME
+ _ZN9LogsModel16logsMatchesModelEv @ 71 NONAME
+ _ZN9LogsModel19updateConfigurationER23LogsConfigurationParams @ 72 NONAME
+ _ZN9LogsModel23clearMissedCallsCounterEv @ 73 NONAME
+ _ZN9LogsModel9clearListENS_9ClearTypeE @ 74 NONAME
+ _ZN9LogsModelC1ENS_13LogsModelTypeEb @ 75 NONAME
+ _ZN9LogsModelC2ENS_13LogsModelTypeEb @ 76 NONAME
+ _ZN9LogsModelD0Ev @ 77 NONAME
+ _ZN9LogsModelD1Ev @ 78 NONAME
+ _ZN9LogsModelD2Ev @ 79 NONAME
+ _ZNK10LogsFilter10filterTypeEv @ 80 NONAME
+ _ZNK10LogsFilter9clearTypeEv @ 81 NONAME
+ _ZNK16LogsDetailsModel12getLogsEventEv @ 82 NONAME
+ _ZNK23LogsConfigurationParams13localeChangedEv @ 83 NONAME
+ _ZNK23LogsConfigurationParams17listItemTextWidthEv @ 84 NONAME
+ _ZNK9LogsEvent10duplicatesEv @ 85 NONAME
+ _ZNK9LogsEvent11remotePartyEv @ 86 NONAME
+ _ZNK9LogsEvent12ringDurationEv @ 87 NONAME
+ _ZNK9LogsEvent14contactLocalIdEv @ 88 NONAME
+ _ZNK9LogsEvent20isRemotePartyPrivateEv @ 89 NONAME
+ _ZNK9LogsEvent3ALSEv @ 90 NONAME
+ _ZNK9LogsEvent4timeEv @ 91 NONAME
+ _ZNK9LogsEvent5logIdEv @ 92 NONAME
+ _ZNK9LogsEvent6isReadEv @ 93 NONAME
+ _ZNK9LogsEvent6numberEv @ 94 NONAME
+ _ZNK9LogsEvent8durationEv @ 95 NONAME
+ _ZNK9LogsEvent9directionEv @ 96 NONAME
+ _ZNK9LogsEvent9eventTypeEv @ 97 NONAME
--- a/logsui/logsengine/inc/logscall.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/inc/logscall.h Fri Oct 15 14:47:48 2010 +0300
@@ -64,8 +64,8 @@
private:
- static void createcall(QString service, QString type, QString num, bool sync);
- static void createCallWithService(QString service, QString type, QString num,
+ static void createcall(QString interface, QString operation, QString num, bool sync);
+ static void createCallWithService(QString interface, QString operation, QString num,
bool sync, unsigned int serviceId );
private: //data
--- a/logsui/logsengine/inc/logscommondata.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/inc/logscommondata.h Fri Oct 15 14:47:48 2010 +0300
@@ -18,6 +18,7 @@
#ifndef LOGSCOMMONDATA_H
#define LOGSCOMMONDATA_H
+#include <QObject>
#include <qmobilityglobal.h>
#include "logsevent.h"
#include "logsconfigurationparams.h"
@@ -33,8 +34,10 @@
/**
* Commonly shared data.
*/
-class LogsCommonData
+class LogsCommonData : public QObject
{
+ Q_OBJECT
+
private:
explicit LogsCommonData();
virtual ~LogsCommonData();
@@ -92,10 +95,26 @@
bool getTelNumMatchLen(int& matchLen);
+ bool isGui() const;
+
+ const QString& highlightStart() const;
+ const QString& highlightEnd() const;
+
+ void refreshData();
+ void compressData();
+
+ signals:
+
+ void commonDataChanged();
+
+ private slots:
+
+ void handleThemeChange();
private:
int getPredictiveSearchStatus();
+ void updateHighlightColor();
private:
@@ -106,12 +125,18 @@
XQSettingsManager* mSettingsManager;
int mMatchLen;
int mPredictiveSearchStatus;
+ bool mIsInGuiProcess;
+ QString mHighlightColorStart;
+ QString mHighlightColorEnd;
+ bool mCompressed;
+ bool mPendingThemeChange;
private:
friend class UT_LogsCommonData;
friend class UT_LogsModel;
-
+ friend class UT_LogsMatchesModel;
};
#endif // LOGSCOMMONDATA_H
+
--- a/logsui/logsengine/inc/logscontact.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/inc/logscontact.h Fri Oct 15 14:47:48 2010 +0300
@@ -83,7 +83,7 @@
LOGSENGINE_EXPORT bool updateExisting();
/**
- * Cancel outstanding phonebook request(open(), addNew(), updateExisting())
+ * Deletes outstanding phonebook aiw request(open(), addNew(), updateExisting())
*/
LOGSENGINE_EXPORT void cancelServiceRequest();
--- a/logsui/logsengine/inc/logsmatchesmodel.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/inc/logsmatchesmodel.h Fri Oct 15 14:47:48 2010 +0300
@@ -137,6 +137,8 @@
void updateData(const LogsCntEntry& entry);
int resultIndex() const;
+ QString richText(const LogsCntText& cntText, bool phoneNumber = false) const;
+
private:
QString getFormattedCallerId(const LogsCntEntry& entry) const;
--- a/logsui/logsengine/inc/logsmessage.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/inc/logsmessage.h Fri Oct 15 14:47:48 2010 +0300
@@ -23,7 +23,7 @@
#include "logsevent.h"
-class XQServiceRequest;
+class XQAiwRequest;
/**
* LogsMessage can be used to send message.
@@ -38,7 +38,11 @@
explicit LogsMessage(unsigned int contactId, const QString& number, const QString& displayName);
LOGSENGINE_EXPORT ~LogsMessage();
- LOGSENGINE_EXPORT static bool sendMessageToNumber(
+ /**
+ * Creates LogsMessage instance and sends message. Ownership of created
+ * message instance is transferred to the caller
+ */
+ LOGSENGINE_EXPORT static LogsMessage* sendMessageToNumber(
const QString& number, const QString& displayName = QString(), unsigned int contactId = 0);
bool isMessagingAllowed();
@@ -51,14 +55,17 @@
*/
LOGSENGINE_EXPORT bool sendMessage();
-protected slots:
- void requestCompleted(const QVariant& value);
- void requestError(int err);
+ /**
+ * Deletes outstanding aiw request
+ */
+ LOGSENGINE_EXPORT void cancelServiceRequest();
-private:
- static bool doSendMessageToNumber(
- XQServiceRequest& request, const QString& number,
- const QString& displayName, unsigned int contactId);
+
+protected slots:
+
+ void handleRequestCompleted(const QVariant& result);
+ void handleError(int,const QString&);
+
private: //data
@@ -66,7 +73,7 @@
QString mNumber;
unsigned int mContactId;
QString mDisplayName;
- XQServiceRequest* mService;
+ XQAiwRequest* mAiwRequest;
private:
friend class UT_LogsMessage;
friend class UT_LogsMatchesModel;
--- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/main.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/src/main.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -35,7 +35,7 @@
QApplication app(argc, argv);
QStringList args = app.arguments();
- QString combinedOutputFileName;
+ QString combinedOutputFileName = "C:/shared/eunit/logs/ut_logssymbianos_log.xml"; // ATS default
for ( int i = 0; i < args.count(); i++ ){
QString arg = args.at(i);
if ( arg == QString("-o") && i + 1 < args.count() ){
--- a/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/ut_logssymbianos.pro Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/logssymbianos/tsrc/ut_logssymbianos/ut_logssymbianos.pro Fri Oct 15 14:47:48 2010 +0300
@@ -98,4 +98,6 @@
LIBS += -lecom -lflogger -lws32 -lbafl -lqtcontacts -lefsrv -lapparc -lcone
TARGET.EPOCALLOWDLLDATA = 1
MMP_RULES += SMPSAFE
+ CONFIG += symbian_test
+ coverage: CONFIG -= symbian_test
}
--- a/logsui/logsengine/src/logsabstractmodel.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/src/logsabstractmodel.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -293,10 +293,12 @@
void LogsAbstractModel::getDecorationData(const LogsEvent& event,
QList<QVariant>& iconList) const
{
- HbIcon emptyIcon;
- iconList.append( *mIcons.value(directionIconName(event), &emptyIcon) );
-
- // TODO: alternative service icon
+ if ( LogsCommonData::getInstance().isGui() ){
+ HbIcon emptyIcon;
+ iconList.append( *mIcons.value(directionIconName(event), &emptyIcon) );
+
+ // TODO: alternative service icon
+ }
}
// -----------------------------------------------------------------------------
@@ -367,3 +369,4 @@
return mEvent;
}
+
--- a/logsui/logsengine/src/logscall.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/src/logscall.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -24,8 +24,9 @@
//SYSTEM
#include <QVariant>
-#include <xqservicerequest.h>
#include <xqrequestinfo.h>
+#include <xqaiwdeclplat.h>
+#include <xqappmgr.h>
#include <hbnotificationdialog.h>
// -----------------------------------------------------------------------------
@@ -133,7 +134,6 @@
unsigned int serviceId, unsigned int contactId)
{
LOGS_QDEBUG_2( "logs [ENG] -> LogsCall::callToNumber(), type", callType )
- QString service("phoneui.com.nokia.symbian.ICallDial");
if ( number.isEmpty() || callType == TypeLogsCallNotAvailable ){
LOGS_QDEBUG( "logs [ENG] Calling not possible!" )
@@ -142,12 +142,12 @@
hbTrId("txt_dial_dpopinfo_no_saved_number_for_this_contact"));
} else {
// Will fail but intention is to get error notification from phone
- createcall(service, "dial(QString)", number, false);
+ createcall(XQI_CALL_DIAL, "dial(QString)", number, false);
}
} else if (callType == TypeLogsVoiceCall) {
- createcall(service, "dial(QString)", number, false);
+ createcall(XQI_CALL_DIAL, "dial(QString)", number, false);
} else if (callType == TypeLogsVideoCall) {
- createcall(service, "dialVideo(QString)", number, false);
+ createcall(XQI_CALL_DIAL, "dialVideo(QString)", number, false);
} else if (callType == TypeLogsVoIPCall){
if ( serviceId ){
@@ -157,7 +157,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(service,
+ createCallWithService(XQI_CALL_DIAL,
"dialVoipService(QString,int)", number, false, serviceId);
}
else {
@@ -165,7 +165,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(service, "dialVoip(QString)", number, false);
+ createcall(XQI_CALL_DIAL, "dialVoip(QString)", number, false);
}
}
LOGS_QDEBUG( "logs [ENG] <- LogsCall::callToNumber()" )
@@ -201,19 +201,26 @@
// LogsCall::createcall
// ----------------------------------------------------------------------------
//
-void LogsCall::createcall(QString service, QString type, QString num, bool sync)
+void LogsCall::createcall(QString interface, QString operation, 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
- // it thinks it is good time to do it.
- XQRequestInfo info;
- info.setBackground(true);
- snd.setInfo(info);
- QVariant retValue;
- snd.send(retValue);
+ LOGS_QDEBUG_2( "logs [ENG] -> LogsCall::createcall(), XQApplicationManager: num", num )
+ LOGS_QDEBUG_2( "logs [ENG] -> LogsCall::createcall(), interface", interface )
+ XQApplicationManager appMgr;
+ XQAiwRequest* request = appMgr.create(interface, operation, false);
+ if (request) {
+ LOGS_QDEBUG_2( "logs [ENG] -> request->isSynchronous():", request->isSynchronous() )
+
+ QList<QVariant> arglist;
+ arglist.append(QVariant(num));
+ request->setArguments(arglist);
+ XQRequestInfo info;
+ info.setBackground(true);
+ request->setInfo(info);
+ request->setSynchronous(sync);
+ QVariant ret(QVariant::Int);
+ request->send(ret);
+ delete request;
+ }
LOGS_QDEBUG( "logs [ENG] <- LogsCall::createcall()" )
}
@@ -221,20 +228,26 @@
// LogsCall::createCallWithService
// ----------------------------------------------------------------------------
//
-void LogsCall::createCallWithService(QString service, QString type, QString num,
- bool sync, unsigned int serviceId )
+void LogsCall::createCallWithService(QString interface, QString operation,
+ QString num, bool sync, unsigned int serviceId )
{
LOGS_QDEBUG_2( "logs [ENG] -> LogsCall::createCallWithService(), num", num )
LOGS_QDEBUG_2( "logs [ENG] -> LogsCall::createCallWithService(), num", serviceId )
- XQServiceRequest snd(service, type, sync);
- snd << num << serviceId;
- // Start call at bg, call UI will bring itself to foreground when ever
- // it thinks it is good time to do it.
- XQRequestInfo info;
- info.setBackground(true);
- snd.setInfo(info);
- QVariant retValue;
- snd.send(retValue);
+ XQApplicationManager appMgr;
+ XQAiwRequest* request = appMgr.create(interface, operation, false);
+ if (request) {
+ QList<QVariant> arglist;
+ arglist.append(QVariant(num));
+ arglist.append(QVariant(serviceId));
+ request->setArguments(arglist);
+ XQRequestInfo info;
+ info.setBackground(true);
+ request->setInfo(info);
+ request->setSynchronous(sync);
+ QVariant ret(QVariant::Int);
+ request->send(ret);
+ delete request;
+ }
LOGS_QDEBUG( "logs [ENG] <- LogsCall::createCallWithService()" )
}
--- a/logsui/logsengine/src/logscommondata.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/src/logscommondata.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -25,6 +25,9 @@
#include <xqsettingsmanager.h>
#include <qcontactmanager.h>
#include <LogsDomainCRKeys.h>
+#include <QCoreApplication>
+#include <hbinstance.h>
+#include <hbcolorscheme.h>
static LogsCommonData* mLogsCommonInstance = 0;
@@ -44,14 +47,27 @@
//
// -----------------------------------------------------------------------------
//
-LogsCommonData::LogsCommonData() :
+LogsCommonData::LogsCommonData() : QObject(),
mContactManager(0), mMaxReadSize(-1),
mMaxReadSizeDir(LogsEvent::DirUndefined),
mSettingsManager(new XQSettingsManager()),
mMatchLen(logsDefaultMatchLength),
- mPredictiveSearchStatus(logsNotInitialized)
+ mPredictiveSearchStatus(logsNotInitialized),
+ mCompressed(false),
+ mPendingThemeChange(false)
{
- LOGS_QDEBUG( "logs [ENG] <-> LogsCommonData::LogsCommonData()" )
+ LOGS_QDEBUG( "logs [ENG] -> LogsCommonData::LogsCommonData()" )
+ // If client has created only coreapp, don't treat as GUI client
+ // since many things will not work properly
+ QApplication* app = qobject_cast<QApplication*>( qApp );
+ mIsInGuiProcess = ( app != 0 );
+ if ( mIsInGuiProcess ){
+ LOGS_QDEBUG( "logs [ENG] Full GUI" )
+ updateHighlightColor();
+ connect( hbInstance->theme(), SIGNAL ( changeFinished() ),
+ this, SLOT ( handleThemeChange()));
+ }
+ LOGS_QDEBUG( "logs [ENG] <- LogsCommonData::LogsCommonData()" )
}
// -----------------------------------------------------------------------------
@@ -259,5 +275,98 @@
return ok;
}
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+bool LogsCommonData::isGui() const
+{
+ return mIsInGuiProcess;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+const QString& LogsCommonData::highlightStart() const
+{
+ return mHighlightColorStart;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+const QString& LogsCommonData::highlightEnd() const
+{
+ return mHighlightColorEnd;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsCommonData::refreshData()
+{
+ LOGS_QDEBUG( "logs [ENG] -> LogsCommonData::refreshData()" )
+ bool prevCompressed = mCompressed;
+ mCompressed = false;
+ if ( isGui() && prevCompressed ){
+ updateHighlightColor();
+ if ( mPendingThemeChange ){
+ LOGS_QDEBUG( "logs [ENG] Theme changed while compressed" )
+ emit commonDataChanged();
+ }
+ }
+ mPendingThemeChange = false;
+ LOGS_QDEBUG( "logs [ENG] <- LogsCommonData::refreshData()" )
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsCommonData::compressData()
+{
+ mCompressed = true;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsCommonData::handleThemeChange()
+{
+ LOGS_QDEBUG_2( "logs [ENG] -> LogsCommonData::handleThemeChange(), compr", mCompressed )
+ if ( mCompressed ){
+ mPendingThemeChange = true;
+ } else {
+ updateHighlightColor();
+ emit commonDataChanged();
+ }
+ LOGS_QDEBUG( "logs [ENG] <- LogsCommonData::handleThemeChange()" )
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void LogsCommonData::updateHighlightColor()
+{
+ LOGS_QDEBUG( "logs [ENG] -> LogsCommonData::updateHighlightColor()" )
+ QColor highlight = HbColorScheme::color("qtc_lineedit_marker_normal");
+ QColor color = HbColorScheme::color("qtc_lineedit_selected");
+
+ mHighlightColorStart = QString("<span style=\"background-color: %1; color: %2\">")
+ .arg(highlight.name().toUpper())
+ .arg(color.name().toUpper());
+ mHighlightColorEnd = "</span>";
+
+ LOGS_QDEBUG_2( "logs [ENG] <- LogsCommonData::updateHighlightColor():",
+ mHighlightColorStart )
+}
+
+
// End of file
+
--- a/logsui/logsengine/src/logscontact.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/src/logscontact.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -29,6 +29,7 @@
#include <qcontactmanager.h>
#include <qcontactonlineaccount.h>
#include <qcontactphonenumber.h>
+#include <xqaiwdecl.h>
#include <xqappmgr.h>
#include <cntservicescontact.h>
@@ -125,14 +126,13 @@
LogsContact::RequestType type = allowedRequestType();
if ( type == TypeLogsContactOpen || type == TypeLogsContactOpenGroup) {
mCurrentRequest = type;
- QString interface("com.nokia.symbian.IContactsView");
- QString operation("openContactCard(int)");
+ QString operation(XQOP_CONTACTS_VIEW_CONTACT_CARD);
if (type == TypeLogsContactOpenGroup) {
- operation = "openGroup(int)";
+ operation = XQOP_CONTACTS_VIEW_GROUP;
}
QList<QVariant> arguments;
arguments.append( QVariant(mContactId) );
- ret = requestPhonebookService( interface, operation, arguments );
+ ret = requestPhonebookService( XQI_CONTACTS_VIEW, operation, arguments );
}
LOGS_QDEBUG_2( "logs [ENG] <- LogsContact::open(): ", ret )
@@ -147,7 +147,7 @@
{
LOGS_QDEBUG( "logs [ENG] -> LogsContact::save()" )
- bool ret = save("editCreateNew(QString,QString)");
+ bool ret = save(XQOP_CONTACTS_EDIT_CREATE_NEW);
LOGS_QDEBUG_2( "logs [ENG] <- LogsContact::save(): ", ret )
return ret;
@@ -161,7 +161,7 @@
{
LOGS_QDEBUG( "logs [ENG] -> LogsContact::updateExisting()" )
- bool ret = save("editUpdateExisting(QString,QString)");
+ bool ret = save(XQOP_CONTACTS_EDIT_UPDATE_EXISTING);
LOGS_QDEBUG( "logs [ENG] <- LogsContact::updateExisting()" )
return ret;
@@ -215,8 +215,7 @@
if ( arguments.count() == 2 ) {
mCurrentRequest = TypeLogsContactSave;
- QString interface("com.nokia.symbian.IContactsEdit");
- ret = requestPhonebookService( interface, operation, arguments );
+ ret = requestPhonebookService( XQI_CONTACTS_EDIT, operation, arguments );
} else {
LOGS_QDEBUG( "logs [ENG] !No Caller ID, not saving the contact..")
}
@@ -257,6 +256,8 @@
{
LOGS_QDEBUG_4( "logs [ENG] <-> LogsContact::handleError(): ", errorCode,
" ,msg: ", errorMessage)
+ Q_UNUSED(errorCode)
+ Q_UNUSED(errorMessage)
cancelServiceRequest();
}
@@ -270,8 +271,7 @@
//
void LogsContact::handleRequestCompleted(const QVariant& result)
{
- delete mAiwRequest;
- mAiwRequest = 0;
+ cancelServiceRequest();
bool retValOk = false;
int serviceRetVal = result.toInt(&retValOk);
LOGS_QDEBUG_3( "logs [ENG] -> LogsContact::handleRequestCompleted(), (retval, is_ok)",
--- a/logsui/logsengine/src/logsdetailsmodel.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/src/logsdetailsmodel.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -158,14 +158,15 @@
&& mSeparatorIndex < mDetailTexts.count()-1) {
LOGS_QDEBUG( "logs [ENG] separator state changed!" )
- mSeparatorCollapsed = !mSeparatorCollapsed;
- if (mSeparatorCollapsed) {
+ if (!mSeparatorCollapsed) {
LOGS_QDEBUG( "logs [ENG] collapsing separator" )
beginRemoveRows(QModelIndex(), mSeparatorIndex+1, mDetailTexts.count()-1);
+ mSeparatorCollapsed = !mSeparatorCollapsed;
endRemoveRows();
} else {
LOGS_QDEBUG( "logs [ENG] expanding separator" )
beginInsertRows(QModelIndex(), mSeparatorIndex+1, mDetailTexts.count()-1);
+ mSeparatorCollapsed = !mSeparatorCollapsed;
endInsertRows();
}
dataSet = true;
--- a/logsui/logsengine/src/logsmatchesmodel.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/src/logsmatchesmodel.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -352,6 +352,8 @@
mIconManager = new LogsThumbIconManager();
connect(mIconManager, SIGNAL(contactIconReady(int)),
this, SLOT(updateContactIcon(int)));
+ connect(&LogsCommonData::getInstance(), SIGNAL(commonDataChanged()),
+ this, SLOT(forceSearchQuery()));
}
}
@@ -732,6 +734,27 @@
}
// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QString LogsMatchesModelItemContainer::richText(const LogsCntText& cntText,
+ bool phoneNumber) const
+{
+ LogsCommonData& cd = LogsCommonData::getInstance();
+ QString richText;
+ if (phoneNumber) {
+ if (cntText.highlights() > 0) {
+ richText = mParentModel.phoneNumString(cntText.text());
+ richText.insert(cntText.highlights(),cd.highlightEnd());
+ richText.insert(0,cd.highlightStart());
+ }
+ } else {
+ richText = cntText.richText(cd.highlightStart(), cd.highlightEnd());
+ }
+ return richText;
+}
+
+// -----------------------------------------------------------------------------
// Note: Mapping of search result entry into caller ID is depended on
// updateSearchEntry() implemention.
// -----------------------------------------------------------------------------
@@ -743,7 +766,7 @@
getFormattedName(callerId, entry.firstName());
if ( callerId.length() == 0 ) {
- callerId = mParentModel.phoneNumString(entry.phoneNumber().richText());
+ callerId = richText(entry.phoneNumber(), true);
}
return callerId.trimmed();
@@ -778,7 +801,7 @@
{
foreach( LogsCntText name, list ) {
if ( name.text().length() > 0 ) {
- formattedName.append(name.richText());
+ formattedName.append(richText(name));
formattedName.append(" ");
}
}
@@ -794,7 +817,7 @@
{
foreach( LogsCntText name, list ) {
if ( name.text().length() > 0 ) {
- formattedName.append(name.richText());
+ formattedName.append(richText(name));
formattedName.append(" ");
formattedNameSimple.append(name.text());
formattedNameSimple.append(" ");
--- a/logsui/logsengine/src/logsmessage.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/src/logsmessage.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -19,8 +19,8 @@
#include "logsmessage.h"
#include "logslogger.h"
#include "logseventdata.h"
-#include <xqservicerequest.h>
#include <xqaiwdecl.h>
+#include <xqappmgr.h>
//SYSTEM
@@ -29,7 +29,7 @@
// -----------------------------------------------------------------------------
//
LogsMessage::LogsMessage(LogsEvent& event)
- :QObject(), mIsAllowed( false ), mContactId( 0 ), mService( 0 )
+ :QObject(), mIsAllowed(false), mContactId(0), mAiwRequest(0)
{
if ( event.logsEventData() && !event.logsEventData()->isCsCompatible() ){
LOGS_QDEBUG( "logs [ENG] LogsMessage::LogsMessage, not CS compatible" )
@@ -49,7 +49,7 @@
//
LogsMessage::LogsMessage(unsigned int contactId, const QString& number,
const QString& displayName)
- :QObject(), mIsAllowed( false ), mContactId( 0 ), mService( 0 )
+ :QObject(), mIsAllowed(false), mContactId(0), mAiwRequest(0)
{
if ( number.length() == 0 ){
LOGS_QDEBUG( "logs [ENG] LogsMessage::LogsMessage, not CS compatible" )
@@ -69,7 +69,7 @@
LogsMessage::~LogsMessage()
{
LOGS_QDEBUG( "logs [ENG] <-> LogsMessage::~LogsMessage()" )
- delete mService;
+ delete mAiwRequest;
}
// ----------------------------------------------------------------------------
@@ -88,74 +88,77 @@
bool LogsMessage::sendMessage()
{
LOGS_QDEBUG( "logs [ENG] -> LogsMessage::sendMessage()" )
-
- delete mService;
- mService = 0;
- QString serviceName("messaging.");
- serviceName.append(XQI_MESSAGE_SEND);
- mService = new XQServiceRequest(serviceName, XQOP_MESSAGE_SEND_WITH_ID, false);
- bool sending = doSendMessageToNumber(*mService, mNumber, mDisplayName, mContactId);
- connect(mService, SIGNAL(requestCompleted(QVariant)), this, SLOT(requestCompleted(QVariant)));
- connect(mService, SIGNAL(requestError(int)), this, SLOT(requestError(int)));
+ cancelServiceRequest();
+ bool sending(false);
+ XQApplicationManager appMng;
+ //TODO: change request to be embedded once messaging team has implemented
+ //handling of clientDisconnected() signal
+ mAiwRequest = appMng.create(XQI_MESSAGE_SEND, XQOP_MESSAGE_SEND_WITH_ID, false); // embedded
+ if (mAiwRequest) {
+ connect(mAiwRequest, SIGNAL(requestOk(const QVariant&)),
+ this, SLOT(handleRequestCompleted(const QVariant&)));
+ connect(mAiwRequest, SIGNAL(requestError(int,const QString&)),
+ this, SLOT(handleError(int,const QString&)));
+
+ QList<QVariant> arguments;
+ arguments.append(QVariant(mNumber));
+ arguments.append(QVariant(mContactId));
+ arguments.append(QVariant(mDisplayName));
+ mAiwRequest->setArguments(arguments);
+ mAiwRequest->setSynchronous(false);
+ sending = mAiwRequest->send();
+ }
return sending;
}
+
// ----------------------------------------------------------------------------
//
// ----------------------------------------------------------------------------
//
-bool LogsMessage::sendMessageToNumber(
- const QString& number, const QString& displayName, unsigned int contactId)
+void LogsMessage::cancelServiceRequest()
{
- LOGS_QDEBUG( "logs [ENG] -> LogsMessage::sendMessageToNumber()" )
- QString serviceName("messaging.");
- serviceName.append(XQI_MESSAGE_SEND);
- XQServiceRequest req(serviceName, XQOP_MESSAGE_SEND_WITH_ID, false);
- return doSendMessageToNumber(req, number, displayName, contactId);
+ LOGS_QDEBUG( "logs [ENG] -> LogsMessage::cancelServiceRequest()" )
+ delete mAiwRequest;
+ mAiwRequest = 0;
+ LOGS_QDEBUG( "logs [ENG] <- LogsMessage::cancelServiceRequest()" )
}
// ----------------------------------------------------------------------------
//
// ----------------------------------------------------------------------------
//
-void LogsMessage::requestCompleted(const QVariant& /*value*/)
+LogsMessage* LogsMessage::sendMessageToNumber(
+ const QString& number, const QString& displayName, unsigned int contactId)
{
- LOGS_QDEBUG( "logs [ENG] -> LogsMessage::requestCompleted()" )
-}
-
-// ----------------------------------------------------------------------------
-//
-// ----------------------------------------------------------------------------
-//
-void LogsMessage::requestError(int /*err*/)
-{
- LOGS_QDEBUG( "logs [ENG] -> LogsMessage::requestError()" )
+ LOGS_QDEBUG( "logs [ENG] -> LogsMessage::sendMessageToNumber()" )
+ LogsMessage* message = new LogsMessage(contactId, number, displayName);
+ message->sendMessage();
+ return message;
}
// ----------------------------------------------------------------------------
//
// ----------------------------------------------------------------------------
//
-bool LogsMessage::doSendMessageToNumber(
- XQServiceRequest& request, const QString& number,
- const QString& displayName, unsigned int contactId)
+void LogsMessage::handleRequestCompleted(const QVariant& result)
{
- LOGS_QDEBUG_4( "logs [ENG] -> LogsMessage::doSendMessageToNumber(), (num, name, id)",
- number, displayName, contactId )
+ LOGS_QDEBUG( "logs [ENG] <-> LogsMessage::handleRequestCompleted()" )
+ Q_UNUSED(result)
+ cancelServiceRequest();
+}
- QList<QVariant> arguments;
- arguments.append(QVariant(number));
- 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 )
-
- return ret;
+// ----------------------------------------------------------------------------
+//
+// ----------------------------------------------------------------------------
+//
+void LogsMessage::handleError(int errorCode, const QString& errorMessage)
+{
+ LOGS_QDEBUG_4( "logs [ENG] <-> LogsMessage::handleError(): ", errorCode,
+ " ,msg: ", errorMessage)
+ Q_UNUSED(errorCode)
+ Q_UNUSED(errorMessage)
+ cancelServiceRequest();
}
// End of file
--- a/logsui/logsengine/src/logsmodel.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/src/logsmodel.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -31,7 +31,6 @@
#include <QStringList>
#include <QtGui>
#include <hbfontspec.h>
-#include <hbinstance.h>
#include <hbstringutil.h>
Q_DECLARE_METATYPE(LogsEvent *)
@@ -50,7 +49,11 @@
{
LOGS_QDEBUG( "logs [ENG] -> LogsModel::LogsModel()" )
- initIcons();
+ if ( LogsCommonData::getInstance().isGui() ){
+ initIcons();
+ connect( &LogsCommonData::getInstance(), SIGNAL(commonDataChanged()),
+ this, SLOT(resetModel()) );
+ }
bool allEvents( mModelType == LogsFullModel );
mDbConnector = new LogsDbConnector( mEvents, allEvents, resourceControl );
@@ -62,9 +65,7 @@
this, SLOT( dataRemoved(QList<int>) ));
connect( mDbConnector, SIGNAL( dataReset() ),
this, SLOT( resetModel() ));
-
- connect( hbInstance->theme(), SIGNAL ( changeFinished() ),
- this, SLOT ( resetModel()));
+
mDbConnector->init();
mDbConnector->start();
@@ -142,6 +143,7 @@
{
LOGS_QDEBUG( "logs [ENG] -> LogsModel::refreshData()" )
int err = mDbConnector->refreshData();
+ LogsCommonData::getInstance().refreshData();
LOGS_QDEBUG_2( "logs [ENG] <- LogsModel::refreshData(), err", err )
return err;
}
@@ -154,6 +156,7 @@
{
LOGS_QDEBUG( "logs [ENG] -> LogsModel::compressData()" )
int err = mDbConnector->compressData();
+ LogsCommonData::getInstance().compressData();
LOGS_QDEBUG_2( "logs [ENG] <- LogsModel::compressData(), err", err )
return err;
}
@@ -232,6 +235,9 @@
list << dateAndTimeString( event->time().toTimeSpec(Qt::LocalTime) );
return QVariant(list);
} else if (role == Qt::DecorationRole) {
+ if ( !LogsCommonData::getInstance().isGui() ){
+ return QVariant();
+ }
QList<QVariant> icons;
getDecorationData(*event, icons);
return QVariant(icons);
@@ -480,3 +486,4 @@
return match;
}
+
--- a/logsui/logsengine/tsrc/at_logsengine/at_logsengine.pro Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/at_logsengine/at_logsengine.pro Fri Oct 15 14:47:48 2010 +0300
@@ -44,9 +44,11 @@
TARGET.EPOCALLOWDLLDATA = 1
LIBS += -llogsengine
MMP_RULES += SMPSAFE
+ CONFIG += symbian_test
}
-BLD_INF_RULES.prj_mmpfiles = "../../../tsrc/logdbmodifier/addeventtest/group/logclienttest.mmp"\
- "../../../tsrc/logdbmodifier/clearlisttest/group/clearlisttest.mmp"
+BLD_INF_RULES.prj_testmmpfiles = "../../../tsrc/logdbmodifier/addeventtest/group/logclienttest.mmp"\
+ "../../../tsrc/logdbmodifier/clearlisttest/group/clearlisttest.mmp"
-BLD_INF_RULES.prj_exports += "../../../tsrc/logdbmodifier/addeventtest/data/testlogclients.dat /epoc32/winscw/c/system/testlogclients.dat"
+BLD_INF_RULES.prj_testexports += "../../../tsrc/logdbmodifier/addeventtest/data/testlogclients.dat /epoc32/winscw/c/system/testlogclients.dat"
+
--- a/logsui/logsengine/tsrc/at_logsengine/inc/at_logsengine.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/at_logsengine/inc/at_logsengine.h Fri Oct 15 14:47:48 2010 +0300
@@ -18,10 +18,14 @@
#define AT_LOGSENGINE_H
#include <QObject>
+#include <QTimer>
#include <e32base.h>
class LogsModel;
class LogsCustomFilter;
+class LogsTestModelObserver;
+class CActiveSchedulerWait;
+class CDeltaTimer;
class AT_LogsEngine : public QObject
{
@@ -59,8 +63,37 @@
private:
LogsModel* mModel;
+ LogsTestModelObserver* mWaiter;
};
+class LogsTestModelObserver : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ LogsTestModelObserver();
+ virtual ~LogsTestModelObserver();
+ void startWaiting(int timeoutInMsec);
+
+public slots:
+
+ void somethingCompleted();
+
+private:
+
+ void startTimerForAsync(int msecs);
+
+ static TInt asyncTimerExpired(TAny* ptr);
+
+private:
+ CActiveSchedulerWait* mWait;
+ CDeltaTimer* mTimer;
+ TCallBack mTimerCallBack;
+ TDeltaTimerEntry mTimerEntry;
+};
+
#endif //AT_LOGSENGINE_H
+
--- a/logsui/logsengine/tsrc/at_logsengine/src/at_logsengine.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/at_logsengine/src/at_logsengine.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -65,18 +65,29 @@
{
TRAPD( err, clearEventsL() );
Q_ASSERT( err == KErrNone );
- QTest::qWait(2000);
+ User::After(2000000);
TRAP( err, writeEventsL() );
Q_ASSERT( err == KErrNone );
- QTest::qWait(2000);
- mModel = new LogsModel(LogsModel::LogsFullModel);
- QTest::qWait(5000); // wait model to be populated from db
+ User::After(2000000);
+ mWaiter = new LogsTestModelObserver;
+ mModel = new LogsModel(LogsModel::LogsFullModel, true);
+ mModel->refreshData();
+ connect( mModel, SIGNAL( dataChanged(const QModelIndex&,const QModelIndex&)),
+ mWaiter, SLOT(somethingCompleted()) );
+ connect( mModel, SIGNAL( rowsInserted(const QModelIndex&,int,int)),
+ mWaiter, SLOT(somethingCompleted()) );
+ connect( mModel, SIGNAL( rowsRemoved(const QModelIndex&,int,int)),
+ mWaiter, SLOT(somethingCompleted()) );
+ connect( mModel, SIGNAL(modelReset()),
+ mWaiter, SLOT(somethingCompleted()) );
+ mWaiter->startWaiting(5000);// wait model to be populated from db
}
void AT_LogsEngine::cleanupTestCase()
{
delete mModel;
mModel = 0;
+ delete mWaiter;
}
@@ -135,7 +146,11 @@
QVERIFY( unseenCount == 2 );
QSignalSpy spy( &filter, SIGNAL( markingCompleted(int)));
QVERIFY( filter.markEventsSeen() );
- QTest::qWait(1000); // wait marking completion
+ connect( &filter, SIGNAL( markingCompleted(int) ), mWaiter, SLOT( somethingCompleted() ) );
+ mWaiter->startWaiting(1000); // wait marking completion
+ mModel->compressData(); // Force refresh
+ mModel->refreshData();
+ mWaiter->startWaiting(2000); // wait db refresh completion
QVERIFY( spy.count() == 1 );
int seenCount = 0;
@@ -146,7 +161,7 @@
seenCount++;
}
}
- QVERIFY( seenCount == 2 );
+ QCOMPARE( seenCount, 2 );
}
@@ -159,9 +174,13 @@
int unseenCount = 0;
QSignalSpy spy( &filter, SIGNAL( clearingCompleted(int)));
QVERIFY( filter.clearEvents() );
- QTest::qWait(1000); // wait clearing completion
- QVERIFY( filter.rowCount() == 0 );
- QVERIFY( spy.count() == 1 );
+ connect( &filter, SIGNAL( clearingCompleted(int) ), mWaiter, SLOT( somethingCompleted() ) );
+ mWaiter->startWaiting(1000); // wait clearing completion
+ mModel->compressData(); // Force refresh
+ mModel->refreshData();
+ mWaiter->startWaiting(2000); // wait db update completion
+ QCOMPARE( filter.rowCount(), 0 );
+ QCOMPARE( spy.count(), 1 );
}
void AT_LogsEngine::testHomeScreenUsecase()
@@ -176,7 +195,15 @@
const int maxNumMissedCalls = 2;
filter.setMaxSize(maxNumMissedCalls);
LogsModel optimizedModel(LogsModel::LogsFullModel);
- QTest::qWait(5000); // wait model to be populated from db
+ connect( &optimizedModel, SIGNAL( dataChanged(const QModelIndex&,const QModelIndex&)),
+ mWaiter, SLOT(somethingCompleted()) );
+ connect( &optimizedModel, SIGNAL( rowsInserted(const QModelIndex&,int,int)),
+ mWaiter, SLOT(somethingCompleted()) );
+ connect( &optimizedModel, SIGNAL( rowsRemoved(const QModelIndex&,int,int)),
+ mWaiter, SLOT(somethingCompleted()) );
+ connect( &optimizedModel, SIGNAL(modelReset()),
+ mWaiter, SLOT(somethingCompleted()) );
+ mWaiter->startWaiting(5000);// wait model to be populated from db
filter.setSourceModel(&optimizedModel);
// Test data has 10 missed calls from Jeppa but readsize has been configured to 2 so
@@ -194,8 +221,15 @@
QStringList displayData = filter.data( filter.index(0, 0), Qt::DisplayRole ).toStringList();
QVERIFY( displayData.count() == 2 );
QVERIFY( displayData.at(0) == logsTestHomeScreenMissedCallerName );
- HbIcon icon = qVariantValue<HbIcon>( filter.data( filter.index(0, 0), Qt::DecorationRole ).toList().at(0) );
- QVERIFY( !icon.isNull() );
+ QVariant decor = filter.data( filter.index(0, 0), Qt::DecorationRole );
+ QApplication* app = qobject_cast<QApplication*>( qApp );
+ if ( app ){
+ HbIcon icon = qVariantValue<HbIcon>( decor.toList().at(0) );
+ QVERIFY( !icon.isNull() );
+ } else {
+ QVERIFY( decor.isNull() );
+ }
+
// Cenrep missed calls counter is not tested here
}
@@ -221,3 +255,59 @@
process.Resume();
CleanupStack::PopAndDestroy( &process );
}
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+
+LogsTestModelObserver::LogsTestModelObserver() :
+ mWait(0), mTimer(0), mTimerCallBack(asyncTimerExpired, this)
+{
+ mTimerEntry.Set(mTimerCallBack);
+ mWait = new CActiveSchedulerWait;
+ mTimer = CDeltaTimer::NewL(CActive::EPriorityStandard);
+
+}
+LogsTestModelObserver::~LogsTestModelObserver()
+{
+ if ( mTimer ){
+ mTimer->Remove( mTimerEntry );
+ }
+ delete mTimer;
+ if ( mWait && mWait->IsStarted() ){
+ mWait->AsyncStop();
+ }
+ delete mWait;
+
+}
+void LogsTestModelObserver::startWaiting(int timeoutInMsec)
+{
+ if ( !mWait->IsStarted() ){
+ startTimerForAsync(timeoutInMsec);
+ mWait->Start();
+ }
+}
+
+void LogsTestModelObserver::somethingCompleted()
+{
+ if ( mWait->IsStarted() ){
+ mWait->AsyncStop();
+ }
+}
+void LogsTestModelObserver::startTimerForAsync(int msecs)
+{
+ mTimer->Remove(mTimerEntry);
+ TTimeIntervalMicroSeconds32 interval(msecs*1000);
+ mTimer->Queue(interval, mTimerEntry);
+}
+
+TInt LogsTestModelObserver::asyncTimerExpired(TAny* ptr)
+{
+ if ( ptr ){
+ static_cast<LogsTestModelObserver*>( ptr )->somethingCompleted();
+ }
+ return 0;
+}
+
--- a/logsui/logsengine/tsrc/at_logsengine/src/main.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/at_logsengine/src/main.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -19,35 +19,48 @@
#include <QtTest/QtTest>
#include "at_logsengine.h"
-#include "testresultxmlparser.h"
+#include "testrunner.h"
int main(int argc, char *argv[])
{
- bool promptOnExit(true);
+ bool noGui(false);
+ bool noFullGui(false);
+ QString combinedOutputFileName;
for (int i=0; i<argc; i++) {
- if (QString(argv[i]) == "-noprompt")
- promptOnExit = false;
+ if (QString(argv[i]) == "-nogui"){
+ noGui = true;
+ } else if (QString(argv[i]) == "-nofullgui"){
+ noFullGui = true;
+ } else if (QString(argv[i]) == "-o" && i + 1 < argc ){
+ i++;
+ combinedOutputFileName = QString(argv[i]);
+ }
}
- printf("Running tests...\n");
-
- QApplication app(argc, argv);
- TestResultXmlParser parser;
+ TestRunner testRunner("API_Test_LogsEngine", combinedOutputFileName);
+ if ( noGui ){
+ CActiveScheduler* sched = new CActiveScheduler;
+ CActiveScheduler::Install(sched);
+ AT_LogsEngine test;
+ testRunner.runTests(test);
+ CActiveScheduler::Install(0);
+ delete sched;
+ } else if ( noFullGui ){
+ QCoreApplication app(argc, argv);
+ AT_LogsEngine test;
+ testRunner.runTests(test);
+ } else {
+ printf("Running tests...\n");
- AT_LogsEngine test;
- QString resultFileName = "c:/at_logs_logsEngine.xml";
- QStringList args_test( "at_logsEngine");
- args_test << "-xml" << "-o" << resultFileName;
- QTest::qExec(&test, args_test);
- parser.parseAndPrintResults(resultFileName,true);
-
- if (promptOnExit) {
- printf("Press any key...\n");
- getchar();
+ QApplication app(argc, argv);
+ AT_LogsEngine test;
+ testRunner.runTests(test);
}
+ testRunner.printResults();
return 0;
}
+
--- a/logsui/logsengine/tsrc/stubs/qthighway_stub.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/stubs/qthighway_stub.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -15,14 +15,12 @@
*
*/
-#include <xqservicerequest.h>
#include <xqrequestinfo.h>
#include <xqappmgr.h>
+#include <xqaiwrequest.h>
#include <QHash>
#include "qthighway_stub_helper.h"
-QString qtHighwayStubService;
-QString qtHighwayStubMessage;
bool qtHighwayStubRequestBg = false;
bool qtHighwayStubRequestEmbedded = false;
@@ -33,8 +31,6 @@
void QtHighwayStubHelper::reset()
{
- qtHighwayStubService.clear();
- qtHighwayStubMessage.clear();
qtHighwayStubRequestBg = false;
qtHighwayStubRequestEmbedded = false;
qtAiwStubInterface.clear();
@@ -53,14 +49,14 @@
qtAiwFailCreateRequest = fail;
}
-QString QtHighwayStubHelper::service()
+QString QtHighwayStubHelper::interface()
{
- return qtHighwayStubService;
+ return qtAiwStubInterface;
}
-QString QtHighwayStubHelper::message()
+QString QtHighwayStubHelper::operation()
{
- return qtHighwayStubMessage;
+ return qtAiwStubOperation;
}
bool QtHighwayStubHelper::isRequestBg()
@@ -73,48 +69,6 @@
return qtHighwayStubRequestEmbedded;
}
-XQServiceRequest::XQServiceRequest(
- const QString& service, const QString& message, const bool& synchronous)
-{
- qtHighwayStubService = service;
- qtHighwayStubMessage = message;
-}
-
-XQServiceRequest::~XQServiceRequest()
-{
-
-}
-
-
-void XQServiceRequest::setArguments(const QList<QVariant> &arguments)
-{
- Q_UNUSED(arguments)
-}
-
-QString XQServiceRequest::service() const
-{
- return qtHighwayStubService;
-}
-
-QString XQServiceRequest::message() const
-{
- return qtHighwayStubMessage;
-}
-
-bool XQServiceRequest::send(QVariant& retValue)
-{
- return true;
-}
-void XQServiceRequest::addArg(const QVariant& v)
-{
-
-}
-
-void XQServiceRequest::setInfo(const XQRequestInfo &info)
-{
- Q_UNUSED(info);
-}
-
XQRequestInfo::XQRequestInfo()
{
}
@@ -204,11 +158,23 @@
return true;
}
+bool XQAiwRequest::send(QVariant &returnValue)
+{
+ Q_UNUSED(returnValue)
+ return true;
+}
+
void XQAiwRequest::setSynchronous(bool synchronous)
{
qtAiwStubSynchronous = synchronous;
}
+void XQAiwRequest::setInfo(const XQRequestInfo &info)
+{
+ Q_UNUSED(info)
+}
+
+
XQAiwInterfaceDescriptor::XQAiwInterfaceDescriptor()
{
}
--- a/logsui/logsengine/tsrc/stubs/qthighway_stub_helper.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/stubs/qthighway_stub_helper.h Fri Oct 15 14:47:48 2010 +0300
@@ -22,8 +22,8 @@
class QtHighwayStubHelper{
public:
static void reset();
- static QString service();
- static QString message();
+ static QString interface();
+ static QString operation();
static bool isRequestBg();
static bool isRequestEmbedded();
static bool isRequestSynchronous();
--- a/logsui/logsengine/tsrc/stubs/xqaiwrequest.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/stubs/xqaiwrequest.h Fri Oct 15 14:47:48 2010 +0300
@@ -24,7 +24,7 @@
#include <QList>
#include <QVariant>
#include <xqaiwinterfacedescriptor.h>
-
+class XQRequestInfo;
class XQAiwRequest : public QObject
{
@@ -41,11 +41,12 @@
const XQAiwInterfaceDescriptor &descriptor() const;
bool send();
+ bool send(QVariant &returnValue);
const QString &operation() const;
void setSynchronous(bool synchronous);
-
+ void setInfo(const XQRequestInfo &info);
signals:
--- a/logsui/logsengine/tsrc/stubs/xqservicerequest.h Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +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 XQSERVICEREQUEST_H
-#define XQSERVICEREQUEST_H
-
-#include <QVariant>
-#include <xqrequestinfo.h>
-#include <QObject>
-
-class XQServiceRequest : public QObject
-{
- Q_OBJECT
-public:
-
- XQServiceRequest();
- XQServiceRequest(const QString& fullServiceName, const QString& message, const bool& synchronous = true);
- virtual ~XQServiceRequest();
-
- bool send(QVariant& retValue) ;
-
- void setSynchronous(const bool &synchronous);
- bool isSynchronous() const;
-
- QString service() const;
- QString message() const;
-
- void setArguments(const QList<QVariant> &arguments);
-
- template<typename T>
- inline XQServiceRequest &operator<< (const T &var)
- {
- QVariant v = qVariantFromValue(var);
- addArg(v);
- return *this;
- }
-
- void setInfo(const XQRequestInfo &info);
- XQRequestInfo info() const;
-
-signals:
- void requestCompleted(const QVariant& value) ;
- void requestError(int err);
-
-private:
- void addArg(const QVariant& v);
-};
-
-
-#endif
--- a/logsui/logsengine/tsrc/ut_logsengine/inc/ut_logscommondata.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/ut_logsengine/inc/ut_logscommondata.h Fri Oct 15 14:47:48 2010 +0300
@@ -49,6 +49,10 @@
void testClearMissedCallsCounter();
void testPredictiveSearchStatus();
void testSetPredictiveSearch();
+ void testRefreshData();
+ void testCompressData();
+ void testHandleThemeChange();
+ void testHighlightColor();
private:
--- a/logsui/logsengine/tsrc/ut_logsengine/src/main.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/main.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -41,7 +41,7 @@
QApplication app(argc, argv);
QStringList args = app.arguments();
- QString combinedOutputFileName;
+ QString combinedOutputFileName = "C:/shared/eunit/logs/ut_logsengine_log.xml"; // ATS default
for ( int i = 0; i < args.count(); i++ ){
QString arg = args.at(i);
if ( arg == QString("-o") && i + 1 < args.count() ){
--- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logscall.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logscall.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -22,9 +22,9 @@
#include "qthighway_stub_helper.h"
#include "hbstubs_helper.h"
+#include <xqaiwdeclplat.h>
#include <QtTest/QtTest>
-const char logsICallDial[] = "phoneui.com.nokia.symbian.ICallDial";
void UT_LogsCall::initTestCase()
{
@@ -133,28 +133,44 @@
{
QtHighwayStubHelper::reset();
mLogsCall->call(LogsCall::TypeLogsVoiceCall);
- QVERIFY( QtHighwayStubHelper::service() == logsICallDial );
- QVERIFY( QtHighwayStubHelper::message() == "dial(QString)" );
+ QVERIFY( QtHighwayStubHelper::interface() == XQI_CALL_DIAL );
+ QVERIFY( QtHighwayStubHelper::operation() == "dial(QString)" );
QVERIFY( QtHighwayStubHelper::isRequestBg() );
QtHighwayStubHelper::reset();
mLogsCall->call(LogsCall::TypeLogsVideoCall);
- QVERIFY( QtHighwayStubHelper::service() == logsICallDial );
- QVERIFY( QtHighwayStubHelper::message() == "dialVideo(QString)" );
+ QVERIFY( QtHighwayStubHelper::interface() == XQI_CALL_DIAL );
+ QVERIFY( QtHighwayStubHelper::operation() == "dialVideo(QString)" );
QVERIFY( QtHighwayStubHelper::isRequestBg() );
+ // Calling fails (aiwrequest creation fails)
+ QtHighwayStubHelper::reset();
+ QtHighwayStubHelper::setFailCreateAiwRequest(true);
+ mLogsCall->call(LogsCall::TypeLogsVideoCall);
+ QVERIFY( QtHighwayStubHelper::interface().isEmpty() );
+ QVERIFY( QtHighwayStubHelper::operation().isEmpty() );
+ QVERIFY( !QtHighwayStubHelper::isRequestBg() );
+
QtHighwayStubHelper::reset();
mLogsCall->mServiceId = 3;
mLogsCall->call(LogsCall::TypeLogsVoIPCall);
- QVERIFY( QtHighwayStubHelper::service() == logsICallDial );
- QVERIFY( QtHighwayStubHelper::message() == "dialVoipService(QString,int)" );
+ QVERIFY( QtHighwayStubHelper::interface() == XQI_CALL_DIAL );
+ QVERIFY( QtHighwayStubHelper::operation() == "dialVoipService(QString,int)" );
QVERIFY( QtHighwayStubHelper::isRequestBg() );
+ // Calling fails (aiwrequest creation fails)
+ QtHighwayStubHelper::reset();
+ QtHighwayStubHelper::setFailCreateAiwRequest(true);
+ mLogsCall->call(LogsCall::TypeLogsVoIPCall);
+ QVERIFY( QtHighwayStubHelper::interface().isEmpty() );
+ QVERIFY( QtHighwayStubHelper::operation().isEmpty() );
+ QVERIFY( !QtHighwayStubHelper::isRequestBg() );
+
// Not supported calltype
QtHighwayStubHelper::reset();
mLogsCall->call(static_cast<LogsCall::CallType>(9999));
- QVERIFY( QtHighwayStubHelper::service().isEmpty() );
- QVERIFY( QtHighwayStubHelper::message().isEmpty() );
+ QVERIFY( QtHighwayStubHelper::interface().isEmpty() );
+ QVERIFY( QtHighwayStubHelper::operation().isEmpty() );
QVERIFY( !QtHighwayStubHelper::isRequestBg() );
// No number, call is anyway tried so that phone shows error note
@@ -162,8 +178,8 @@
HbStubHelper::reset();
mLogsCall->mNumber.clear();
mLogsCall->call(LogsCall::TypeLogsVoiceCall);
- QVERIFY( QtHighwayStubHelper::service() == logsICallDial );
- QVERIFY( QtHighwayStubHelper::message() == "dial(QString)" );
+ QVERIFY( QtHighwayStubHelper::interface() == XQI_CALL_DIAL );
+ QVERIFY( QtHighwayStubHelper::operation() == "dial(QString)" );
QVERIFY( QtHighwayStubHelper::isRequestBg() );
QVERIFY( HbStubHelper::notificationDialogTxt().isEmpty() );
@@ -172,8 +188,8 @@
HbStubHelper::reset();
mLogsCall->mContactId = 5;
mLogsCall->call(LogsCall::TypeLogsVoiceCall);
- QVERIFY( QtHighwayStubHelper::service().isEmpty() );
- QVERIFY( QtHighwayStubHelper::message().isEmpty() );
+ QVERIFY( QtHighwayStubHelper::interface().isEmpty() );
+ QVERIFY( QtHighwayStubHelper::operation().isEmpty() );
QVERIFY( HbStubHelper::notificationDialogTxt() == hbTrId("txt_dial_dpopinfo_no_saved_number_for_this_contact") );
}
@@ -181,22 +197,22 @@
{
QtHighwayStubHelper::reset();
mLogsCall->initiateCallback();
- QVERIFY( QtHighwayStubHelper::service() == logsICallDial );
- QVERIFY( QtHighwayStubHelper::message() == "dial(QString)" );
+ QVERIFY( QtHighwayStubHelper::interface() == XQI_CALL_DIAL );
+ QVERIFY( QtHighwayStubHelper::operation() == "dial(QString)" );
QVERIFY( QtHighwayStubHelper::isRequestBg() );
mLogsCall->mDefaultCall = LogsCall::TypeLogsVideoCall;
QtHighwayStubHelper::reset();
mLogsCall->initiateCallback();
- QVERIFY( QtHighwayStubHelper::service() == logsICallDial );
- QVERIFY( QtHighwayStubHelper::message() == "dialVideo(QString)" );
+ QVERIFY( QtHighwayStubHelper::interface() == XQI_CALL_DIAL );
+ QVERIFY( QtHighwayStubHelper::operation() == "dialVideo(QString)" );
QVERIFY( QtHighwayStubHelper::isRequestBg() );
mLogsCall->mDefaultCall = LogsCall::TypeLogsVoIPCall;
QtHighwayStubHelper::reset();
mLogsCall->mServiceId = 3;
mLogsCall->initiateCallback();
- QVERIFY( QtHighwayStubHelper::service() == logsICallDial );
- QVERIFY( QtHighwayStubHelper::message() == "dialVoipService(QString,int)" );
+ QVERIFY( QtHighwayStubHelper::interface() == XQI_CALL_DIAL );
+ QVERIFY( QtHighwayStubHelper::operation() == "dialVoipService(QString,int)" );
QVERIFY( QtHighwayStubHelper::isRequestBg() );
}
--- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logscommondata.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logscommondata.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -18,6 +18,7 @@
#include "logscommondata.h"
#include "logsconfigurationparams.h"
#include <xqsettingsmanager.h>
+#include <hbcolorscheme.h>
#include <QtTest/QtTest>
@@ -137,3 +138,71 @@
QVERIFY( XQSettingsManager::mCurrentVal == 2 );
}
+void UT_LogsCommonData::testRefreshData()
+{
+ // Theme change not pending
+ LogsCommonData& ct = LogsCommonData::getInstance();
+ QSignalSpy spy( &ct, SIGNAL(commonDataChanged()) );
+ ct.mCompressed = true;
+ ct.mHighlightColorStart.clear();
+ ct.refreshData();
+ QCOMPARE( spy.count(), 0 );
+ QVERIFY( !ct.mCompressed );
+ QVERIFY( !ct.mHighlightColorStart.isEmpty() );
+
+ // Pending theme change
+ ct.mPendingThemeChange = true;
+ ct.mCompressed = true;
+ ct.mHighlightColorStart.clear();
+ ct.refreshData();
+ QCOMPARE( spy.count(), 1 );
+ QVERIFY( !ct.mCompressed );
+ QVERIFY( !ct.mHighlightColorStart.isEmpty() );
+
+ // No action when already refreshed
+ ct.refreshData();
+ QCOMPARE( spy.count(), 1 );
+ QVERIFY( !ct.mCompressed );
+ QVERIFY( !ct.mHighlightColorStart.isEmpty() );
+}
+
+void UT_LogsCommonData::testCompressData()
+{
+ LogsCommonData& ct = LogsCommonData::getInstance();
+ ct.mCompressed = false;
+ ct.compressData();
+ QVERIFY( ct.mCompressed );
+}
+
+void UT_LogsCommonData::testHandleThemeChange()
+{
+ LogsCommonData& ct = LogsCommonData::getInstance();
+ QSignalSpy spy( &ct, SIGNAL(commonDataChanged()) );
+
+ // Theme changed when not compressed
+ ct.mCompressed = false;
+ ct.mPendingThemeChange = false;
+ ct.handleThemeChange();
+ QCOMPARE( spy.count(), 1 );
+ QVERIFY( !ct.mPendingThemeChange );
+
+ // Theme changed when compressed
+ spy.clear();
+ ct.mCompressed = true;
+ ct.handleThemeChange();
+ QCOMPARE( spy.count(), 0 );
+ QVERIFY( ct.mPendingThemeChange );
+}
+
+void UT_LogsCommonData::testHighlightColor()
+{
+ LogsCommonData& ct = LogsCommonData::getInstance();
+ QColor highlight = HbColorScheme::color("qtc_lineedit_marker_normal");
+ QColor color = HbColorScheme::color("qtc_lineedit_selected");
+ QString start = QString("<span style=\"background-color: %1; color: %2\">")
+ .arg(highlight.name().toUpper())
+ .arg(color.name().toUpper());
+ QCOMPARE( ct.highlightStart(), start );
+ QCOMPARE( ct.highlightEnd(), QString("</span>") );
+}
+
--- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logscontact.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logscontact.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -24,12 +24,10 @@
#include "qthighway_stub_helper.h"
#include <xqaiwrequest.h>
+#include <xqaiwdecl.h>
#include <QtTest/QtTest>
const int logsContactsLocalIdTest1 = 1;
-const char logsIContactsView[] = "com.nokia.symbian.IContactsView";
-const char logsIContactsEdit[] = "com.nokia.symbian.IContactsEdit";
-
const int groupId = 99;
@@ -131,8 +129,8 @@
QVERIFY( mLogsContact->mAiwRequest );
QVERIFY( mLogsContact->mCurrentRequest == LogsContact::TypeLogsContactOpen );
QVERIFY( mLogsContact->mAiwRequest->descriptor().interfaceName()
- == logsIContactsView );
- QVERIFY( mLogsContact->mAiwRequest->operation() == "openContactCard(int)" );
+ == XQI_CONTACTS_VIEW );
+ QVERIFY( mLogsContact->mAiwRequest->operation() == XQOP_CONTACTS_VIEW_CONTACT_CARD );
QVERIFY( QtHighwayStubHelper::isRequestEmbedded() );
QVERIFY( !QtHighwayStubHelper::isRequestSynchronous() );
@@ -143,8 +141,8 @@
QVERIFY( contactWithoutEvent.mAiwRequest );
QVERIFY( contactWithoutEvent.mCurrentRequest == LogsContact::TypeLogsContactOpen );
QVERIFY( contactWithoutEvent.mAiwRequest->descriptor().interfaceName()
- == logsIContactsView );
- QVERIFY( contactWithoutEvent.mAiwRequest->operation() == "openContactCard(int)" );
+ == XQI_CONTACTS_VIEW );
+ QVERIFY( contactWithoutEvent.mAiwRequest->operation() == XQOP_CONTACTS_VIEW_CONTACT_CARD );
QVERIFY( QtHighwayStubHelper::isRequestEmbedded() );
QVERIFY( !QtHighwayStubHelper::isRequestSynchronous() );
@@ -159,8 +157,8 @@
QVERIFY( mLogsContact->mAiwRequest );
QVERIFY( mLogsContact->mCurrentRequest == LogsContact::TypeLogsContactOpenGroup );
QVERIFY( mLogsContact->mAiwRequest->descriptor().interfaceName()
- == logsIContactsView );
- QVERIFY( mLogsContact->mAiwRequest->operation() == "openGroup(int)" );
+ == XQI_CONTACTS_VIEW );
+ QVERIFY( mLogsContact->mAiwRequest->operation() == XQOP_CONTACTS_VIEW_GROUP );
QVERIFY( QtHighwayStubHelper::isRequestEmbedded() );
QVERIFY( !QtHighwayStubHelper::isRequestSynchronous() );
@@ -192,8 +190,8 @@
QVERIFY( mLogsContact->mAiwRequest );
QVERIFY( mLogsContact->mCurrentRequest == LogsContact::TypeLogsContactSave );
QVERIFY( mLogsContact->mAiwRequest->descriptor().interfaceName()
- == logsIContactsEdit );
- QVERIFY( mLogsContact->mAiwRequest->operation() == "editCreateNew(QString,QString)" );
+ == XQI_CONTACTS_EDIT );
+ QVERIFY( mLogsContact->mAiwRequest->operation() == XQOP_CONTACTS_EDIT_CREATE_NEW );
QVERIFY( QtHighwayStubHelper::isRequestEmbedded() );
QVERIFY( !QtHighwayStubHelper::isRequestSynchronous() );
@@ -212,8 +210,8 @@
QVERIFY( mLogsContact->mAiwRequest );
QVERIFY( mLogsContact->mCurrentRequest == LogsContact::TypeLogsContactSave );
QVERIFY( mLogsContact->mAiwRequest->descriptor().interfaceName()
- == logsIContactsEdit );
- QVERIFY( mLogsContact->mAiwRequest->operation() == "editCreateNew(QString,QString)" );
+ == XQI_CONTACTS_EDIT );
+ QVERIFY( mLogsContact->mAiwRequest->operation() == XQOP_CONTACTS_EDIT_CREATE_NEW );
QVERIFY( QtHighwayStubHelper::isRequestEmbedded() );
QVERIFY( !QtHighwayStubHelper::isRequestSynchronous() );
}
@@ -234,8 +232,8 @@
QVERIFY( mLogsContact->mAiwRequest );
QVERIFY( mLogsContact->mCurrentRequest == LogsContact::TypeLogsContactSave );
QVERIFY( mLogsContact->mAiwRequest->descriptor().interfaceName()
- == logsIContactsEdit );
- QVERIFY( mLogsContact->mAiwRequest->operation() == "editUpdateExisting(QString,QString)" );
+ == XQI_CONTACTS_EDIT );
+ QVERIFY( mLogsContact->mAiwRequest->operation() == XQOP_CONTACTS_EDIT_UPDATE_EXISTING );
QVERIFY( QtHighwayStubHelper::isRequestEmbedded() );
QVERIFY( !QtHighwayStubHelper::isRequestSynchronous() );
}
--- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsdetailsmodel.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsdetailsmodel.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -530,27 +530,27 @@
// Collapsing duplicates ok
QVERIFY( mModel->rowCount(QModelIndex()) == 5 );
- mModel->setData( mModel->index(separatorIdx), QVariant(true) );
+ QVERIFY( mModel->setData( mModel->index(separatorIdx), QVariant(true) ) );
QVERIFY( mModel->rowCount(QModelIndex()) == 3 );
QVERIFY( mModel->mSeparatorCollapsed );
// Expanding fails, wrong separator index
- mModel->setData( mModel->index(separatorIdx+2), QVariant(false) );
+ QVERIFY( !mModel->setData( mModel->index(separatorIdx+2), QVariant(false) ) );
QVERIFY( mModel->rowCount(QModelIndex()) == 3 );
QVERIFY( mModel->mSeparatorCollapsed );
// Expanding fails, invalid data
- mModel->setData( mModel->index(separatorIdx), QVariant() );
+ QVERIFY( !mModel->setData( mModel->index(separatorIdx), QVariant() ) );
QVERIFY( mModel->rowCount(QModelIndex()) == 3 );
QVERIFY( mModel->mSeparatorCollapsed );
// Collapsing fails, already collapsed
- mModel->setData( mModel->index(separatorIdx), QVariant(true) );
+ QVERIFY( !mModel->setData( mModel->index(separatorIdx), QVariant(true) ) );
QVERIFY( mModel->rowCount(QModelIndex()) == 3 );
QVERIFY( mModel->mSeparatorCollapsed );
// Expanding ok
- mModel->setData( mModel->index(separatorIdx), QVariant(false) );
+ QVERIFY( mModel->setData( mModel->index(separatorIdx), QVariant(false) ) );
QVERIFY( mModel->rowCount(QModelIndex()) == 5 );
QVERIFY( !mModel->mSeparatorCollapsed );
}
--- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsmatchesmodel.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsmatchesmodel.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -671,10 +671,15 @@
QVERIFY( callerId == "long firstname" );
// Firstname is missing, phone number is used
+ LogsCommonData& cd = LogsCommonData::getInstance();
+ cd.mHighlightColorStart = "<b>";
+ cd.mHighlightColorEnd = "</b>";
HbStubHelper::stringUtilDigitConversion(true);
entry.setFirstName("");
+ entry.setHighlights("12");
+
callerId = item.getFormattedCallerId(entry);
- QCOMPARE( callerId, QString("conv number") );
+ QCOMPARE( callerId, QString("<b>co</b>nv number") );
}
// -----------------------------------------------------------------------------
--- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsmessage.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsmessage.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -20,6 +20,7 @@
#include "logseventdata.h"
#include "qthighway_stub_helper.h"
+#include <xqaiwdecl.h>
#include <QtTest/QtTest>
void UT_LogsMessage::initTestCase()
@@ -79,24 +80,43 @@
{
QtHighwayStubHelper::reset();
QVERIFY( mLogsMessage->sendMessage() );
- QVERIFY( QtHighwayStubHelper::service() == "messaging.com.nokia.symbian.IMessageSend" );
- QVERIFY( QtHighwayStubHelper::message() == "send(QString,qint32,QString)" );
+ QVERIFY( QtHighwayStubHelper::interface() == XQI_MESSAGE_SEND );
+ QVERIFY( QtHighwayStubHelper::operation() == XQOP_MESSAGE_SEND_WITH_ID );
+ QVERIFY( mLogsMessage->mAiwRequest );
+
+ //Test handleError() and handleRequestComplete()
+ mLogsMessage->handleError(0, QString());
+ QVERIFY( !mLogsMessage->mAiwRequest );
+ mLogsMessage->handleRequestCompleted(QVariant());
+ QVERIFY( !mLogsMessage->mAiwRequest );
+ // Sending message fails (aiwrequest creation fails)
+ QtHighwayStubHelper::reset();
+ QtHighwayStubHelper::setFailCreateAiwRequest(true);
+ QVERIFY( !mLogsMessage->sendMessage() );
+ QVERIFY( QtHighwayStubHelper::interface().isEmpty() );
+ QVERIFY( QtHighwayStubHelper::operation().isEmpty() );
+ QVERIFY( !mLogsMessage->mAiwRequest );
}
void UT_LogsMessage::testSendMessageToNumber()
{
QtHighwayStubHelper::reset();
- QVERIFY( mLogsMessage->sendMessageToNumber( "1234567" ) );
- QVERIFY( QtHighwayStubHelper::service() == "messaging.com.nokia.symbian.IMessageSend" );
- QVERIFY( QtHighwayStubHelper::message() == "send(QString,qint32,QString)" );
+ LogsMessage* message(0);
+ QVERIFY( message = mLogsMessage->sendMessageToNumber( "1234567" ) );
+ QVERIFY( QtHighwayStubHelper::interface() == XQI_MESSAGE_SEND );
+ QVERIFY( QtHighwayStubHelper::operation() == XQOP_MESSAGE_SEND_WITH_ID );
+ delete message;
+
QtHighwayStubHelper::reset();
- QVERIFY( mLogsMessage->sendMessageToNumber( "1234567", "name" ) );
- QVERIFY( QtHighwayStubHelper::service() == "messaging.com.nokia.symbian.IMessageSend" );
- QVERIFY( QtHighwayStubHelper::message() == "send(QString,qint32,QString)" );
+ QVERIFY( message = mLogsMessage->sendMessageToNumber( "1234567", "name" ) );
+ QVERIFY( QtHighwayStubHelper::interface() == XQI_MESSAGE_SEND );
+ QVERIFY( QtHighwayStubHelper::operation() == XQOP_MESSAGE_SEND_WITH_ID );
+ delete message;
+
QtHighwayStubHelper::reset();
- QVERIFY( mLogsMessage->sendMessageToNumber( "4234567", "namef", 3 ) );
- QVERIFY( QtHighwayStubHelper::service() == "messaging.com.nokia.symbian.IMessageSend" );
- QVERIFY( QtHighwayStubHelper::message() == "send(QString,qint32,QString)" );
+ QVERIFY( message = mLogsMessage->sendMessageToNumber( "4234567", "namef", 3 ) );
+ QVERIFY( QtHighwayStubHelper::interface() == XQI_MESSAGE_SEND );
+ QVERIFY( QtHighwayStubHelper::operation() == XQOP_MESSAGE_SEND_WITH_ID );
+ delete message;
}
-
--- a/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsmodel.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/ut_logsengine/src/ut_logsmodel.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -75,7 +75,15 @@
void UT_LogsModel::testConstructor()
{
+ // Model in gui process
QVERIFY( mModel );
+ QVERIFY( mModel->mIcons.count() > 0 );
+
+ // Model in non-gui process
+ LogsCommonData::getInstance().mIsInGuiProcess = false;
+ LogsModel noGuiModel;
+ QVERIFY( noGuiModel.mIcons.count() == 0 );
+
}
void UT_LogsModel::testRowCount()
@@ -112,6 +120,10 @@
QVariant decorationData = mModel->data(mModel->index(0), Qt::DecorationRole);
QVERIFY ( decorationData.canConvert< QList<QVariant> >() );
+ QList<QVariant> iconList = decorationData.toList();
+ QVERIFY ( iconList.count() > 0 );
+ HbIcon icon = qVariantValue<HbIcon>( iconList.at(0) );
+ QVERIFY ( !icon.isNull() );
// Full event
QVariant fullEventdata = mModel->data(mModel->index(0), LogsModel::RoleFullEvent);
@@ -164,6 +176,16 @@
contactData = mModel->data(mModel->index(0), LogsModel::RoleContact);
contact = qVariantValue<LogsContact *>( contactData );
QVERIFY( !contact );
+
+ // No gui
+ LogsCommonData::getInstance().mIsInGuiProcess = false;
+ LogsModel noGuiModel;
+ LogsEvent* event2 = new LogsEvent();
+ event2->setDirection(LogsEvent::DirMissed);
+ event2->setEventType(LogsEvent::TypeVideoCall);
+ noGuiModel.mEvents.append(event2);
+ QVariant decorationData2 = noGuiModel.data(noGuiModel.index(0), Qt::DecorationRole);
+ QVERIFY ( decorationData2.isNull() );
}
void UT_LogsModel::testDataAdded()
@@ -347,6 +369,18 @@
mModel->getDecorationData(*event, icons);
QVERIFY(icons.count() == 1);
LOGS_TEST_CMP_ICONS(icons.at(0), mModel->mIcons.value( logsMissedVoiceCallUnseenIconId ));
+
+ // Model in non-gui process, no icons used
+ LogsCommonData::getInstance().mIsInGuiProcess = false;
+ icons.clear();
+ LogsModel noGuiModel;
+ LogsEvent* event2 = new LogsEvent();
+ event2->setDirection(LogsEvent::DirMissed);
+ event2->setEventType(LogsEvent::TypeVideoCall);
+ noGuiModel.mEvents.append(event2);
+ noGuiModel.getDecorationData(*event2, icons);
+ QVERIFY(icons.count() == 0);
+
}
void UT_LogsModel::testIconName()
@@ -530,14 +564,17 @@
void UT_LogsModel::testRefreshData()
{
+ LogsCommonData::getInstance().mCompressed = true;
QVERIFY( mModel->refreshData() == 0 );
QVERIFY( LogsDbConnectorStubHelper::lastCalledFunction() == "refreshData" );
+ QVERIFY( !LogsCommonData::getInstance().mCompressed );
}
void UT_LogsModel::testCompressData()
{
QVERIFY( mModel->compressData() == 0 );
QVERIFY( LogsDbConnectorStubHelper::lastCalledFunction() == "compressData" );
+ QVERIFY( LogsCommonData::getInstance().mCompressed );
}
void UT_LogsModel::testPredictiveSearchStatus()
@@ -604,3 +641,4 @@
QVERIFY( spy.count() == 0 );
QVERIFY( spy2.count() == 0 );
}
+
--- a/logsui/logsengine/tsrc/ut_logsengine/ut_logsengine.pro Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsengine/tsrc/ut_logsengine/ut_logsengine.pro Fri Oct 15 14:47:48 2010 +0300
@@ -36,7 +36,6 @@
DEFINES += QT_NO_DEBUG_OUTPUT
# Input
-HEADERS += ../stubs/xqservicerequest.h
HEADERS += ../stubs/xqaiwrequest.h
HEADERS += ../../logssymbianos/tsrc/stubs/xqsettingskey.h
HEADERS += ../../logssymbianos/tsrc/stubs/xqsettingsmanager.h
@@ -126,4 +125,7 @@
TARGET.EPOCALLOWDLLDATA = 1
LIBS += -lqtcontacts -lthumbnailmanagerqt -lxqservice -lxqserviceutil
MMP_RULES += SMPSAFE
+ CONFIG += symbian_test
+ coverage: CONFIG -= symbian_test
}
+
--- a/logsui/logsservices/bwins/logsservicesu.def Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
- ?start@LogsServices@@SAHW4LogsView@1@_NABVQString@@@Z @ 1 NONAME ; int LogsServices::start(enum LogsServices::LogsView, bool, class QString const &)
-
--- a/logsui/logsservices/eabi/logsservicesu.def Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
- _ZN12LogsServices5startENS_8LogsViewEbRK7QString @ 1 NONAME
-
--- a/logsui/logsservices/logsservices.pro Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +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:
-#
-#
-
-TEMPLATE = lib
-
-TARGET = logsservices
-CONFIG += dll
-
-INCLUDEPATH += ./
-INCLUDEPATH += ../inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-# Input
-
-SOURCES += src/logsservices.cpp
-
-DEFINES += LOGSSERVICES_LIB
-
-libFiles.sources = logsservices.dll
-libFiles.path = "!:/sys/bin"
-DEPLOYMENT += libFiles
-
-symbian: {
- TARGET.UID2 = 0x1000008d
- TARGET.UID3 = 0x10282EBB
-
- TARGET.CAPABILITY = CAP_GENERAL_DLL
- TARGET.EPOCALLOWDLLDATA = 1
- LIBS += -lxqservice -lxqserviceutil
-
- defFiles = "$${LITERAL_HASH}ifdef WINS" \
- "DEFFILE bwins/logsservices.def" \
- "$${LITERAL_HASH}else" \
- "DEFFILE eabi/logsservices.def" \
- "$${LITERAL_HASH}endif"
- MMP_RULES += defFiles
- MMP_RULES += SMPSAFE
-}
--- a/logsui/logsservices/src/logsservices.cpp Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +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 <xqservicerequest.h>
-#include <logsservices.h>
-#include "logslogger.h"
-
-/*!
- \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 )
- // Need to do request in async manner, otherwise new logs ui process
- // will be started due bug(?) in highway.
-
- bool res( false );
- int retValue = -1;
- if ( number.isEmpty() ){
- XQServiceRequest snd("com.nokia.services.logsservices.starter",
- "start(int,bool)", false);
- snd << (int)activatedView;
- snd << showDialpad;
- res=snd.send(retValue);
- LOGS_QDEBUG_3( "LogsServices::start <-", activatedView, retValue )
- } else {
- XQServiceRequest snd("com.nokia.services.logsservices.starter",
- "startWithNum(int,bool,QString)", false);
- snd << (int)activatedView;
- snd << showDialpad;
- snd << number;
- res=snd.send(retValue);
- LOGS_QDEBUG_3( "LogsServices::start <-", activatedView, retValue )
- }
- return res ? retValue : -1;
-}
--- a/logsui/logsservices/tsrc/at_logsservices/at_logsservices.pro Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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:
-#
-#
-
-TEMPLATE = app
-TARGET =
-
-QT += testlib xml
-CONFIG += qtestlib
-
-DEPENDPATH += .
-INCLUDEPATH += .
-INCLUDEPATH += ./inc
-INCLUDEPATH += /orbit/include # This must be included after the HB stubs
-INCLUDEPATH += /epoc32/include
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-INCLUDEPATH += /epoc32/include/ecom
-INCLUDEPATH += ../../../inc
-INCLUDEPATH += ../../../tsrc/qtestutils/inc
-
-# Input
-HEADERS += inc/at_logsservices.h
-
-SOURCES += src/main.cpp
-SOURCES += src/at_logsservices.cpp
-SOURCES += ../../../tsrc/qtestutils/src/testresultxmlparser.cpp
-
-symbian: {
- TARGET.UID2 = 0x100039CE
- TARGET.UID3 = 0xEf1af9b2
- TARGET.CAPABILITY = ALL -TCB
- LIBS += -lecom -lflogger -lws32 -lbafl -llogsservices
- TARGET.EPOCALLOWDLLDATA = 1
- MMP_RULES += SMPSAFE
-}
--- a/logsui/logsservices/tsrc/at_logsservices/inc/at_logsservices.h Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +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 AT_LOGSSERVICES_H
-#define AT_LOGSSERVICES_H
-
-#include <QObject>
-
-class AT_LogsServices : 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 testStart();
-
-private:
-
-};
-
-
-#endif //AT_LOGSSERVICES_H
--- a/logsui/logsservices/tsrc/at_logsservices/src/at_logsservices.cpp Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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 "at_logsservices.h"
-#include <logsservices.h>
-
-#include <QtTest/QtTest>
-
-void AT_LogsServices::initTestCase()
-{
-}
-
-void AT_LogsServices::cleanupTestCase()
-{
-}
-
-
-void AT_LogsServices::init()
-{
-}
-
-void AT_LogsServices::cleanup()
-{
-}
-
-void AT_LogsServices::testStart()
-{
- LogsServices::start( LogsServices::ViewAll );
- LogsServices::start( LogsServices::ViewReceived );
- LogsServices::start( LogsServices::ViewCalled );
- LogsServices::start( LogsServices::ViewMissed );
-}
-
--- a/logsui/logsservices/tsrc/at_logsservices/src/main.cpp Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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 <QtTest/QtTest>
-
-#include "at_logsservices.h"
-#include "testresultxmlparser.h"
-
-
-int main(int argc, char *argv[])
-{
- bool promptOnExit(true);
- for (int i=0; i<argc; i++) {
- if (QString(argv[i]) == "-noprompt")
- promptOnExit = false;
- }
- printf("Running tests...\n");
-
- QApplication app(argc, argv);
- TestResultXmlParser parser;
-
- AT_LogsServices at_services;
- QString resultFileName = "c:/at_logs_LogsServices.xml";
- QStringList args( "at_logsservices");
- args << "-xml" << "-o" << resultFileName;
- QTest::qExec(&at_services, args);
- parser.parseAndPrintResults(resultFileName,true);
-
-
- if (promptOnExit) {
- printf("Press any key...\n");
- getchar();
- }
- return 0;
-}
-
-
-
-
--- a/logsui/logsui.pro Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/logsui.pro Fri Oct 15 14:47:48 2010 +0300
@@ -43,7 +43,6 @@
}
-SUBDIRS += logsservices
SUBDIRS += logscntfinder
SUBDIRS += logsengine
SUBDIRS += logsapp
--- a/logsui/rom/logs.iby Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/rom/logs.iby Fri Oct 15 14:47:48 2010 +0300
@@ -23,7 +23,6 @@
// Sis stub
data=DATAZ_\system\install\logs_stub.sis system\install\logs_stub.sis
-file=ABI_DIR\UREL\logsservices.dll SHARED_LIB_DIR\logsservices.dll
file=ABI_DIR\UREL\logsengine.dll SHARED_LIB_DIR\logsengine.dll
file=ABI_DIR\UREL\logscntfinder.dll SHARED_LIB_DIR\logscntfinder.dll
file=ABI_DIR\UREL\logs.exe PROGRAMS_DIR\logs.exe
Binary file logsui/rom/logs_stub.sis has changed
--- a/logsui/tsrc/callservicesimulation/install/serviceapp.pkg Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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:
-;
-; Language
-
-&EN
-
-; SIS header: name, uid, version
-#{"serviceapp"},(0xE0022E73),1,0,0
-
-; Localised Vendor name
-%{"Nokia, Qt Software"}
-
-; Unique Vendor name
-:"Nokia, Qt Software"
-
-; Dependencies
-[0x101F7961],0,0,0,{"S60ProductID"}
-[0x102032BE],0,0,0,{"S60ProductID"}
-[0x102752AE],0,0,0,{"S60ProductID"}
-[0x1028315F],0,0,0,{"S60ProductID"}
-(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"}
-
-; Executable and default resource files
-"\epoc32\release\armv5\urel\serviceapp.exe" - "!:\sys\bin\serviceapp.exe"
-"\epoc32\data\z\resource\apps\serviceapp.rsc" - "!:\resource\apps\serviceapp.rsc"
-"\epoc32\data\z\private\10003a3f\import\apps\serviceapp_reg.rsc" - "!:\private\10003a3f\import\apps\serviceapp_reg.rsc"
--- a/logsui/tsrc/callservicesimulation/service_conf.xml Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<service name="com.nokia.services" filepath="must-not-be-empty" >
- <description>Telephony service</description>
- <interface name="telephony" version="1.0" capabilities="">
- <description>Dial interface</description>
- </interface>
-</service>
\ No newline at end of file
--- a/logsui/tsrc/callservicesimulation/serviceapp.pro Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +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:
-#
-
-SERVICEAPP=app
-TARGET=serviceapp
-
-CONFIG += service
-
-symbian:TARGET.UID3 = 0xE0022E73
-
-XQSERVICE_ROOT=../../../qthighway
-include(../../../qthighway/xqservicebase.pri)
-include(src/serviceapp.pri)
-
-LIBS+=-lxqservice -lxqserviceutil
-
-SERVICE.FILE = service_conf.xml
-SERVICE.OPTIONS = embeddable
-
-libFiles.sources = serviceapp.exe
-libFiles.path = "!:\sys\bin"
-DEPLOYMENT += libFiles
-
-symbian:MMP_RULES += SMPSAFE
--- a/logsui/tsrc/callservicesimulation/src/main.cpp Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +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 <QApplication>
-#include "serviceapp.h"
-
-int main(int argc, char **argv)
-{
- QApplication a( argc, argv );
-
- ServiceApp *cl = new ServiceApp();
- cl->show();
- int rv = a.exec();
- delete cl;
- return rv;
-}
-
--- a/logsui/tsrc/callservicesimulation/src/serviceapp.cpp Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +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 <QApplication>
-#include <QKeyEvent>
-#include <QLabel>
-#include <QVBoxLayout>
-#include <QStackedWidget>
-#include <QImageReader>
-#include <QDebug>
-#include <QTimer>
-#include <QPushButton>
-#include <QLineEdit>
-#include <QListView>
-
-
-#include "serviceapp.h"
-#include <xqserviceutil.h>
-
-ServiceApp::ServiceApp(QWidget *parent, Qt::WFlags f)
- : QWidget(parent, f)
-{
-
- mService = new DialerService(this);
- /* Adjust the palette */
-#if defined(Q_WS_S60)
- QPalette p = qApp->palette();
- QColor color(80,20,20);
- QColor bg(20,20,20);
- p.setColor(QPalette::Highlight, color.lighter(200));
- p.setColor(QPalette::Text, Qt::white);
- p.setColor(QPalette::Base, bg);
- p.setColor(QPalette::WindowText, Qt::white);
- p.setColor(QPalette::Window, bg);
- p.setColor(QPalette::ButtonText, Qt::white);
- p.setColor(QPalette::Button, color.lighter(150));
- p.setColor(QPalette::Link, QColor(240,40,40));
-
- qApp->setPalette(p);
-#endif
-
- QPushButton *quitButton = new QPushButton(tr("Quit"));
- connect(quitButton, SIGNAL(clicked()), this, SLOT(quit()));
-
- /*
- mEndCallButton = new QPushButton(tr("End Call"));
- mEndCallButton->setEnabled(false);
- connect(mEndCallButton, SIGNAL(clicked()), this, SLOT(endCall()));
- */
- QString t = "SERVICE DIAL -> ";
- t = t + (XQServiceUtil::isEmbedded() ? " EMBEDDED" : " NOT EMBEDDED");
- QLabel *title = new QLabel(t);
-
- mLabel = new QLabel(tr("PHONE"));
- mNumber = new QLabel(tr("******"));
-
- QVBoxLayout *vl = new QVBoxLayout;
- vl->setMargin(0);
- vl->setSpacing(0);
-
- vl->addWidget(title);
- vl->addWidget(mLabel);
- vl->addWidget(mNumber);
- vl->addWidget(quitButton);
-
- setLayout(vl);
-#if defined(Q_WS_X11) || defined(Q_WS_WIN)
- setFixedSize(QSize(360,640)); // nHD
-#elif defined(Q_WS_S60)
- showMaximized();
- showFullScreen();
-#endif
-// new DialerService(this);
-}
-
-
-ServiceApp::~ServiceApp()
-{
-}
-
-void ServiceApp::quit()
-{
- if (mService->asyncAnswer()) {
- connect(mService, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
- mService->complete(mNumber->text());
- }
- else {
- qApp->quit();
- }
-}
-
-void ServiceApp::endCall()
-{
- //QVBoxLayout *vl = qobject_cast<QVBoxLayout *>(layout()) ;
- //vl->removeWidget(mEndCallButton);
-
- //XQServiceUtil::toBackground(true);
-}
-
-void ServiceApp::setLabelNumber(QString label,QString number)
-{
- //QVBoxLayout *vl = qobject_cast<QVBoxLayout *>(layout()) ;
- //vl->insertWidget(1,mEndCallButton);
- mLabel->setText(label);
- mNumber->setText(number);
-}
-
-
-DialerService::DialerService(ServiceApp* parent)
-: XQServiceProvider(QLatin1String("com.nokia.services.telephony"),parent),mServiceApp(parent)
-{
-publishAll();
-}
-
-DialerService::~DialerService()
-{
-}
-
-void DialerService::complete(QString number)
-{
- completeRequest(0,number.toInt());
-}
-
-void DialerService::dial(const QString& number)
-{
- qDebug() << "DialerService::dial (number):" << number;
- QString label = "PHONE dialing (number):" ;
- mServiceApp->setLabelNumber(label,number);
-}
-
-void DialerService::dial(const QString& number, int contactId)
-{
- qDebug() << "DialerService::dial to num:" << number << "contactId:" << contactId;
- QString label = "PHONE dialing (number+contact):" ;
- QString num;
- num.append( number );
- num.append(" ");
- QString contactStr;
- contactStr.setNum(contactId);
- num.append( contactStr );
- mServiceApp->setLabelNumber(label,num);
-}
-
-void DialerService::dialVideo(const QString& number)
-{
- qDebug() << "DialerService::dialVideo (number):" << number;
- QString label = "PHONE dialing video (number):" ;
- mServiceApp->setLabelNumber(label,number);
-}
-
-void DialerService::dialVideo(const QString& number, int contactId)
-{
- qDebug() << "DialerService::dialVideo to num:" << number << "contactId:" << contactId;
- QString label = "PHONE dialing video (number+contact):" ;
- QString num;
- num.append( number );
- num.append(" ");
- QString contactStr;
- contactStr.setNum(contactId);
- num.append( contactStr );
- mServiceApp->setLabelNumber(label,num);
-}
--- a/logsui/tsrc/callservicesimulation/src/serviceapp.h Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +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 PHONESERVICE_H
-#define PHONESERVICE_H
-
-#include <QWidget>
-#include <QModelIndex>
-#include <QMap>
-#include <QStringList>
-#include <xqserviceprovider.h>
-
-class QLineEdit;
-class QPushButton;
-class DialerService;
-class QLabel;
-
-class ServiceApp : public QWidget
-{
- Q_OBJECT
-public:
- ServiceApp( QWidget *parent = 0, Qt::WFlags f = 0 );
- ~ServiceApp();
-
- void setLabelNumber(QString label,QString number);
-
-public slots:
- void endCall();
-
-private slots:
- void quit();
-private:
- QLabel *mLabel;
- QLabel *mNumber;
- //QPushButton *mEndCallButton;
- DialerService* mService;
-};
-
-class DialerService : public XQServiceProvider
-{
- Q_OBJECT
-public:
- DialerService( ServiceApp *parent = 0 );
- ~DialerService();
-
- void complete(QString number);
- bool asyncAnswer() {return mAsyncAnswer;}
-public slots:
- void dial(const QString& number);
- void dial(const QString& number,int contactId);
- void dialVideo(const QString& number);
- void dialVideo(const QString& number,int contactId);
-
-private:
- ServiceApp* mServiceApp;
- QString mNumber;
- bool mAsyncAnswer;
-};
-
-#endif
--- a/logsui/tsrc/callservicesimulation/src/serviceapp.pri Fri Sep 17 16:47:32 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +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:
-#
-
-SOURCES=\
- src/main.cpp\
- src/serviceapp.cpp
-
-HEADERS=\
- src/serviceapp.h
-
--- a/logsui/tsrc/install/logs_stub.pkg Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/tsrc/install/logs_stub.pkg Fri Oct 15 14:47:48 2010 +0300
@@ -34,7 +34,6 @@
; User interface
""-"z:\sys\bin\logs.exe"
""-"z:\sys\bin\logsengine.dll"
-""-"z:\sys\bin\logsservices.dll"
""-"z:\sys\bin\logscntfinder.dll"
""-"z:\resource\apps\logs.rsc"
""-"z:\private\10003a3f\import\apps\logs_reg.rsc"
--- a/logsui/tsrc/install/logs_update_udeb.pkg Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/tsrc/install/logs_update_udeb.pkg Fri Oct 15 14:47:48 2010 +0300
@@ -36,6 +36,5 @@
"\epoc32\release\armv5\udeb\logs.exe"-"!:\sys\bin\logs.exe"
"\epoc32\release\armv5\udeb\logsengine.dll"-"!:\sys\bin\logsengine.dll"
-"\epoc32\release\armv5\udeb\logsservices.dll"-"!:\sys\bin\logsservices.dll"
"\epoc32\data\z\resource\apps\logs.rsc"-"!:\resource\apps\logs.rsc"
"\epoc32\data\z\private\10003a3f\import\apps\logs_reg.rsc"-"!:\private\10003a3f\import\apps\logs_reg.rsc"
--- a/logsui/tsrc/install/logs_update_urel.pkg Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/tsrc/install/logs_update_urel.pkg Fri Oct 15 14:47:48 2010 +0300
@@ -36,6 +36,5 @@
"\epoc32\release\armv5\urel\logs.exe"-"!:\sys\bin\logs.exe"
"\epoc32\release\armv5\urel\logsengine.dll"-"!:\sys\bin\logsengine.dll"
-"\epoc32\release\armv5\urel\logsservices.dll"-"!:\sys\bin\logsservices.dll"
"\epoc32\data\z\resource\apps\logs.rsc"-"!:\resource\apps\logs.rsc"
"\epoc32\data\z\private\10003a3f\import\apps\logs_reg.rsc"-"!:\private\10003a3f\import\apps\logs_reg.rsc"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/logsui/tsrc/install/recents.xml Fri Oct 15 14:47:48 2010 +0300
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ad:metadata xmlns="http://nokia.com/arrow/repository/ia_component" xmlns:ad="http://nokia.com/arrow/application_metadata">
+ <appResources>
+ <appResource>
+ <language>1</language>
+ <iacName>Dialer</iacName>
+ <iacDescription>Upgrade package for Dailer</iacDescription>
+ </appResource>
+ </appResources>
+ <!-- Specifies for what versions of what platform this component is for. -->
+ <swPlatformDep>
+ <platform>S60</platform>
+ <versionFrom>
+ <!--
+ platform version number separated in major and minor number (i.e.
+ 3.0 has 3 as major and 0 as minor)
+ -->
+ <major>5</major>
+ <minor>0</minor>
+ <!--
+ date-element can be used to pinpoint platform version number to even
+ more specific one. It is not currently used in the system.
+ -->
+ <date>
+ <year>2010</year>
+ <week>39</week>
+ </date>
+ </versionFrom>
+ </swPlatformDep>
+ <!-- specifies dependencies to other IACs -->
+ <interDeps>
+ </interDeps>
+ <firmwareDependencies>
+ </firmwareDependencies>
+ <rebootAfterInstall>true</rebootAfterInstall>
+</ad:metadata>
\ No newline at end of file
--- a/logsui/tsrc/logsservicestester/logsservicetesterwidget.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/tsrc/logsservicestester/logsservicetesterwidget.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -28,7 +28,6 @@
#include <xqappmgr.h>
#include <xqaiwrequest.h>
#include <xqaiwdecl.h>
-#include <logsservices.h>
#include "logsservicetesterwidget.h"
#include "logsservicetesterappcloser.h"
@@ -65,13 +64,9 @@
mEditor = new HbLineEdit();
mEditor->setInputMethodHints(Qt::ImhPreferNumbers);
- HbPushButton* newService = new HbPushButton("Start Dialer via new service name");
+ HbPushButton* newService = new HbPushButton("Start Dialer via 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()));
+ connect(newService, SIGNAL(clicked()), this, SLOT(startService()));
HbPushButton* killDialer = new HbPushButton("Kill Dialer");
killDialer->setPreferredHeight(60);
@@ -88,7 +83,6 @@
layout->addItem(editorLabel);
layout->addItem(mEditor);
layout->addItem(newService);
- layout->addItem(oldService);
layout->addItem(killDialer);
layout->addItem(startAtBg);
setLayout(layout);
@@ -125,9 +119,9 @@
//
// -----------------------------------------------------------------------------
//
-void LogsServiceTesterWidget::startNewService()
+void LogsServiceTesterWidget::startService()
{
- qDebug() << "[LOGS_TESTER] -> LogsServiceTesterWidget::startNewService()";
+ qDebug() << "[LOGS_TESTER] -> LogsServiceTesterWidget::startService()";
fetchData();
XQApplicationManager appMgr;
@@ -147,19 +141,7 @@
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()";
+ qDebug() << "[LOGS_TESTER] <- LogsServiceTesterWidget::startService()";
}
// -----------------------------------------------------------------------------
--- a/logsui/tsrc/logsservicestester/logsservicetesterwidget.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/tsrc/logsservicestester/logsservicetesterwidget.h Fri Oct 15 14:47:48 2010 +0300
@@ -35,8 +35,7 @@
public slots:
- void startOldService();
- void startNewService();
+ void startService();
void dialerClosed();
void dialerCloseError(int error);
--- a/logsui/tsrc/qtestutils/inc/testresultxmlparser.h Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/tsrc/qtestutils/inc/testresultxmlparser.h Fri Oct 15 14:47:48 2010 +0300
@@ -19,7 +19,11 @@
#define TESTRESULTXMLPARSER_H
#include <QXmlDefaultHandler>
+#include <hbinputsettingproxy.h>
+#define ST_LOGSCNTFINDER_SET_LANGUAGE( lang )\
+ HbInputSettingProxy::instance()->setGlobalInputLanguage( HbInputLanguage( lang ) )
+
class TestResultXmlParser : public QXmlDefaultHandler
{
--- a/logsui/tsrc/qtestutils/src/testrunner.cpp Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/tsrc/qtestutils/src/testrunner.cpp Fri Oct 15 14:47:48 2010 +0300
@@ -160,7 +160,8 @@
if ( mCombinedOutputFileName.isEmpty() ){
return;
}
- if ( !mCombinedOutputFileName.contains(QString::fromAscii("/")) ){
+ if ( !mCombinedOutputFileName.contains(QString::fromAscii("/")) &&
+ !mCombinedOutputFileName.contains(QString::fromAscii("\\")) ) {
mCombinedOutputFileName.prepend( mHomeDir );
}
QFile file(mCombinedOutputFileName);
--- a/logsui/tsrc/unittestrunner/unittest_qt.pl Fri Sep 17 16:47:32 2010 +0300
+++ b/logsui/tsrc/unittestrunner/unittest_qt.pl Fri Oct 15 14:47:48 2010 +0300
@@ -29,6 +29,7 @@
$unitTestRunner = "unittest_qt.pl";
$scriptLocation = "logsui/tsrc/unittestrunner";
$coverageResultsDirDefault = "logsui/tsrc/unittestrunner/qtresults/";
+$coverageResultsDirFunctional = "logsui/tsrc/unittestrunner/qtfunctionalresults";
$testConfigDefault = "unittest_qt_config.txt";
$qtProFileDefault = "tsrc.pro";
$buildResults = "BuildResults.txt";
@@ -48,6 +49,8 @@
$outputString = "";
$outputFileBodyStart = "<body";
+$qmakeConfig = "-config coverage";
+
$totalCount = 0;
$passedCount = 0;
$failedCount = 0;
@@ -99,6 +102,9 @@
chdir("$coverageResultsDir");
doSystemCall("ctcpost $coverageSymbols $coverageDat -p $coverageProfile -T 70");
doSystemCall("ctc2html -i $coverageProfile -t 70");
+$coverageResultsDirFunctional = "$projectdrive$projectrootname$coverageResultsDirFunctional";
+doSystemCall("ctcpost $coverageSymbols $coverageDat -ff -p $coverageProfile");
+doSystemCall("ctc2html -i $coverageProfile -o $coverageResultsDirFunctional");
# clear target for intrumentation result
$ENV{'CTC_DATA_PATH'}= "";
@@ -220,9 +226,9 @@
print("Pro file not defined, using default. \n");
$qtProFile = $qtProFileDefault;
}
- doSystemCall( "qmake $qtProFile" );
+ doSystemCall( "qmake $qtProFile $qmakeConfig" );
doSystemCall( "sbs reallyclean" );
- doSystemCall( "qmake $qtProFile" );
+ doSystemCall( "qmake $qtProFile $qmakeConfig" );
$exclude = "-C \"EXCLUDE+*\tsrc\*\" -C \"EXCLUDE+*/*/tsrc/*\" -C \"EXCLUDE+*/*/*/tsrc/*\" -C \"EXCLUDE+moc_*\"";
--- a/package_definition.xml Fri Sep 17 16:47:32 2010 +0300
+++ b/package_definition.xml Fri Oct 15 14:47:48 2010 +0300
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<SystemDefinition schema="3.0.0" xmlns:qt="http://www.nokia.com/qt">
<package id="recents" name="Recent Events" levels="engine support ui api">
+ <collection id="recents_test" name="Recents Unit Tests" level="support">
+ <component id="recents_test_build" filter="s60,test,qt_unit_test" name="Recents Unit Tests Build" purpose="development" introduced="^4">
+ <unit bldFile="tsrc" qt:proFile="tsrc.pro"/>
+ </component>
+ </collection>
<collection id="recents_plat" name="Recent Events Platform Interfaces" level="api">
<component id="logs_services_api" name="Logs Services API" class="api" filter="s60" introduced="^4">
<unit base="recents_plat/logs_services_api"/>
@@ -33,5 +38,5 @@
<unit bldFile="logsui" qt:proFile="logsui.pro"/>
</component>
</collection>
- </package>
+ </package>
</SystemDefinition>