--- a/harvesterplugins/applications/data/2001a9d7.rss Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/applications/data/2001a9d7.rss Tue Oct 05 13:32:14 2010 +0530
@@ -39,7 +39,7 @@
version_no = 1;
display_name = "Applications";
default_data = "CPiX Applications Plugin";
- opaque_data = "";
+ opaque_data = "z:\\resource\\qt\\plugins\\searchsrv\\contentconfig\\applicationconfig.xml";
}
};
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvesterplugins/applications/data/applicationconfig.xml Tue Oct 05 13:32:14 2010 +0530
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<category>
+ <name>Applications</name>
+ <mime>application/application</mime>
+ <licon></licon>
+ <baseapp>root applications</baseapp>
+ <lname>txt_search_list_applications</lname>
+ <displayorder>5</displayorder>
+ <exceptionstring></exceptionstring>
+ <tsfile></tsfile>
+ <actionuri>
+ <uri>
+ <uristring></uristring>
+ <lname></lname>
+ <licon></licon>
+ <uriref></uriref>
+ <action></action><!-- primary action or default action. alternatively, we could always use first entry as this one -->
+ </uri>
+ </actionuri>
+ <fieldmap>
+ <resulthit>
+ <field></field>
+ <auri></auri><!-- alternatively <auriorder>1,2,3,4</auriorder> instead of four lines -->
+ </resulthit>
+ </fieldmap>
+ <indexcontentsize>L</indexcontentsize> <!-- possible values S, M, L, XL, XXL. or scale of 1 to 10. -->
+ <policy>
+ <capability>WriteDeviceData<!-- Allow search on my data from clients with only Write Device Data capability it is combination of SID/VID/capability --></capability>
+ </policy>
+ <resultfirstline>
+ <list>
+ <field>Name</field><!-- commo seperated list, if there is a chance that certain field could be empty -->
+ </list>
+ </resultfirstline>
+ <relevancy>
+ <boost>
+ <field>Name</field>
+ <boostvalue>1</boostvalue><!-- on scale 1-10 -->
+ </boost>
+ </relevancy>
+</category>
--- a/harvesterplugins/applications/group/applicationsplugin.mmp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/applications/group/applicationsplugin.mmp Tue Oct 05 13:32:14 2010 +0530
@@ -48,7 +48,7 @@
LIBRARY apparc.lib //for TApaAppInfo
//LIBRARY widgetregistryclient.lib
LIBRARY centralrepository.lib //for CRepository
-
+LIBRARY scrclient.lib
// For logging
LIBRARY flogger.lib
--- a/harvesterplugins/applications/group/bld.inf Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/applications/group/bld.inf Tue Oct 05 13:32:14 2010 +0530
@@ -18,3 +18,7 @@
PRJ_MMPFILES
applicationsplugin.mmp
+
+PRJ_EXPORTS
+../data/applicationconfig.xml /epoc32/data/z/resource/qt/plugins/searchsrv/contentconfig/applicationconfig.xml
+
--- a/harvesterplugins/applications/inc/applicationsplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/applications/inc/applicationsplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -25,9 +25,16 @@
#include <apgnotif.h> //Notification
//#include <WidgetRegistryClient.h>
#include "delayedcallback.h"
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
+#include <widgetregistryclient.h>
+#else
+#include <usif/scr/scr.h>
+#endif
+#include <javaregistryincludes.h>
class CCPixIndexer;
class CRepository;
+class TAppRegInfo;
/**
* Applications plugin class. Harvests applictions(exes), widgets and java apps.
*
@@ -36,14 +43,23 @@
*/
class CApplicationsPlugin : public CIndexingPlugin, public MDelayedCallbackObserver, public MApaAppListServObserver
{
-public: // Constructors and destructor
- static CApplicationsPlugin* NewL();
- static CApplicationsPlugin* NewLC();
- virtual ~CApplicationsPlugin();
+public:
+ enum THarvesterState
+ {
+ EHarvesterIdleState,
+ EHarvesterStartHarvest
+ };
+
+ // Constructors and destructor
+ static CApplicationsPlugin* NewL();
+ static CApplicationsPlugin* NewLC();
+ virtual ~CApplicationsPlugin();
public: // From CIndexingPlugin
virtual void StartPluginL();
virtual void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
+ void PausePluginL();
+ void ResumePluginL();
public: // From MDelayedCallbackObserver
void DelayedCallbackL(TInt aCode);
@@ -58,13 +74,13 @@
/*
* @description Add, update or delete application document with info in TApaAppInfo based on aActionType.
- * @param aAppInfo: got via RApaLsSession::GetNextApp().
+ * @param aAppInfo: got via GetNextApp().
* @param aActionType: add, update or delete.
* @return void
* Leaves in case of error.
*/
- void CreateApplicationsIndexItemL( TApaAppInfo& aAppInfo, TCPixActionType aActionType );
-
+ void CreateApplicationsIndexItemL(RPointerArray<Usif::TAppRegInfo>& aAppInfo, TCPixActionType aActionType);
+
/*
* @description Adds necessary document fields to aDocument for widget with Uid aUid.
* @param aDocument search document. Not owned.
@@ -84,10 +100,14 @@
private:
CDelayedCallback* iAsynchronizer; //Owned.
CCPixIndexer* iIndexer; // CPix database. Owned.
- RApaLsSession iApplicationServerSession; //to get application info.
+ //RApaLsSession iApplicationServerSession; //to get application info.
+ Usif::RSoftwareComponentRegistry iScrSession;
+ Usif::RApplicationInfoView iScrView;
CApaAppListNotifier* iNotifier; //Owned.
- //RWidgetRegistryClientSession iWidgetRegistry; //to get widget info.
- CRepository* iHiddenApplicationsRepository;
+ //State of harvester either to pause/resume
+ TBool iIndexState;
+ //harvesting state
+ THarvesterState iHarvestState;
#ifdef __PERFORMANCE_DATA
TTime iStartTime;
--- a/harvesterplugins/applications/src/applicationsplugin.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/applications/src/applicationsplugin.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -30,16 +30,16 @@
#ifdef OST_TRACE_COMPILER_IN_USE
#include "applicationspluginTraces.h"
#endif
-
-
+#include<usif/scr/appreginfo.h>
//Hidden applications
//#define KHiddenAppRepositoryUid KCRUidMenu
-
+#define KNumberOfAppInfoToBeRead 1
_LIT( KMimeTypeField, CPIX_MIMETYPE_FIELD );
_LIT( KMimeTypeApplication, APPLICATION_MIMETYPE);
/** Field names */
-_LIT(KApplicationFieldCaption, "Name");
+_LIT(KApplicationFieldShortCaption, "Name");
+_LIT(KApplicationFieldCaption, "CaptionName");
_LIT(KApplicationFieldUid, "Uid");
_LIT(KApplicationFieldAbsolutePath, "Path");
@@ -77,152 +77,165 @@
// -----------------------------------------------------------------------------
CApplicationsPlugin::~CApplicationsPlugin()
- {
+ {
+ OstTraceFunctionEntry0( CAPPLICATIONSPLUGIN_CAPPLICATIONSPLUGIN_ENTRY );
+
if (iAsynchronizer)
iAsynchronizer->CancelCallback();
- iApplicationServerSession.Close();
+ //iApplicationServerSession.Close();
+ iScrView.Close();
+ iScrSession.Close();
//iWidgetRegistry.Close();
//delete iHiddenApplicationsRepository;
- delete iAsynchronizer;
- delete iNotifier;
- delete iIndexer;
- }
+ delete iAsynchronizer;
+ delete iNotifier;
+ delete iIndexer;
+ OstTraceFunctionExit0( CAPPLICATIONSPLUGIN_CAPPLICATIONSPLUGIN_EXIT );
+ }
// -----------------------------------------------------------------------------
void CApplicationsPlugin::ConstructL()
- {
- iAsynchronizer = CDelayedCallback::NewL( CActive::EPriorityIdle );
- iNotifier = CApaAppListNotifier::NewL( this, CActive::EPriorityHigh );
+ {
+ OstTraceFunctionEntry0( CAPPLICATIONSPLUGIN_CONSTRUCTL_ENTRY );
+ iIndexState = ETrue;
+ iAsynchronizer = CDelayedCallback::NewL(CActive::EPriorityIdle);
+ iNotifier = CApaAppListNotifier::NewL(this, CActive::EPriorityHigh);
//iHiddenApplicationsRepository = CRepository::NewL( KHiddenAppRepositoryUid );
//User::LeaveIfError( iWidgetRegistry.Connect() );
+ OstTraceFunctionExit0( CAPPLICATIONSPLUGIN_CONSTRUCTL_EXIT );
}
// -----------------------------------------------------------------------------
void CApplicationsPlugin::StartPluginL()
- {
- User::LeaveIfError( iApplicationServerSession.Connect() );
- User::LeaveIfError(iSearchSession.DefineVolume( _L(APPLICATIONS_QBASEAPPCLASS), KNullDesC ));
-
- // Open database
- iIndexer = CCPixIndexer::NewL(iSearchSession);
- iIndexer->OpenDatabaseL( _L(APPLICATIONS_QBASEAPPCLASS) );
+ {
+ OstTraceFunctionEntry0( CAPPLICATIONSPLUGIN_STARTPLUGINL_ENTRY );
+ TRAPD(error,iScrSession.Connect());
+ if (error != KErrNone)
+ return;
+
+ User::LeaveIfError(iSearchSession.DefineVolume(
+ _L(APPLICATIONS_QBASEAPPCLASS), KNullDesC));
- // Start harvester for this plugin
- iObserver->AddHarvestingQueue( this, iIndexer->GetBaseAppClass() );
- }
+ // Open database
+ iIndexer = CCPixIndexer::NewL(iSearchSession);
+ iIndexer->OpenDatabaseL(_L(APPLICATIONS_QBASEAPPCLASS));
+
+ // Start harvester for this plugin
+ iObserver->AddHarvestingQueue(this, iIndexer->GetBaseAppClass());
+ OstTraceFunctionExit0( CAPPLICATIONSPLUGIN_STARTPLUGINL_EXIT );
+ }
// -----------------------------------------------------------------------------
void CApplicationsPlugin::StartHarvestingL(const TDesC& /* aQualifiedBaseAppClass */)
{
- // Harvest items on each call
- User::LeaveIfError( iApplicationServerSession.GetAllApps() );//if not KErrNone
+ OstTraceFunctionEntry0( CAPPLICATIONSPLUGIN_STARTHARVESTINGL_ENTRY );
+
+ // Harvest items on each call
+ iScrView.OpenViewL(iScrSession);
iIndexer->ResetL();
+ iHarvestState = EHarvesterStartHarvest;
//No need to check IsStatred() since this is the first start.
#ifdef __PERFORMANCE_DATA
iStartTime.UniversalTime();
#endif
- iAsynchronizer->Start( 0, this, KHarvestingDelay );
+ iAsynchronizer->Start(0, this, KHarvestingDelay);
+ OstTraceFunctionExit0( CAPPLICATIONSPLUGIN_STARTHARVESTINGL_EXIT );
}
-//Removing Widget Registry support
-/* -----------------------------------------------------------------------------
-void CApplicationsPlugin::AddWidgetInfoL( CSearchDocument* aDocument, TUid aUid )
- {
- TBuf<KMaxFileName> temp;//we can reuse this.
-
- iWidgetRegistry.GetWidgetPath( aUid, temp );
- aDocument->AddFieldL(KApplicationFieldAbsolutePath, temp, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized );
- CPIXLOGSTRING2("AddApplicationInfo(): PATH = %S ", &temp);
- OstTraceExt1( TRACE_NORMAL, CAPPLICATIONSPLUGIN_ADDWIDGETINFOL, "CApplicationsPlugin::AddWidgetInfoL;PATH=%S", &temp );
-
- //GetWidgetPropertyValueL returns CWidgetPropertyValue* which in turn has an operator to convert to TDesC
- aDocument->AddFieldL(KApplicationFieldCaption, *(iWidgetRegistry.GetWidgetPropertyValueL( aUid, EBundleDisplayName )), CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText);
-
- //For applications, no content to go into exceprt field.
- //For more info, check the appclass-hierarchy.txt
- //iWidgetRegistry.GetWidgetBundleName( aUid, temp );
- //aDocument->AddExcerptL( temp );
- aDocument->AddExcerptL( KNullDesC );
-
- OstTraceExt1( TRACE_NORMAL, DUP1_CAPPLICATIONSPLUGIN_ADDWIDGETINFOL, "CApplicationsPlugin::AddWidgetInfoL;DisplayName=%S", &temp );
- CPIXLOGSTRING2("AddApplicationInfo(): DisplayName = %S ", &temp );
- }*/
-
// -----------------------------------------------------------------------------
//This need not be a member function.
-void AddApplicationInfoL( CSearchDocument* aDocument, TApaAppInfo& aAppInfo )
+void AddApplicationInfoL(CSearchDocument* aDocument,
+ Usif::TAppRegInfo& aAppInfo)
{
- TBuf<KMaxFileName> docidString = aAppInfo.iUid.Name(); //This returns stuff in the form "[UID]". So remove the brackets.
- docidString = docidString.Mid( KUidStartIndex, KUidEndIndex );
+ OstTraceFunctionEntry0( _ADDAPPLICATIONINFOL_ENTRY );
+
+ TBuf<KMaxFileName> docidString = aAppInfo.Uid().Name(); //This returns stuff in the form "[UID]". So remove the brackets.
+ docidString = docidString.Mid(KUidStartIndex, KUidEndIndex);
//We index the exe name (without extension), only if the title is not present.
- if( aAppInfo.iShortCaption.Compare(KNullDesC) )
+ if (aAppInfo.ShortCaption().Compare(KNullDesC))
{
- aDocument->AddFieldL(KApplicationFieldCaption, aAppInfo.iShortCaption, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText);
-#ifdef USE_HIGHLIGHTER
- aDocument->AddHLDisplayFieldL(aAppInfo.iShortCaption);
-#endif
+ aDocument->AddFieldL(KApplicationFieldShortCaption,
+ aAppInfo.ShortCaption(), CDocumentField::EStoreYes
+ | CDocumentField::EIndexTokenized
+ | CDocumentField::EIndexFreeText);
+
+ if (aAppInfo.Caption().Compare(KNullDesC))
+ {
+ aDocument->AddFieldL(KApplicationFieldCaption,
+ aAppInfo.Caption(), CDocumentField::EStoreYes
+ | CDocumentField::EIndexTokenized
+ | CDocumentField::EIndexFreeText);
+ }
+
+ aDocument->AddHLDisplayFieldL(aAppInfo.ShortCaption());
+ }
+ else if (aAppInfo.Caption().Compare(KNullDesC))
+ {
+ aDocument->AddFieldL(KApplicationFieldShortCaption,
+ aAppInfo.Caption(), CDocumentField::EStoreYes
+ | CDocumentField::EIndexTokenized
+ | CDocumentField::EIndexFreeText);
+
+ aDocument->AddFieldL(KApplicationFieldCaption, aAppInfo.Caption(),
+ CDocumentField::EStoreYes | CDocumentField::EIndexTokenized);
}
else
{
//Find the *last* location of '\' and remove the .exe to get just the filename.
- TInt location = aAppInfo.iFullName.LocateReverse('\\');
- if( location > 0 )
+ TInt location = aAppInfo.FullName().LocateReverse('\\');
+ if (location > 0)
{
- TInt lengthOfNameWithoutExtention = aAppInfo.iFullName.Length() -location -1; //-1 to increment one past '\'.
- TPtrC appName = aAppInfo.iFullName.Right( lengthOfNameWithoutExtention );
- aDocument->AddFieldL(KApplicationFieldAbsolutePath, appName.Left( appName.Length() -4 /*remove ".exe"*/), CDocumentField::EStoreYes | CDocumentField::EIndexTokenized );
-#ifdef USE_HIGHLIGHTER
- aDocument->AddHLDisplayFieldL(appName.Left( appName.Length() -4 /*remove ".exe"*/));
-#endif
+ TInt lengthOfNameWithoutExtention = aAppInfo.FullName().Length()
+ - location - 1; //-1 to increment one past '\'.
+ TPtrC appName = aAppInfo.FullName().Right(
+ lengthOfNameWithoutExtention);
+ aDocument->AddFieldL(KApplicationFieldShortCaption, appName.Left(
+ appName.Length() - 4 /*remove ".exe"*/),
+ CDocumentField::EStoreYes
+ | CDocumentField::EIndexTokenized);
+
+ aDocument->AddFieldL(KApplicationFieldCaption, KNullDesC,
+ CDocumentField::EStoreYes
+ | CDocumentField::EIndexTokenized);
+
+ aDocument->AddHLDisplayFieldL(
+ appName.Left(appName.Length() - 4 /*remove ".exe"*/));
}
}
+
+ if (aAppInfo.FullName().Compare(KNullDesC))
+ {
+ aDocument->AddFieldL(KApplicationFieldAbsolutePath,
+ aAppInfo.FullName(), CDocumentField::EStoreYes
+ | CDocumentField::EIndexTokenized
+ | CDocumentField::EAggregateNo);
+
+ }
//For applications, no content to go into exceprt field, for more info, check the appclass-hierarchy.txt
//aDocument->AddExcerptL( aAppInfo.iCaption );
- aDocument->AddExcerptL( KNullDesC );
-
- OstTraceExt2( TRACE_NORMAL, _ADDAPPLICATIONINFOL, "::AddApplicationInfoL;UID=%S;PATH=%S", &docidString, &aAppInfo.iFullName );
- OstTraceExt2( TRACE_NORMAL, DUP1__ADDAPPLICATIONINFOL, "::AddApplicationInfoL;Excerpt=%S;Caption=%S", &aAppInfo.iCaption, &aAppInfo.iShortCaption );
-
- CPIXLOGSTRING3("AddApplicationInfo(): UID = %S, PATH = %S ", &docidString, &aAppInfo.iFullName );
- CPIXLOGSTRING3("AddApplicationInfo(): Excerpt = %S, Caption = %S ", &aAppInfo.iCaption, &aAppInfo.iShortCaption );
+ aDocument->AddExcerptL(KNullDesC);
+
+ OstTraceExt2( TRACE_NORMAL, _ADDAPPLICATIONINFOL, "::AddApplicationInfoL;UID=%S;PATH=%S", &docidString, &aAppInfo.FullName() );
+ OstTraceExt2( TRACE_NORMAL, DUP1__ADDAPPLICATIONINFOL, "::AddApplicationInfoL;Excerpt=%S;Caption=%S", &aAppInfo.Caption(), &aAppInfo.ShortCaption() );
+ OstTraceFunctionExit0( _ADDAPPLICATIONINFOL_EXIT );
}
// -----------------------------------------------------------------------------
TBool CApplicationsPlugin::IsAppHiddenL(TUid aUid)
{
//Application should not have 'hidden' capability.
- TBool ret( EFalse );
- TApaAppCapabilityBuf cap;
+ TBool ret( EFalse );
OstTrace1( TRACE_NORMAL, CAPPLICATIONSPLUGIN_ISAPPHIDDENL, "CApplicationsPlugin::IsAppHiddenL;UID=%d", aUid );
CPIXLOGSTRING2("CApplicationsPlugin::IsAppHidden(): UID = %d", aUid );
- if ( iApplicationServerSession.GetAppCapability(cap, aUid) == KErrNone )
- {
- OstTraceState0( STATE_DUP1_CAPPLICATIONSPLUGIN_ISAPPHIDDENL, "GetCapability returned KErrNone", "" );
-
- CPIXLOGSTRING("CApplicationsPlugin::IsAppHidden(): GetCapability returned KErrNone");
- ret = cap().iAppIsHidden;
- }
-
- //This commented code is left here as the following functionality may need to be
- //returned if and when this or similar APIs are available for 10.1
- //Application should not be listed hidden in application shell.
-// TBuf<NCentralRepositoryConstants::KMaxUnicodeStringLength> uidResult;
-// if( iHiddenApplicationsRepository->Get( KMenuHideApplication, uidResult ) == KErrNone )
-// {
-// CPIXLOGSTRING2("CApplicationsPlugin::CreateApplicationsIndexItemL(): Hidden UIDs = %S", &uidResult );
-// TBufC16<NCentralRepositoryConstants::KMaxUnicodeStringLength> buf(uidResult);
-// HBufC* uidString = buf.AllocLC();
-// //If not in the list, it means it is hidden; so dont harvest
-// if( uidString->FindF( aUid.Name().Mid( KUidStartIndex, KUidEndIndex ) ) != KErrNotFound )
-// {
-// CleanupStack::PopAndDestroy( uidString );
-// CPIXLOGSTRING("CApplicationsPlugin::IsAppHidden(): UID in hidden app repository");
-// return EFalse;
-// }
-// CleanupStack::PopAndDestroy( uidString );
-// }
+ Usif::RRegistrationInfoForApplication appRegInfo;
+ appRegInfo.OpenL(iScrSession, aUid);
+ Usif::TApplicationCharacteristics appCharacteristics;
+ appRegInfo.GetAppCharacteristicsL(appCharacteristics);
+ ret = appCharacteristics.iAppIsHidden;
+ appRegInfo.Close();
+
OstTrace1( TRACE_NORMAL, DUP1_CAPPLICATIONSPLUGIN_ISAPPHIDDENL, "CApplicationsPlugin::IsAppHiddenL;Return Value=%d", &ret );
CPIXLOGSTRING2("CApplicationsPlugin::IsAppHidden(): %d", &ret);
@@ -230,81 +243,93 @@
}
// -----------------------------------------------------------------------------
-void CApplicationsPlugin::CreateApplicationsIndexItemL( TApaAppInfo& aAppInfo, TCPixActionType /*aActionType*/ )
+void CApplicationsPlugin::CreateApplicationsIndexItemL(RPointerArray<
+ Usif::TAppRegInfo>& aAppInfo, TCPixActionType /*aActionType*/)
{
//If application has 'hidden' capability, don't index.
- if( IsAppHiddenL( aAppInfo.iUid ) ) return;
-
- TBuf<KMaxFileName> docidString;
- docidString.Append( aAppInfo.iUid.Name() ); //This returns descriptor in the form "[UID]". So remove the brackets.
- docidString = docidString.Mid( KUidStartIndex, KUidEndIndex );
-
- CSearchDocument* document = CSearchDocument::NewLC( docidString, _L(APPLICATIONS_APPCLASS) );
- //The UID field should not be aggregated for now as we dont want it to be searchable by default.
- //By default, all tokenized fields are aggregated and therefore searchable.
- //If we dont tokenize, then the field will not be searchable at all.
- //As a middle path, we tokenize this field, but explicitly chose NOT to aggregate it.
- //That way, if a client is interested in the UID field, he can choose to query it explicitly.
- document->AddFieldL(KMimeTypeField, KMimeTypeApplication, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized );
- document->AddFieldL(KApplicationFieldUid, docidString, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EAggregateNo );
-#ifdef USE_HIGHLIGHTER
- TInt excerptLength = docidString.Length();
- HBufC* excerpt = HBufC::NewL(excerptLength);
- TPtr excerptPtr = excerpt->Des();
- CleanupStack::PushL(excerpt);
- document->AddExcerptL(excerptPtr);
- CleanupStack::PopAndDestroy(excerpt);
-#endif
-
- /*if( iWidgetRegistry.IsWidget( aAppInfo.iUid ) ) //Widget support
- AddWidgetInfoL( document, aAppInfo.iUid );
- else*/
- AddApplicationInfoL( document, aAppInfo );
+ for (TInt i = 0; i < aAppInfo.Count(); i++)
+ {
+ if (!IsAppHiddenL(aAppInfo[i]->Uid()))
+ {
+ OstTrace0( TRACE_NORMAL, DUP2_CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML, "CApplicationsPlugin::Indexing Application" );
+
+ TBuf<KMaxFileName> docidString;
+ docidString.Append(aAppInfo[i]->Uid().Name()); //This returns descriptor in the form "[UID]". So remove the brackets.
+ docidString = docidString.Mid(KUidStartIndex, KUidEndIndex);
- TRAPD( error, iIndexer->AddL( *document ) );
- if( KErrNone == error )
- {
- OstTrace0( TRACE_NORMAL, CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML, "CApplicationsPlugin::CreateApplicationsIndexItemL : No Error" );
- CPIXLOGSTRING("CApplicationsPlugin::CreateApplicationsIndexItemL(): No Error" );
+ CSearchDocument* document = CSearchDocument::NewLC(docidString,
+ _L(APPLICATIONS_APPCLASS));
+ //The UID field should not be aggregated for now as we dont want it to be searchable by default.
+ //By default, all tokenized fields are aggregated and therefore searchable.
+ //If we dont tokenize, then the field will not be searchable at all.
+ //As a middle path, we tokenize this field, but explicitly chose NOT to aggregate it.
+ //That way, if a client is interested in the UID field, he can choose to query it explicitly.
+ document->AddFieldL(KMimeTypeField, KMimeTypeApplication,
+ CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized);
+ document->AddFieldL(KApplicationFieldUid, docidString,
+ CDocumentField::EStoreYes | CDocumentField::EIndexTokenized
+ | CDocumentField::EAggregateNo);
+
+ TInt excerptLength = docidString.Length();
+ HBufC* excerpt = HBufC::NewL(excerptLength);
+ TPtr excerptPtr = excerpt->Des();
+ CleanupStack::PushL(excerpt);
+ document->AddExcerptL(excerptPtr);
+ CleanupStack::PopAndDestroy(excerpt);
+
+ /*if( iWidgetRegistry.IsWidget( aAppInfo.iUid ) ) //Widget support
+ AddWidgetInfoL( document, aAppInfo.iUid );
+ else*/
+ AddApplicationInfoL(document, *aAppInfo[i]);
+ TRAPD( error, iIndexer->AddL( *document ) );
+ if (KErrNone == error)
+ {
+ OstTrace0( TRACE_NORMAL, CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML, "CApplicationsPlugin::CreateApplicationsIndexItemL : No Error" );
+ CPIXLOGSTRING("CApplicationsPlugin::CreateApplicationsIndexItemL(): No Error" );
+ }
+ else
+ {
+ OstTrace1( TRACE_NORMAL, DUP1_CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML, "CApplicationsPlugin::CreateApplicationsIndexItemL;Error=%d", error );
+ CPIXLOGSTRING2("CApplicationsPlugin::CreateApplicationsIndexItemL(): Error = %d", error );
+ }
+ CleanupStack::PopAndDestroy(document);
+ }
}
- else
- {
- OstTrace1( TRACE_NORMAL, DUP1_CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML, "CApplicationsPlugin::CreateApplicationsIndexItemL;Error=%d", error );
- CPIXLOGSTRING2("CApplicationsPlugin::CreateApplicationsIndexItemL(): Error = %d", error );
- }
- CleanupStack::PopAndDestroy( document );
}
// -----------------------------------------------------------------------------
void CApplicationsPlugin::DelayedCallbackL( TInt /*aCode*/ )
{
- TApaAppInfo appInfo;
- const TInt error = iApplicationServerSession.GetNextApp( appInfo );
- if( error == KErrNone )
+ if( !iIndexState )
+ return;
+
+ RPointerArray<Usif::TAppRegInfo> appInfo;
+ //const TInt error = iApplicationServerSession.GetNextApp(appInfo);
+ iScrView.GetNextAppInfoL(KNumberOfAppInfoToBeRead, appInfo);
+ if (appInfo.Count() > 0)
{
CreateApplicationsIndexItemL( appInfo, ECPixAddAction );
+ iAsynchronizer->Start( 0, this, KHarvestingDelay );
}
-
- if ( error != RApaLsSession::ENoMoreAppsInList )
+ else
{
- //No need to check IsStatred() since control reaches
- //here only on asynchornize complete.
- iAsynchronizer->Start( 0, this, KHarvestingDelay );
- }
- else
- {
- Flush( *iIndexer );
+ OstTrace0( TRACE_NORMAL, CAPPLICATIONSPLUGIN_DELAYEDCALLBACKL, "CApplicationsPlugin::DelayedCallbackL:Flushing" );
+
+ Flush(*iIndexer);
#ifdef __PERFORMANCE_DATA
UpdatePerformaceDataL();
#endif
+ iHarvestState = EHarvesterIdleState;
iObserver->HarvestingCompleted( this, iIndexer->GetBaseAppClass(), KErrNone );
}
- }
+ appInfo.ResetAndDestroy();
+ }
// -----------------------------------------------------------------------------
void CApplicationsPlugin::DelayedError( TInt aCode )
{
Flush(*iIndexer);
+ iHarvestState = EHarvesterIdleState;
iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), aCode);
}
@@ -326,6 +351,26 @@
OstTraceFunctionExit0( CAPPLICATIONSPLUGIN_HANDLEAPPLISTEVENT_EXIT );
}
+void CApplicationsPlugin::PausePluginL()
+ {
+ OstTraceFunctionEntry0( CAPPLICATIONSPLUGIN_PAUSEPLUGINL_ENTRY );
+ iIndexState = EFalse;
+ OstTraceFunctionExit0( CAPPLICATIONSPLUGIN_PAUSEPLUGINL_EXIT );
+ }
+
+void CApplicationsPlugin::ResumePluginL()
+ {
+ OstTraceFunctionEntry0( CAPPLICATIONSPLUGIN_RESUMEPLUGINL_ENTRY );
+ iIndexState = ETrue;
+ if(iHarvestState == EHarvesterStartHarvest)
+ {
+ if(iAsynchronizer->CallbackPending())
+ iAsynchronizer->CancelCallback();
+ iAsynchronizer->Start( 0, this, KHarvestingDelay );
+ }
+ OstTraceFunctionExit0( CAPPLICATIONSPLUGIN_RESUMEPLUGINL_EXIT );
+ }
+
#ifdef __PERFORMANCE_DATA
void CApplicationsPlugin::UpdatePerformaceDataL()
{
--- a/harvesterplugins/applications/traces/OstTraceDefinitions.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/applications/traces/OstTraceDefinitions.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+/*
+* This is Default Licence added by TraceCompiler
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
#ifndef __OSTTRACEDEFINITIONS_H__
#define __OSTTRACEDEFINITIONS_H__
// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
--- a/harvesterplugins/applications/traces/applicationspluginTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/applications/traces/applicationspluginTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __APPLICATIONSPLUGINTRACES_H__
@@ -10,57 +26,35 @@
#define CAPPLICATIONSPLUGIN_NEWL_EXIT 0x8a0002
#define CAPPLICATIONSPLUGIN_HANDLEAPPLISTEVENT_ENTRY 0x8a0003
#define CAPPLICATIONSPLUGIN_HANDLEAPPLISTEVENT_EXIT 0x8a0004
-#define CAPPLICATIONSPLUGIN_ADDWIDGETINFOL 0x860001
-#define DUP1_CAPPLICATIONSPLUGIN_ADDWIDGETINFOL 0x860002
-#define _ADDAPPLICATIONINFOL 0x860003
+#define CAPPLICATIONSPLUGIN_PAUSEPLUGINL_ENTRY 0x8a0005
+#define CAPPLICATIONSPLUGIN_PAUSEPLUGINL_EXIT 0x8a0006
+#define CAPPLICATIONSPLUGIN_RESUMEPLUGINL_ENTRY 0x8a0007
+#define CAPPLICATIONSPLUGIN_RESUMEPLUGINL_EXIT 0x8a0008
+#define CAPPLICATIONSPLUGIN_CAPPLICATIONSPLUGIN_ENTRY 0x8a0009
+#define CAPPLICATIONSPLUGIN_CAPPLICATIONSPLUGIN_EXIT 0x8a000a
+#define CAPPLICATIONSPLUGIN_CONSTRUCTL_ENTRY 0x8a000b
+#define CAPPLICATIONSPLUGIN_CONSTRUCTL_EXIT 0x8a000c
+#define CAPPLICATIONSPLUGIN_STARTPLUGINL_ENTRY 0x8a000d
+#define CAPPLICATIONSPLUGIN_STARTPLUGINL_EXIT 0x8a000e
+#define CAPPLICATIONSPLUGIN_STARTHARVESTINGL_ENTRY 0x8a000f
+#define CAPPLICATIONSPLUGIN_STARTHARVESTINGL_EXIT 0x8a0010
+#define _ADDAPPLICATIONINFOL_ENTRY 0x8a0011
+#define _ADDAPPLICATIONINFOL_EXIT 0x8a0012
#define DUP1__ADDAPPLICATIONINFOL 0x860004
#define CAPPLICATIONSPLUGIN_ISAPPHIDDENL 0x860005
#define DUP1_CAPPLICATIONSPLUGIN_ISAPPHIDDENL 0x860006
#define CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML 0x860007
#define DUP1_CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML 0x860008
#define CAPPLICATIONSPLUGIN_HANDLEAPPLISTEVENT 0x860009
-#define STATE_DUP1_CAPPLICATIONSPLUGIN_ISAPPHIDDENL 0x870001
+#define DUP2_CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML 0x86000a
+#define CAPPLICATIONSPLUGIN_DELAYEDCALLBACKL 0x86000b
+#define _ADDAPPLICATIONINFOL 0x86000c
#ifndef __KERNEL_MODE__
-inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC16& aParam1 )
- {
- TBool retval;
- TInt size = aParam1.Size();
- // BTrace assumes that parameter size is atleast 4 bytes
- if (size % 4 == 0)
- {
- TUint8* ptr = ( TUint8* )aParam1.Ptr();
- // Data is written directly and length is determined from trace message length
- retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size );
- }
- else
- {
- TUint8 data[ KOstMaxDataLength ];
- TUint8* ptr = data;
- if (size > KOstMaxDataLength)
- {
- size = KOstMaxDataLength;
- }
- TInt sizeAligned = ( size + 3 ) & ~3;
- memcpy( ptr, aParam1.Ptr(), size );
- ptr += size;
- // Fillers are written to get 32-bit alignment
- while ( size++ < sizeAligned )
- {
- *ptr++ = 0;
- }
- ptr -= sizeAligned;
- size = sizeAligned;
- // Data is written directly and length is determined from trace message length
- retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size );
- }
- return retval;
- }
-#endif
+#ifndef __OSTTRACEGEN2_TUINT32_CONST_TDESC16REF_CONST_TDESC16REF__
+#define __OSTTRACEGEN2_TUINT32_CONST_TDESC16REF_CONST_TDESC16REF__
-
-#ifndef __KERNEL_MODE__
inline TBool OstTraceGen2( TUint32 aTraceID, const TDesC16& aParam1, const TDesC16& aParam2 )
{
TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID );
@@ -141,89 +135,10 @@
}
return retval;
}
-#endif
-
-inline TBool OstTraceGen2( TUint32 aTraceID, const TDesC8& aParam1, const TDesC8& aParam2 )
- {
- TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID );
- if ( retval )
- {
- TInt length = 0;
- // Check that parameter lenght is not too long
- TInt length1 = aParam1.Size();
- if ((length + length1 + sizeof ( TUint32 )) > KOstMaxDataLength)
- {
- length1 = KOstMaxDataLength - (length + sizeof ( TUint32 ));
- }
- TInt lengthAligned1 = ( length1 + 3 ) & ~3;
- if (lengthAligned1 > 0)
- {
- length = length + sizeof ( TUint32 ) + lengthAligned1;
- }
- // Check that parameter lenght is not too long
- TInt length2 = aParam2.Size();
- if ((length + length2 + sizeof ( TUint32 )) > KOstMaxDataLength)
- {
- length2 = KOstMaxDataLength - (length + sizeof ( TUint32 ));
- }
- TInt lengthAligned2 = ( length2 + 3 ) & ~3;
- if (lengthAligned2 > 0)
- {
- length = length + sizeof ( TUint32 ) + lengthAligned2;
- }
- TUint8 data[ KOstMaxDataLength ];
- TUint8* ptr = data;
- // Set length to zero and calculate it againg
- // when adding parameters
- length = 0;
- if (length1 > 0)
- {
- // Number of elements is written before data
- // In case of Unicode string, number of elements is half of length
- *( ( TUint32* )ptr ) = length1 / (aParam1.Size() / aParam1.Length());
- ptr += sizeof ( TUint32 );
- memcpy( ptr, aParam1.Ptr(), length1 );
- ptr += length1;
- // Fillers are written to get 32-bit alignment
- while ( length1++ < lengthAligned1 )
- {
- *ptr++ = 0;
- }
- length += sizeof ( TUint32 ) + lengthAligned1;
- }
- else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength)
- {
- *( ( TUint32* )ptr ) = 0;
- ptr += sizeof ( TUint32 );
- length += sizeof ( TUint32 );
- }
- if (length2 > 0)
- {
- // Number of elements is written before data
- // In case of Unicode string, number of elements is half of length
- *( ( TUint32* )ptr ) = length2 / (aParam2.Size() / aParam2.Length());
- ptr += sizeof ( TUint32 );
- memcpy( ptr, aParam2.Ptr(), length2 );
- ptr += length2;
- // Fillers are written to get 32-bit alignment
- while ( length2++ < lengthAligned2 )
- {
- *ptr++ = 0;
- }
- length += sizeof ( TUint32 ) + lengthAligned2;
- }
- else if (length + sizeof ( TUint32 ) <= KOstMaxDataLength)
- {
- *( ( TUint32* )ptr ) = 0;
- ptr += sizeof ( TUint32 );
- length += sizeof ( TUint32 );
- }
- ptr -= length;
- retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, length );
- }
- return retval;
- }
+#endif // __OSTTRACEGEN2_TUINT32_CONST_TDESC16REF_CONST_TDESC16REF__
+
+#endif
#endif
--- a/harvesterplugins/applications/traces/fixed_id.definitions Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/applications/traces/fixed_id.definitions Tue Oct 05 13:32:14 2010 +0530
@@ -1,18 +1,51 @@
+##
+# This is Default Licence added by TraceCompiler
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+##
#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
[GROUP]TRACE_FLOW=0x8a
[GROUP]TRACE_NORMAL=0x86
-[GROUP]TRACE_STATE=0x87
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_CAPPLICATIONSPLUGIN_ENTRY=0x9
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_CAPPLICATIONSPLUGIN_EXIT=0xa
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_CONSTRUCTL_ENTRY=0xb
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_CONSTRUCTL_EXIT=0xc
[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_HANDLEAPPLISTEVENT_ENTRY=0x3
[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_HANDLEAPPLISTEVENT_EXIT=0x4
[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_NEWL_ENTRY=0x1
[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_NEWL_EXIT=0x2
-[TRACE]TRACE_NORMAL[0x86]_CAPPLICATIONSPLUGIN_ADDWIDGETINFOL=0x1
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_PAUSEPLUGINL_ENTRY=0x5
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_PAUSEPLUGINL_EXIT=0x6
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_RESUMEPLUGINL_ENTRY=0x7
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_RESUMEPLUGINL_EXIT=0x8
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_STARTHARVESTINGL_ENTRY=0xf
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_STARTHARVESTINGL_EXIT=0x10
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_STARTPLUGINL_ENTRY=0xd
+[TRACE]TRACE_FLOW[0x8A]_CAPPLICATIONSPLUGIN_STARTPLUGINL_EXIT=0xe
+[TRACE]TRACE_FLOW[0x8A]__ADDAPPLICATIONINFOL_ENTRY=0x11
+[TRACE]TRACE_FLOW[0x8A]__ADDAPPLICATIONINFOL_EXIT=0x12
[TRACE]TRACE_NORMAL[0x86]_CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML=0x7
+[TRACE]TRACE_NORMAL[0x86]_CAPPLICATIONSPLUGIN_DELAYEDCALLBACKL=0xb
[TRACE]TRACE_NORMAL[0x86]_CAPPLICATIONSPLUGIN_HANDLEAPPLISTEVENT=0x9
[TRACE]TRACE_NORMAL[0x86]_CAPPLICATIONSPLUGIN_ISAPPHIDDENL=0x5
-[TRACE]TRACE_NORMAL[0x86]_DUP1_CAPPLICATIONSPLUGIN_ADDWIDGETINFOL=0x2
[TRACE]TRACE_NORMAL[0x86]_DUP1_CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML=0x8
[TRACE]TRACE_NORMAL[0x86]_DUP1_CAPPLICATIONSPLUGIN_ISAPPHIDDENL=0x6
[TRACE]TRACE_NORMAL[0x86]_DUP1__ADDAPPLICATIONINFOL=0x4
-[TRACE]TRACE_NORMAL[0x86]__ADDAPPLICATIONINFOL=0x3
-[TRACE]TRACE_STATE[0x87]_STATE_DUP1_CAPPLICATIONSPLUGIN_ISAPPHIDDENL=0x1
+[TRACE]TRACE_NORMAL[0x86]_DUP2_CAPPLICATIONSPLUGIN_CREATEAPPLICATIONSINDEXITEML=0xa
+[TRACE]TRACE_NORMAL[0x86]__ADDAPPLICATIONINFOL=0xc
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_CAPPLICATIONSPLUGIN_ADDWIDGETINFOL=0x1
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DUP1_CAPPLICATIONSPLUGIN_ADDWIDGETINFOL=0x2
+[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]__ADDAPPLICATIONINFOL=0x3
+[[OBSOLETE]][TRACE]TRACE_STATE[0x87]_STATE_DUP1_CAPPLICATIONSPLUGIN_ISAPPHIDDENL=0x1
--- a/harvesterplugins/bookmarks/inc/bookmarksplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/bookmarks/inc/bookmarksplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -66,6 +66,10 @@
*/
void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
+ virtual void PausePluginL();
+
+ virtual void ResumePluginL();
+
//From MFavouritesDbObserver.
void HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent);
--- a/harvesterplugins/bookmarks/src/bookmarksplugin.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/bookmarks/src/bookmarksplugin.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -353,7 +353,16 @@
StartHarvestingL( KNullDesC );
}
}
-
+
+void CBookmarksPlugin::PausePluginL()
+ {
+
+ }
+
+void CBookmarksPlugin::ResumePluginL()
+ {
+
+ }
// -----------------------------------------------------------------------------
#ifdef __PERFORMANCE_DATA
void CBookmarksPlugin::UpdatePerformaceDataL()
--- a/harvesterplugins/calendar/data/2001f704.rss Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/calendar/data/2001f704.rss Tue Oct 05 13:32:14 2010 +0530
@@ -39,7 +39,7 @@
version_no = 1;
display_name = "Calendar";
default_data = "Calendar";
- opaque_data = "";
+ opaque_data = "z:\\resource\\qt\\plugins\\searchsrv\\contentconfig\\calendarconfig.xml";
}
};
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvesterplugins/calendar/data/calendarconfig.xml Tue Oct 05 13:32:14 2010 +0530
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<category>
+ <name>Calendar</name>
+ <mime>application/v-calendar</mime>
+ <licon>qtg_large_calendar</licon>
+ <baseapp>root calendar</baseapp>
+ <lname>txt_search_list_calendarnotes</lname>
+ <displayorder>4</displayorder>
+ <exceptionstring>txt_calendar_preview_unnamed</exceptionstring>
+ <tsfile>Z:/resource/qt/translations/calendar_</tsfile>
+ <actionuri>
+ <uri>
+ <uristring></uristring>
+ <lname></lname>
+ <licon></licon>
+ <uriref></uriref>
+ <action></action><!-- primary action or default action. alternatively, we could always use first entry as this one -->
+ </uri>
+ </actionuri>
+ <fieldmap>
+ <resulthit>
+ <field>Summary</field>
+ <auri></auri><!-- alternatively <auriorder>1,2,3,4</auriorder> instead of four lines -->
+ </resulthit>
+ </fieldmap>
+ <indexcontentsize>L</indexcontentsize> <!-- possible values S, M, L, XL, XXL. or scale of 1 to 10. -->
+ <policy>
+ <capability>WriteDeviceData<!-- Allow search on my data from clients with only Write Device Data capability it is combination of SID/VID/capability --></capability>
+ </policy>
+ <resultfirstline>
+ <list>
+ <field>Description</field><!-- commo seperated list, if there is a chance that certain field could be empty -->
+ <field>Summary</field>
+ </list>
+ </resultfirstline>
+ <relevancy>
+ <boost>
+ <field>Description</field>
+ <boostvalue>10</boostvalue><!-- on scale 1-10 -->
+ </boost>
+ <boost>
+ <field>Summary</field>
+ <boostvalue>5</boostvalue>
+ </boost>
+ </relevancy>
+</category>
--- a/harvesterplugins/calendar/group/bld.inf Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/calendar/group/bld.inf Tue Oct 05 13:32:14 2010 +0530
@@ -18,3 +18,5 @@
PRJ_MMPFILES
calendarplugin.mmp
+PRJ_EXPORTS
+../data/calendarconfig.xml /epoc32/data/z/resource/qt/plugins/searchsrv/contentconfig/calendarconfig.xml
\ No newline at end of file
--- a/harvesterplugins/calendar/inc/ccalendarplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/calendar/inc/ccalendarplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -50,7 +50,18 @@
class CCalendarPlugin : public CIndexingPlugin, public MDelayedCallbackObserver, public MCalProgressCallBack, public MCalChangeCallBack2
{
public: // Constructors and destructor
-
+
+ enum THarvesterState
+ {
+ EHarvesterIdleState,
+ EHarvesterStartHarvest
+ };
+ struct TRecord
+ {
+ TCalLocalUid iLocalUid;
+ TCPixActionType iActionType;
+ };
+
static CCalendarPlugin* NewL();
static CCalendarPlugin* NewLC();
virtual ~CCalendarPlugin();
@@ -58,6 +69,8 @@
public: // From CIndexingPlugin
void StartPluginL();
void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
+ void PausePluginL();
+ void ResumePluginL();
public: // From MCalProgressCallBack
@@ -83,7 +96,7 @@
void DelayedCallbackL(TInt aCode);
void DelayedError(TInt aError);
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
public: // AddExcerpt function
/*
@@ -100,7 +113,7 @@
*/
void ResetExcerpt();
-#endif
+//#endif
/*
* For date and time get discriptor value in the passed format
* @param TDateTime& datetime: date time to be formatted
@@ -112,8 +125,20 @@
private: // New functions
void HandleChangedEntryL(const TCalChangeEntry& changedEntry);
-
- void CreateEntryL( const TCalLocalUid& aLocalUid, TCPixActionType aActionType );
+ /*
+ * Indexes a calendar entry
+ */
+ void CreateEntryL( const TCalLocalUid& aLocalUid, TCPixActionType aActionType );
+ /*
+ * Adds/updates a calender entry to queue on pause of plugin
+ * @param const TCalLocalUid& aLocalUid: unique UID of a calender entry
+ * @param TCPixActionType aActionType: add/update or delete event
+ */
+ void OverWriteOrAddToQueueL(const TCalLocalUid& aLocalUid, TCPixActionType aActionType);
+ /*
+ * On resume, removes the entries from the queue and starts indexing
+ */
+ void IndexQueuedItems();
private: // Constructors
@@ -147,12 +172,18 @@
/** Are we positioned at first entry? */
TBool iFirstEntry;
+ //State of harvester either to pause/resume
+ TBool iIndexState;
+ // Queue of documents to be indexed
+ RArray<TRecord> iJobQueue;
+ //harvesting state
+ THarvesterState iHarvestState;
// Start harvesting
TBool iStartHarvesting;
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
// Excerpt field
HBufC* iExcerpt;
-#endif
+//#endif
//for unit testing.
#ifdef HARVESTERPLUGINTESTER_FRIEND
friend class CHarvesterPluginTester;
--- a/harvesterplugins/calendar/src/ccalendarplugin.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/calendar/src/ccalendarplugin.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -87,11 +87,13 @@
delete iEntryView;
delete iCalIterator;
-#ifdef USE_HIGHLIGHTER
+ iJobQueue.Reset();
+ iJobQueue.Close();
+//#ifdef USE_HIGHLIGHTER
if(iExcerpt)
delete iExcerpt;
iExcerpt = NULL;
-#endif
+//#endif
if( iSession )
{
iSession->StopChangeNotification();
@@ -105,6 +107,7 @@
//
void CCalendarPlugin::ConstructL()
{
+ iIndexState = ETrue;
iAsynchronizer = CDelayedCallback::NewL( CActive::EPriorityIdle );
iSession = CCalSession::NewL();
TRAPD ( err , iSession->OpenL( iSession->DefaultFileNameL() ) );
@@ -153,6 +156,7 @@
{
iIndexer->ResetL();
iStartHarvesting = ETrue;
+ iHarvestState = EHarvesterStartHarvest;
#ifdef __PERFORMANCE_DATA
iStartTime.UniversalTime();
#endif
@@ -177,7 +181,7 @@
//
void CCalendarPlugin::Completed( TInt aError )
{
- // No error code and harvesting is needed star harvesting.
+ // No error code and harvesting is needed start harvesting.
iFirstEntry = ETrue;
if (aError == KErrNone && iStartHarvesting)
{
@@ -201,47 +205,51 @@
//
void CCalendarPlugin::DelayedCallbackL( TInt /*aCode*/ )
{
+ if(!iIndexState)
+ return;
// Harvest items on each call
TPtrC8 uid( KNullDesC8 );
-
- if( iFirstEntry )
- {
- uid.Set( iCalIterator->FirstL() );
- iFirstEntry = EFalse;
- }
- else
- {
- uid.Set( iCalIterator->NextL() );
- }
+
+ if( iFirstEntry )
+ {
+ uid.Set( iCalIterator->FirstL() );
+ iFirstEntry = EFalse;
+ }
+ else
+ {
+ uid.Set( iCalIterator->NextL() );
+ }
- if( uid != KNullDesC8 )
- {
- RPointerArray<CCalEntry> entryArray;
- CleanupResetAndDestroyPushL(entryArray);
- iEntryView->FetchL( uid, entryArray );
- // Handle only the first (i.e. parent entry)
- if( entryArray.Count() > 0 )
- {
- CCalEntry* entry = (CCalEntry*)entryArray[ 0 ];
- OstTrace1( TRACE_NORMAL, CCALENDARPLUGIN_DELAYEDCALLBACKL, "CCalendarPlugin::DelayedCallbackL();Harvesting id=%d", entry->LocalUidL() );
- CPIXLOGSTRING2("CCalendarPlugin::DelayedCallbackL(): Harvesting id=%d.", entry->LocalUidL());
- CreateEntryL( entry->LocalUidL(), ECPixAddAction );
- }
- CleanupStack::PopAndDestroy(&entryArray);
+ if( uid != KNullDesC8 )
+ {
+ RPointerArray<CCalEntry> entryArray;
+ CleanupResetAndDestroyPushL(entryArray);
+ iEntryView->FetchL( uid, entryArray );
+ // Handle only the first (i.e. parent entry)
+ if( entryArray.Count() > 0 )
+ {
+ CCalEntry* entry = (CCalEntry*)entryArray[ 0 ];
+ OstTrace1( TRACE_NORMAL, CCALENDARPLUGIN_DELAYEDCALLBACKL, "CCalendarPlugin::DelayedCallbackL();Harvesting id=%d", entry->LocalUidL() );
+ CPIXLOGSTRING2("CCalendarPlugin::DelayedCallbackL(): Harvesting id=%d.", entry->LocalUidL());
+ CreateEntryL( entry->LocalUidL(), ECPixAddAction );
+ }
+ CleanupStack::PopAndDestroy(&entryArray);
- // Request next entry.
- iAsynchronizer->Start( 0, this, KHarvestingDelay );
- }
- else
- {
- // Harvesting was successfully completed
- iFirstEntry = ETrue; // Make sure we can harvest next time as well...
- Flush(*iIndexer);
+ // Request next entry.
+ iAsynchronizer->Start( 0, this, KHarvestingDelay );
+ }
+ else
+ {
+ // Harvesting was successfully completed
+ iFirstEntry = ETrue; // Make sure we can harvest next time as well...
+ Flush(*iIndexer);
#ifdef __PERFORMANCE_DATA
UpdatePerformaceDataL();
#endif
- iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), KErrNone);
- }
+ iHarvestState = EHarvesterIdleState;
+ iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), KErrNone);
+ }
+
}
// ---------------------------------------------------------------------------
@@ -253,6 +261,7 @@
// Harvesting was completed
iFirstEntry = ETrue; // Make sure we can harvest next time as well...
Flush(*iIndexer);
+ iHarvestState = EHarvesterIdleState;
iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), aError);
}
@@ -289,7 +298,10 @@
CreateEntryL( changedEntry.iEntryId, ECPixAddAction );
UpdatePerformaceDataL(ECPixAddAction);
#else
- CreateEntryL( changedEntry.iEntryId, ECPixAddAction );
+ if( iIndexState )
+ CreateEntryL( changedEntry.iEntryId, ECPixAddAction );
+ else
+ OverWriteOrAddToQueueL(changedEntry.iEntryId, ECPixAddAction);
#endif
break;
}
@@ -303,7 +315,10 @@
CreateEntryL( changedEntry.iEntryId, ECPixAddAction );
UpdatePerformaceDataL(ECPixAddAction);
#else
- CreateEntryL( changedEntry.iEntryId, ECPixRemoveAction );
+ if( iIndexState )
+ CreateEntryL( changedEntry.iEntryId, ECPixRemoveAction );
+ else
+ OverWriteOrAddToQueueL(changedEntry.iEntryId, ECPixRemoveAction);
#endif
break;
}
@@ -317,7 +332,10 @@
CreateEntryL( changedEntry.iEntryId, ECPixUpdateAction );
UpdatePerformaceDataL(ECPixUpdateAction);
#else
- CreateEntryL( changedEntry.iEntryId, ECPixUpdateAction );
+ if( iIndexState )
+ CreateEntryL( changedEntry.iEntryId, ECPixUpdateAction );
+ else
+ OverWriteOrAddToQueueL(changedEntry.iEntryId, ECPixUpdateAction);
#endif
break;
}
@@ -338,6 +356,7 @@
iFirstEntry = ETrue; // Make sure we can harvest next time as well...
Flush(*iIndexer);
+ iJobQueue.Reset();
iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), KErrCancel);
iObserver->RemoveHarvestingQueue(this, iIndexer->GetBaseAppClass());
iObserver->AddHarvestingQueue(this, iIndexer->GetBaseAppClass(), ETrue);
@@ -357,14 +376,12 @@
{
if (!iIndexer)
return;
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
//Reset Excerpt
ResetExcerpt();
-#endif
-
-
+//#endif
OstTrace1( TRACE_NORMAL, CCALENDARPLUGIN_CREATEENTRYL, "CCalendarPlugin::CreateEntryL();Uid=%d", aLocalUid );
- CPIXLOGSTRING2("CCalendarPlugin::CreateEntryL(): Uid = %d.", aLocalUid);
+ CPIXLOGSTRING2("CCalendarPlugin::CreateEntryL(): Uid = %d.", aLocalUid);
// creating CSearchDocument object with unique ID for this application
TBuf<20> docid_str;
@@ -392,43 +409,35 @@
CPIXLOGSTRING("CCalendarPlugin::CreateEntryL(): Donot harvest Note item.");
return;
}
-
+ OstTrace0( TRACE_NORMAL, DUP3_CCALENDARPLUGIN_CREATEENTRYL, "CCalendarPlugin:: Indexing Calender" );
// Add fields
index_item->AddFieldL(KCalendarSummaryField, entry->SummaryL());
index_item->AddFieldL(KCalendarDescriptionField, entry->DescriptionL());
index_item->AddFieldL(KCalendarLocationField, entry->LocationL());
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
index_item->AddHLDisplayFieldL(entry->SummaryL());
AddToFieldExcerptL(entry->DescriptionL());
AddToFieldExcerptL(entry->LocationL());
-#endif
+//#endif
TBuf<30> dateString;
TDateTime datetime = entry->StartTimeL().TimeLocalL().DateTime();
GetDateTimeDescriptorL(datetime, KCalendarTimeFormat, dateString);
- /*dateString.Format( KCalendarTimeFormat, datetime.Year(),
- TInt(datetime.Month()+ 1),
- datetime.Day() + 1,
- datetime.Hour(),
- datetime.Minute());*/
+
index_item->AddFieldL(KCalendarStartTimeField, dateString, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized);
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
GetDateTimeDescriptorL(datetime, KExcerptTimeFormat, dateString);
AddToFieldExcerptL(dateString);
-#endif
+//#endif
TDateTime endTime = entry->EndTimeL().TimeLocalL().DateTime();
GetDateTimeDescriptorL(endTime, KCalendarTimeFormat, dateString);
- /*dateString.Format( KCalendarTimeFormat, endTime.Year(),
- TInt(endTime.Month()+ 1),
- endTime.Day() + 1,
- endTime.Hour(),
- endTime.Minute());*/
+
index_item->AddFieldL(KCalendarEndTimeField, dateString, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized);
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
GetDateTimeDescriptorL(endTime, KExcerptTimeFormat, dateString);
AddToFieldExcerptL(dateString);
-#endif
+//#endif
if( CCalEntry::ETodo == entry->EntryTypeL())
{
@@ -452,27 +461,23 @@
if( completedTime != Time::NullTTime())
{
TDateTime compTime = completedTime.DateTime();
- GetDateTimeDescriptorL(compTime, KCalendarTimeFormat, dateString);
- /*dateString.Format( KCalendarTimeFormat, compTime.Year(),
- TInt(compTime.Month()+ 1),
- compTime.Day() + 1,
- compTime.Hour(),
- compTime.Minute());*/
+ GetDateTimeDescriptorL(compTime, KCalendarTimeFormat, dateString);
index_item->AddFieldL(KCalenderCompletedField, dateString, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized);
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
GetDateTimeDescriptorL(compTime, KExcerptTimeFormat, dateString);
AddToFieldExcerptL(dateString);
-#endif
+//#endif
}
}
index_item->AddFieldL(KMimeTypeField, KMimeTypeCalendar, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized);
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
if(iExcerpt)
index_item->AddExcerptL(*iExcerpt);
+/*
#else
- TInt excerptLength = 1 /*single 1-character delimiters*/ + entry->DescriptionL().Length() + entry->LocationL().Length();
+ TInt excerptLength = 1 single 1-character delimiters + entry->DescriptionL().Length() + entry->LocationL().Length();
HBufC* excerpt = HBufC::NewLC(excerptLength);
TPtr excerptDes = excerpt->Des();
@@ -484,6 +489,7 @@
CleanupStack::PopAndDestroy(excerpt);
#endif
+*/
CleanupStack::PopAndDestroy(entry);
/*
@@ -517,13 +523,16 @@
}
}
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
// ---------------------------------------------------------------------------
// CCalendarPlugin::AddToFieldExcerptL
// ---------------------------------------------------------------------------
//
void CCalendarPlugin::AddToFieldExcerptL(const TDesC& aExcerptValue)
{
+OstTraceFunctionEntry0( CCALENDARPLUGIN_ADDTOFIELDEXCERPTL_ENTRY );
+OstTraceExt1( TRACE_NORMAL, CCALENDARPLUGIN_ADDTOFIELDEXCERPTL, "CCalendarPlugin::AddToFieldExcerptL;excerptvalue=%S", aExcerptValue );
+
if(!iExcerpt)
{
iExcerpt = HBufC::NewL(5);
@@ -540,6 +549,7 @@
ptr.Append(aExcerptValue);
ptr.Append(KExcerptDelimiter);
}
+OstTraceFunctionExit0( CCALENDARPLUGIN_ADDTOFIELDEXCERPTL_EXIT );
}
// -----------------------------------------------------------------------------
@@ -554,7 +564,7 @@
iExcerpt = NULL;
}
}
-#endif
+//#endif
// -----------------------------------------------------------------------------
// CCalendarPlugin::GetDateTimeDescriptorL()
// -----------------------------------------------------------------------------
@@ -567,8 +577,81 @@
datetime.Hour(),
datetime.Minute());
}
-
-
+// -----------------------------------------------------------------------------
+// CCalendarPlugin::PausePluginL()
+// -----------------------------------------------------------------------------
+//
+void CCalendarPlugin::PausePluginL()
+ {
+ OstTraceFunctionEntry0( CCALENDARPLUGIN_PAUSEPLUGINL_ENTRY );
+ iIndexState = EFalse;
+ OstTraceFunctionExit0( CCALENDARPLUGIN_PAUSEPLUGINL_EXIT );
+ }
+// -----------------------------------------------------------------------------
+// CCalendarPlugin::ResumePluginL()
+// -----------------------------------------------------------------------------
+//
+void CCalendarPlugin::ResumePluginL()
+ {
+ OstTraceFunctionEntry0( CCALENDARPLUGIN_RESUMEPLUGINL_ENTRY );
+ iIndexState = ETrue;
+
+ if( iHarvestState == EHarvesterStartHarvest )
+ {
+ if(iAsynchronizer->CallbackPending())
+ iAsynchronizer->CancelCallback();
+ iAsynchronizer->Start( 0, this, KHarvestingDelay );
+ }
+ else
+ {
+ IndexQueuedItems();
+ }
+ OstTraceFunctionExit0( CCALENDARPLUGIN_RESUMEPLUGINL_EXIT );
+ }
+// -----------------------------------------------------------------------------
+// CCalendarPlugin::OverWriteOrAddToQueueL()
+// -----------------------------------------------------------------------------
+//
+void CCalendarPlugin::OverWriteOrAddToQueueL(const TCalLocalUid& aLocalUid, TCPixActionType aActionType)
+ {
+ OstTraceFunctionEntry0( CCALENDARPLUGIN_OVERWRITEORADDTOQUEUEL_ENTRY );
+ TRecord entry;
+ for (TInt i=0; i<iJobQueue.Count(); i++)
+ {
+ if (iJobQueue[i].iLocalUid == aLocalUid)
+ {
+ // Older version found
+ iJobQueue[i].iLocalUid = aLocalUid;
+ iJobQueue[i].iActionType = aActionType;
+ OstTraceFunctionExit0( CCALENDARPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT );
+ return;
+ }
+ }
+ // older not found, append
+ entry.iActionType = aActionType;
+ entry.iLocalUid = aLocalUid;
+ iJobQueue.AppendL(entry);
+ OstTraceFunctionExit0( DUP1_CCALENDARPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT );
+ }
+// -----------------------------------------------------------------------------
+// CCalendarPlugin::IndexQueuedItems()
+// -----------------------------------------------------------------------------
+//
+void CCalendarPlugin::IndexQueuedItems()
+ {
+ OstTraceFunctionEntry0( CCALENDARPLUGIN_INDEXQUEUEDITEMS_ENTRY );
+ while (iJobQueue.Count()>0)
+ {
+ TRecord entry = iJobQueue[0];
+ //Let the indexer handle this object TRAP it as it can leave
+ TRAPD(err,CreateEntryL( entry.iLocalUid, entry.iActionType ));
+ if(KErrNone == err)
+ {
+ iJobQueue.Remove(0);
+ }
+ }
+ OstTraceFunctionExit0( CCALENDARPLUGIN_INDEXQUEUEDITEMS_EXIT );
+ }
// ---------------------------------------------------------------------------
// CCalendarPlugin::UpdatePerformaceDataL
// ---------------------------------------------------------------------------
--- a/harvesterplugins/calendar/traces/OstTraceDefinitions.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/calendar/traces/OstTraceDefinitions.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+/*
+* This is Default Licence added by TraceCompiler
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
#ifndef __OSTTRACEDEFINITIONS_H__
#define __OSTTRACEDEFINITIONS_H__
// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
--- a/harvesterplugins/calendar/traces/ccalendarpluginTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/calendar/traces/ccalendarpluginTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.2.3
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+ *
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CCALENDARPLUGINTRACES_H__
@@ -17,6 +33,63 @@
#define DUP2_CCALENDARPLUGIN_CREATEENTRYL 0x860009
#define DUP8_CCALENDARPLUGIN_CREATEENTRYL 0x86000f
#define DUP9_CCALENDARPLUGIN_CREATEENTRYL 0x860010
+#define CCALENDARPLUGIN_ADDTOFIELDEXCERPTL 0x860011
+#define DUP3_CCALENDARPLUGIN_CREATEENTRYL 0x860012
+#define CCALENDARPLUGIN_ADDTOFIELDEXCERPTL_ENTRY 0x8a0001
+#define CCALENDARPLUGIN_ADDTOFIELDEXCERPTL_EXIT 0x8a0002
+#define CCALENDARPLUGIN_PAUSEPLUGINL_ENTRY 0x8a0003
+#define CCALENDARPLUGIN_PAUSEPLUGINL_EXIT 0x8a0004
+#define CCALENDARPLUGIN_RESUMEPLUGINL_ENTRY 0x8a0005
+#define CCALENDARPLUGIN_RESUMEPLUGINL_EXIT 0x8a0006
+#define CCALENDARPLUGIN_OVERWRITEORADDTOQUEUEL_ENTRY 0x8a0007
+#define CCALENDARPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT 0x8a0008
+#define DUP1_CCALENDARPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT 0x8a0009
+#define CCALENDARPLUGIN_INDEXQUEUEDITEMS_ENTRY 0x8a000a
+#define CCALENDARPLUGIN_INDEXQUEUEDITEMS_EXIT 0x8a000b
+
+
+#ifndef __KERNEL_MODE__
+#ifndef __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+#define __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+
+inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC16& aParam1 )
+ {
+ TBool retval;
+ TInt size = aParam1.Size();
+ // BTrace assumes that parameter size is atleast 4 bytes
+ if (size % 4 == 0)
+ {
+ TUint8* ptr = ( TUint8* )aParam1.Ptr();
+ // Data is written directly and length is determined from trace message length
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size );
+ }
+ else
+ {
+ TUint8 data[ KOstMaxDataLength ];
+ TUint8* ptr = data;
+ if (size > KOstMaxDataLength)
+ {
+ size = KOstMaxDataLength;
+ }
+ TInt sizeAligned = ( size + 3 ) & ~3;
+ memcpy( ptr, aParam1.Ptr(), size );
+ ptr += size;
+ // Fillers are written to get 32-bit alignment
+ while ( size++ < sizeAligned )
+ {
+ *ptr++ = 0;
+ }
+ ptr -= sizeAligned;
+ size = sizeAligned;
+ // Data is written directly and length is determined from trace message length
+ retval = OstSendNBytes( EXTRACT_GROUP_ID(aTraceID), EOstTrace, KOstTraceComponentID, aTraceID, ptr, size );
+ }
+ return retval;
+ }
+
+#endif // __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+
+#endif
#endif
--- a/harvesterplugins/calendar/traces/fixed_id.definitions Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/calendar/traces/fixed_id.definitions Tue Oct 05 13:32:14 2010 +0530
@@ -1,5 +1,35 @@
+##
+# This is Default Licence added by TraceCompiler
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+##
#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FLOW=0x8a
[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FLOW[0x8A]_CCALENDARPLUGIN_ADDTOFIELDEXCERPTL_ENTRY=0x1
+[TRACE]TRACE_FLOW[0x8A]_CCALENDARPLUGIN_ADDTOFIELDEXCERPTL_EXIT=0x2
+[TRACE]TRACE_FLOW[0x8A]_CCALENDARPLUGIN_INDEXQUEUEDITEMS_ENTRY=0xa
+[TRACE]TRACE_FLOW[0x8A]_CCALENDARPLUGIN_INDEXQUEUEDITEMS_EXIT=0xb
+[TRACE]TRACE_FLOW[0x8A]_CCALENDARPLUGIN_OVERWRITEORADDTOQUEUEL_ENTRY=0x7
+[TRACE]TRACE_FLOW[0x8A]_CCALENDARPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT=0x8
+[TRACE]TRACE_FLOW[0x8A]_CCALENDARPLUGIN_PAUSEPLUGINL_ENTRY=0x3
+[TRACE]TRACE_FLOW[0x8A]_CCALENDARPLUGIN_PAUSEPLUGINL_EXIT=0x4
+[TRACE]TRACE_FLOW[0x8A]_CCALENDARPLUGIN_RESUMEPLUGINL_ENTRY=0x5
+[TRACE]TRACE_FLOW[0x8A]_CCALENDARPLUGIN_RESUMEPLUGINL_EXIT=0x6
+[TRACE]TRACE_FLOW[0x8A]_DUP1_CCALENDARPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT=0x9
+[TRACE]TRACE_NORMAL[0x86]_CCALENDARPLUGIN_ADDTOFIELDEXCERPTL=0x11
[TRACE]TRACE_NORMAL[0x86]_CCALENDARPLUGIN_CALCHANGENOTIFICATION=0x2
[TRACE]TRACE_NORMAL[0x86]_CCALENDARPLUGIN_CREATEENTRYL=0x7
[TRACE]TRACE_NORMAL[0x86]_CCALENDARPLUGIN_DELAYEDCALLBACKL=0x1
@@ -8,6 +38,7 @@
[TRACE]TRACE_NORMAL[0x86]_DUP1_CCALENDARPLUGIN_HANDLECHANGEDENTRYL=0x4
[TRACE]TRACE_NORMAL[0x86]_DUP2_CCALENDARPLUGIN_CREATEENTRYL=0x9
[TRACE]TRACE_NORMAL[0x86]_DUP2_CCALENDARPLUGIN_HANDLECHANGEDENTRYL=0x5
+[TRACE]TRACE_NORMAL[0x86]_DUP3_CCALENDARPLUGIN_CREATEENTRYL=0x12
[TRACE]TRACE_NORMAL[0x86]_DUP3_CCALENDARPLUGIN_HANDLECHANGEDENTRYL=0x6
[TRACE]TRACE_NORMAL[0x86]_DUP8_CCALENDARPLUGIN_CREATEENTRYL=0xf
[TRACE]TRACE_NORMAL[0x86]_DUP9_CCALENDARPLUGIN_CREATEENTRYL=0x10
--- a/harvesterplugins/contacts/data/2001f702.rss Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/contacts/data/2001f702.rss Tue Oct 05 13:32:14 2010 +0530
@@ -37,9 +37,9 @@
{
implementation_uid = 0x2001F702;
version_no = 1;
- display_name = "Contacts";
- default_data = "Contacts";
- opaque_data = "";
+ display_name = "Contact";
+ default_data = "Contact";
+ opaque_data = "z:\\resource\\qt\\plugins\\searchsrv\\contentconfig\\contactconfig.xml";
}
};
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvesterplugins/contacts/data/contactconfig.xml Tue Oct 05 13:32:14 2010 +0530
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<category>
+ <name>Contact</name>
+ <mime>application/contact</mime>
+ <licon>qtg_large_phonebook</licon>
+ <baseapp>root contact</baseapp>
+ <lname>txt_search_list_contatcs</lname>
+ <displayorder>1</displayorder>
+ <exceptionstring>txt_phob_dblist_unnamed</exceptionstring>
+ <tsfile>Z:/resource/qt/translations/contacts_</tsfile>
+ <actionuri>
+ <uri>
+ <uristring></uristring>
+ <lname></lname>
+ <licon></licon>
+ <uriref></uriref>
+ <action></action><!-- primary action or default action. alternatively, we could always use first entry as this one -->
+ </uri>
+ </actionuri>
+ <fieldmap>
+ <resulthit>
+ <field>FAMILYNAME</field>
+ <auri></auri><!-- alternatively <auriorder>1,2,3,4</auriorder> instead of four lines -->
+ </resulthit>
+ </fieldmap>
+ <indexcontentsize>L</indexcontentsize> <!-- possible values S, M, L, XL, XXL. or scale of 1 to 10. -->
+ <policy>
+ <capability>WriteDeviceData<!-- Allow search on my data from clients with only Write Device Data capability it is combination of SID/VID/capability --></capability>
+ </policy>
+ <resultfirstline>
+ <list>
+ <field>FAMILYNAME</field><!-- commo seperated list, if there is a chance that certain field could be empty -->
+ <field>GIVENNAME</field>
+ </list>
+ </resultfirstline>
+ <relevancy>
+ <boost>
+ <field>FAMILYNAME</field>
+ <boostvalue>10</boostvalue><!-- on scale 1-10 -->
+ </boost>
+ <boost>
+ <field>COMPANY</field>
+ <boostvalue>5</boostvalue>
+ </boost>
+ <boost>
+ <field>EMAIL</field>
+ <boostvalue>7</boostvalue>
+ </boost>
+ </relevancy>
+</category>
--- a/harvesterplugins/contacts/group/bld.inf Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/contacts/group/bld.inf Tue Oct 05 13:32:14 2010 +0530
@@ -19,3 +19,5 @@
PRJ_MMPFILES
contactsplugin.mmp
+PRJ_EXPORTS
+../data/contactconfig.xml /epoc32/data/z/resource/qt/plugins/searchsrv/contentconfig/contactconfig.xml
--- a/harvesterplugins/contacts/inc/ccontactsplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/contacts/inc/ccontactsplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -75,6 +75,18 @@
class CContactsPlugin : public CIndexingPlugin, public MContactDbObserver, public MDelayedCallbackObserver
{
+private:
+ enum THarvesterState
+ {
+ EHarvesterIdleState,
+ EHarvesterStartHarvest
+ };
+
+ struct TRecord
+ {
+ TInt iContactId;
+ TCPixActionType iActionType;
+ };
public:
static CContactsPlugin* NewL();
static CContactsPlugin* NewLC();
@@ -85,7 +97,8 @@
*/
void StartPluginL();
void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
-
+ void PausePluginL();
+ void ResumePluginL();
/**
* From MContactDbObserver, HandleDatabaseEventL.
*/
@@ -119,13 +132,17 @@
* Helper function: adds information field to the document and to the excerpt field(if available)
*/
void AddFieldToDocumentAndExcerptL(CSearchDocument& aDocument, CContactItemFieldSet& aFieldSet, TUid aFieldId, const TDesC& aFieldName, const TInt aConfig = CDocumentField::EStoreYes | CDocumentField::EIndexTokenized );
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
void AddFieldToHLExcerptL( CContactItemFieldSet& aFieldSet, TUid aFieldId);
-#endif
+//#endif
/**
* Creates the actual contact book index item
*/
void CreateContactIndexItemL(TInt aContentId, TCPixActionType aActionType);
+
+ void OverWriteOrAddToQueueL(TRecord& aEntry);
+
+ void IndexQueuedItems();
private:
@@ -141,12 +158,17 @@
TInt iCurrentIndex;
/** placeholder for Excerpt text dynamic creation */
HBufC* iExcerpt;
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
HBufC* iHLDisplayExcerpt;
-#endif
+//#endif
// CPix database
CCPixIndexer* iIndexer;
-
+ //State of harvester either to pause/resume
+ TBool iIndexState;
+ // Queue of documents to be indexed
+ RArray<TRecord> iJobQueue;
+ //harvesting state
+ THarvesterState iHarvestState;
//for helping with testing.
#ifdef HARVESTERPLUGINTESTER_FRIEND
friend class CHarvesterPluginTester;
--- a/harvesterplugins/contacts/src/ccontactsplugin.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/contacts/src/ccontactsplugin.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -87,13 +87,15 @@
//delete NULL is safe - so no need to test nullity of iExceprt (which routinely
//keeps getting deleted in the plugin).
delete iExcerpt;
-#ifdef USE_HIGHLIGHTER
+ iJobQueue.Reset();
+ iJobQueue.Close();
+//#ifdef USE_HIGHLIGHTER
if(iHLDisplayExcerpt)
{
delete iHLDisplayExcerpt;
iHLDisplayExcerpt = NULL;
}
-#endif
+//#endif
}
// -----------------------------------------------------------------------------
@@ -103,7 +105,7 @@
void CContactsPlugin::ConstructL()
{
iDatabase = CContactDatabase::OpenL();
-
+ iIndexState = ETrue;
// This pointer is valid until a change is made to the database or until
// the database's active object is allowed to run. If the array is
// required after one of the above two events has occurred, a copy of the
@@ -118,7 +120,7 @@
// -----------------------------------------------------------------------------
//
void CContactsPlugin::StartPluginL()
- {
+ {
// Define this base application class, use default location
User::LeaveIfError(iSearchSession.DefineVolume( _L(CONTACT_QBASEAPPCLASS), KNullDesC ));
@@ -140,7 +142,8 @@
void CContactsPlugin::StartHarvestingL(const TDesC& /*aQualifiedBaseAppClass*/)
{
iIndexer->ResetL();
- iCurrentIndex = 0;
+ iCurrentIndex = 0;
+ iHarvestState = EHarvesterStartHarvest;
#ifdef __PERFORMANCE_DATA
iStartTime.UniversalTime();
#endif
@@ -153,6 +156,8 @@
//
void CContactsPlugin::HandleDatabaseEventL(TContactDbObserverEvent aEvent)
{
+ TRecord entry;
+ entry.iContactId = aEvent.iContactId;
switch( aEvent.iType )
{
case EContactDbObserverEventContactChanged:
@@ -165,7 +170,8 @@
CreateContactIndexItemL(aEvent.iContactId, ECPixUpdateAction);
UpdatePerformaceDataL(ECPixUpdateAction);
#else
- CreateContactIndexItemL(aEvent.iContactId, ECPixUpdateAction);
+ entry.iActionType = ECPixUpdateAction;
+ //CreateContactIndexItemL(aEvent.iContactId, ECPixUpdateAction);
#endif
break;
@@ -179,7 +185,8 @@
CreateContactIndexItemL(aEvent.iContactId, ECPixRemoveAction);
UpdatePerformaceDataL(ECPixRemoveAction);
#else
- CreateContactIndexItemL(aEvent.iContactId, ECPixRemoveAction);
+ entry.iActionType = ECPixRemoveAction;
+ //CreateContactIndexItemL(aEvent.iContactId, ECPixRemoveAction);
#endif
break;
@@ -192,7 +199,8 @@
CreateContactIndexItemL(aEvent.iContactId, ECPixUpdateAction);
UpdatePerformaceDataL(ECPixUpdateAction);
#else
- CreateContactIndexItemL(aEvent.iContactId, ECPixAddAction);
+ entry.iActionType = ECPixAddAction;
+ //CreateContactIndexItemL(aEvent.iContactId, ECPixAddAction);
#endif
break;
@@ -200,6 +208,10 @@
// Ignore other events
break;
}
+ if( iIndexState )
+ CreateContactIndexItemL(aEvent.iContactId, entry.iActionType);
+ else
+ OverWriteOrAddToQueueL(entry);
}
// -----------------------------------------------------------------------------
@@ -210,44 +222,50 @@
{
if (!iContacts || !iObserver)
return;
-
- // may have changed - refresh the pointer
- iContacts = iDatabase->SortedItemsL();
+
+ if(!iIndexState)
+ return;
+
+ // may have changed - refresh the pointer
+ iContacts = iDatabase->SortedItemsL();
- // Read the next set of contacts.
- for( TInt i = 0; i < KContactsPerRunL; i++ )
- {
- // Exit the loop if no more contacts
- if (iCurrentIndex >= iContacts->Count())
- break;
-
- // Create index item
- OstTrace1( TRACE_NORMAL, CCONTACTSPLUGIN_DELAYEDCALLBACKL, "CContactsPlugin::DelayedCallbackL();Harvesting id=%d", (*iContacts)[iCurrentIndex] );
- CPIXLOGSTRING2("CContactsPlugin::DelayedCallbackL(): Harvesting id=%d.", (*iContacts)[iCurrentIndex]);
- CreateContactIndexItemL((*iContacts)[iCurrentIndex], ECPixAddAction);
- iCurrentIndex++;
- }
+ // Read the next set of contacts.
+ for( TInt i = 0; i < KContactsPerRunL; i++ )
+ {
+ // Exit the loop if no more contacts
+ if (iCurrentIndex >= iContacts->Count())
+ break;
+
+ // Create index item
+ OstTrace1( TRACE_NORMAL, CCONTACTSPLUGIN_DELAYEDCALLBACKL, "CContactsPlugin::DelayedCallbackL();Harvesting id=%d", (*iContacts)[iCurrentIndex] );
+ CPIXLOGSTRING2("CContactsPlugin::DelayedCallbackL(): Harvesting id=%d.", (*iContacts)[iCurrentIndex]);
+ CreateContactIndexItemL((*iContacts)[iCurrentIndex], ECPixAddAction);
+ iCurrentIndex++;
+ }
- if( iAsynchronizer && (iCurrentIndex < iContacts->Count()) )
- {
- // Launch the next RunL
+ if( iAsynchronizer && (iCurrentIndex < iContacts->Count()) )
+ {
+ // Launch the next RunL
iAsynchronizer->Start(0, this, KHarvestingDelay);
}
- else
- {
- // Harvesting was successfully completed
- Flush(*iIndexer);
+ else
+ {
+ // Harvesting was successfully completed
+ Flush(*iIndexer);
#ifdef __PERFORMANCE_DATA
UpdatePerformaceDataL();
#endif
- iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), KErrNone);
- }
+ //On Harvesting completion mark status as Idle
+ iHarvestState = EHarvesterIdleState;
+ iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), KErrNone);
+ }
}
void CContactsPlugin::DelayedError(TInt aError)
{
// Harvesting was successfully completed
Flush(*iIndexer);
+ iHarvestState = EHarvesterIdleState;
iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), aError);
}
@@ -316,8 +334,7 @@
TInt findpos = aFieldSet.Find( aFieldId );
if (! (findpos < 0) || (findpos >= aFieldSet.Count() ) )
{
- CContactItemField& additionalField = aFieldSet[ findpos ];
- TInt newfieldsize = 0;
+ CContactItemField& additionalField = aFieldSet[ findpos ];
if( additionalField.StorageType() == KStorageTypeDateTime)
{
CContactDateField* fieldDate = additionalField.DateTimeStorage();
@@ -377,6 +394,7 @@
OstTrace1( TRACE_NORMAL, CCONTACTSPLUGIN_CREATECONTACTINDEXITEML, "CContactsPlugin::CreateContactIndexItemL();aContentId=%d", aContentId );
CPIXLOGSTRING2("CContactsPlugin::CreateContactIndexItemL(): aContentId = %d ", aContentId );
+ OstTrace0( TRACE_NORMAL, DUP8_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML, "CContactsPlugin::Indexing Contact" );
// creating CSearchDocument object with unique ID for this application
TBuf<20> docid_str;
@@ -398,11 +416,11 @@
index_item->AddFieldL( KContactsGivenNameField, static_cast<CContactGroup*>( contact )->GetGroupLabelL(), CDocumentField::EStoreYes | CDocumentField::EIndexTokenized );
OstTraceExt1( TRACE_NORMAL, DUP1_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML, ";Adding Contact Group=%S", ( static_cast<CContactGroup*>( contact )->GetGroupLabelL() ) );
CPIXLOGSTRING2("Adding Contact Group %S", &( static_cast<CContactGroup*>( contact )->GetGroupLabelL() ) );
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
index_item->AddHLDisplayFieldL(static_cast<CContactGroup*>( contact )->GetGroupLabelL());
-#else
- index_item->AddExcerptL( static_cast<CContactGroup*>( contact )->GetGroupLabelL() );
-#endif
+//#else
+// index_item->AddExcerptL( static_cast<CContactGroup*>( contact )->GetGroupLabelL() );
+//#endif
}
else//If the contact item is a regular contact.
{
@@ -425,7 +443,7 @@
AddFieldL( *index_item, fieldSet, KUidContactFieldGivenName, KContactsGivenNameField, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText );
AddFieldL( *index_item, fieldSet, KUidContactFieldFamilyName, KContactsFamilyNameField, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField:: EIndexFreeText );
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
if(iHLDisplayExcerpt)
{
delete iHLDisplayExcerpt;
@@ -435,7 +453,7 @@
AddFieldToHLExcerptL( fieldSet, KUidContactFieldFamilyName);
if(iHLDisplayExcerpt)
index_item->AddHLDisplayFieldL(*iHLDisplayExcerpt);
-#endif
+//#endif
AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldPhoneNumber, KContactsPhoneNumberField, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexPhoneNumber );
AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldEMail, KContactsEMailField, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText );
AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldSIPID, KContactsSIPIDField );
@@ -470,13 +488,13 @@
AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldIMAddress, KContactIMAddress);
AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldServiceProvider, KContactServiceProvider);
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldBirthday, KContactBirthday);
AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldAnniversary, KContactAnniversary);
-#else
- AddFieldL( *index_item, fieldSet, KUidContactFieldBirthday, KContactBirthday);
- AddFieldL( *index_item, fieldSet, KUidContactFieldAnniversary, KContactAnniversary);
-#endif
+//#else
+// AddFieldL( *index_item, fieldSet, KUidContactFieldBirthday, KContactBirthday);
+// AddFieldL( *index_item, fieldSet, KUidContactFieldAnniversary, KContactAnniversary);
+//#endif
index_item->AddExcerptL(*iExcerpt);
}
@@ -532,7 +550,7 @@
}
}
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
void CContactsPlugin::AddFieldToHLExcerptL( CContactItemFieldSet& aFieldSet, TUid aFieldId)
{
if(!iHLDisplayExcerpt)
@@ -545,8 +563,7 @@
if (! (findpos < 0) || (findpos >= aFieldSet.Count() ) )
{
CContactItemField& additionalField = aFieldSet[findpos];
- CContactTextField* fieldText = additionalField.TextStorage();
-
+ CContactTextField* fieldText = additionalField.TextStorage();
if (fieldText && fieldText->Text() != KNullDesC)//value is not Null
{
@@ -563,7 +580,7 @@
}
}
-#endif
+//#endif
// ---------------------------------------------------------------------------
// CContactsPlugin::GetDateL
@@ -590,6 +607,64 @@
}
}
+void CContactsPlugin::PausePluginL()
+ {
+ OstTraceFunctionEntry0( CCONTACTSPLUGIN_PAUSEPLUGINL_ENTRY );
+ iIndexState = EFalse;
+ OstTraceFunctionExit0( CCONTACTSPLUGIN_PAUSEPLUGINL_EXIT );
+ }
+
+void CContactsPlugin::ResumePluginL()
+ {
+ OstTraceFunctionEntry0( CCONTACTSPLUGIN_RESUMEPLUGINL_ENTRY );
+ iIndexState = ETrue;
+
+ if(iHarvestState == EHarvesterStartHarvest)
+ {
+ if(iAsynchronizer->CallbackPending())
+ iAsynchronizer->CancelCallback();
+ iAsynchronizer->Start( 0, this, KHarvestingDelay );
+ }
+ else
+ {
+ IndexQueuedItems();
+ }
+ OstTraceFunctionExit0( CCONTACTSPLUGIN_RESUMEPLUGINL_EXIT );
+ }
+
+void CContactsPlugin::OverWriteOrAddToQueueL(TRecord& aEntry)
+ {
+ OstTraceFunctionEntry0( CCONTACTSPLUGIN_OVERWRITEORADDTOQUEUEL_ENTRY );
+ for (TInt i=0; i<iJobQueue.Count(); i++)
+ {
+ if (iJobQueue[i].iContactId == aEntry.iContactId)
+ {
+ // Older version found
+ iJobQueue[i] = aEntry;
+ OstTraceFunctionExit0( CCONTACTSPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT );
+ return;
+ }
+ }
+ // older not found, append
+ iJobQueue.AppendL(aEntry);
+ OstTraceFunctionExit0( DUP1_CCONTACTSPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT );
+ }
+
+void CContactsPlugin::IndexQueuedItems()
+ {
+ OstTraceFunctionEntry0( CCONTACTSPLUGIN_INDEXQUEUEDITEMS_ENTRY );
+ while (iJobQueue.Count()>0)
+ {
+ TRecord entry = iJobQueue[0];
+ //Let the indexer handle this object TRAP it as it can leave
+ TRAPD(err,CreateContactIndexItemL( entry.iContactId, entry.iActionType ));
+ if(KErrNone == err)
+ {
+ iJobQueue.Remove(0);
+ }
+ }
+ OstTraceFunctionExit0( CCONTACTSPLUGIN_INDEXQUEUEDITEMS_EXIT );
+ }
// ---------------------------------------------------------------------------
// CContactsPlugin::UpdatePerformaceDataL
// ---------------------------------------------------------------------------
--- a/harvesterplugins/contacts/traces/OstTraceDefinitions.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/contacts/traces/OstTraceDefinitions.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+/*
+* This is Default Licence added by TraceCompiler
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
#ifndef __OSTTRACEDEFINITIONS_H__
#define __OSTTRACEDEFINITIONS_H__
// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
--- a/harvesterplugins/contacts/traces/ccontactspluginTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/contacts/traces/ccontactspluginTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+ *
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CCONTACTSPLUGINTRACES_H__
@@ -18,9 +34,22 @@
#define DUP5_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML 0x86000a
#define DUP6_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML 0x86000b
#define DUP7_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML 0x86000c
+#define DUP8_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML 0x86000d
+#define CCONTACTSPLUGIN_PAUSEPLUGINL_ENTRY 0x8a0001
+#define CCONTACTSPLUGIN_PAUSEPLUGINL_EXIT 0x8a0002
+#define CCONTACTSPLUGIN_RESUMEPLUGINL_ENTRY 0x8a0003
+#define CCONTACTSPLUGIN_RESUMEPLUGINL_EXIT 0x8a0004
+#define CCONTACTSPLUGIN_OVERWRITEORADDTOQUEUEL_ENTRY 0x8a0005
+#define CCONTACTSPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT 0x8a0006
+#define DUP1_CCONTACTSPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT 0x8a0007
+#define CCONTACTSPLUGIN_INDEXQUEUEDITEMS_ENTRY 0x8a0008
+#define CCONTACTSPLUGIN_INDEXQUEUEDITEMS_EXIT 0x8a0009
#ifndef __KERNEL_MODE__
+#ifndef __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+#define __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+
inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC16& aParam1 )
{
TBool retval;
@@ -55,6 +84,9 @@
}
return retval;
}
+
+#endif // __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+
#endif
--- a/harvesterplugins/contacts/traces/fixed_id.definitions Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/contacts/traces/fixed_id.definitions Tue Oct 05 13:32:14 2010 +0530
@@ -1,5 +1,32 @@
+##
+# This is Default Licence added by TraceCompiler
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+##
#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_FLOW=0x8a
[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FLOW[0x8A]_CCONTACTSPLUGIN_INDEXQUEUEDITEMS_ENTRY=0x8
+[TRACE]TRACE_FLOW[0x8A]_CCONTACTSPLUGIN_INDEXQUEUEDITEMS_EXIT=0x9
+[TRACE]TRACE_FLOW[0x8A]_CCONTACTSPLUGIN_OVERWRITEORADDTOQUEUEL_ENTRY=0x5
+[TRACE]TRACE_FLOW[0x8A]_CCONTACTSPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT=0x6
+[TRACE]TRACE_FLOW[0x8A]_CCONTACTSPLUGIN_PAUSEPLUGINL_ENTRY=0x1
+[TRACE]TRACE_FLOW[0x8A]_CCONTACTSPLUGIN_PAUSEPLUGINL_EXIT=0x2
+[TRACE]TRACE_FLOW[0x8A]_CCONTACTSPLUGIN_RESUMEPLUGINL_ENTRY=0x3
+[TRACE]TRACE_FLOW[0x8A]_CCONTACTSPLUGIN_RESUMEPLUGINL_EXIT=0x4
+[TRACE]TRACE_FLOW[0x8A]_DUP1_CCONTACTSPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT=0x7
[TRACE]TRACE_NORMAL[0x86]_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML=0x5
[TRACE]TRACE_NORMAL[0x86]_CCONTACTSPLUGIN_DELAYEDCALLBACKL=0x4
[TRACE]TRACE_NORMAL[0x86]_CCONTACTSPLUGIN_HANDLEDATABASEEVENTL=0x2
@@ -12,3 +39,4 @@
[TRACE]TRACE_NORMAL[0x86]_DUP5_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML=0xa
[TRACE]TRACE_NORMAL[0x86]_DUP6_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML=0xb
[TRACE]TRACE_NORMAL[0x86]_DUP7_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML=0xc
+[TRACE]TRACE_NORMAL[0x86]_DUP8_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML=0xd
--- a/harvesterplugins/file/data/2001f703.rss Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/data/2001f703.rss Tue Oct 05 13:32:14 2010 +0530
@@ -39,7 +39,7 @@
version_no = 1;
display_name = "Files";
default_data = "File";
- opaque_data = "";
+ opaque_data = "z:\\resource\\qt\\plugins\\searchsrv\\contentconfig\\filesconfig.xml";
}
};
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvesterplugins/file/data/filesconfig.xml Tue Oct 05 13:32:14 2010 +0530
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<category>
+ <name>Files</name>
+ <mime>type/file</mime>
+ <licon></licon>
+ <baseapp>root file</baseapp>
+ <lname>txt_search_list_all_other_files</lname>
+ <displayorder>7</displayorder>
+ <exceptionstring></exceptionstring>
+ <tsfile></tsfile>
+ <actionuri>
+ <uri>
+ <uristring></uristring>
+ <lname></lname>
+ <licon></licon>
+ <uriref></uriref>
+ <action></action><!-- primary action or default action. alternatively, we could always use first entry as this one -->
+ </uri>
+ </actionuri>
+ <fieldmap>
+ <resulthit>
+ <field></field>
+ <auri></auri><!-- alternatively <auriorder>1,2,3,4</auriorder> instead of four lines -->
+ </resulthit>
+ </fieldmap>
+ <indexcontentsize>L</indexcontentsize> <!-- possible values S, M, L, XL, XXL. or scale of 1 to 10. -->
+ <policy>
+ <capability>WriteDeviceData<!-- Allow search on my data from clients with only Write Device Data capability it is combination of SID/VID/capability --></capability>
+ </policy>
+ <resultfirstline>
+ <list>
+ <field>Name</field><!-- commo seperated list, if there is a chance that certain field could be empty -->
+ </list>
+ </resultfirstline>
+ <relevancy>
+ <boost>
+ <field>Name</field>
+ <boostvalue>10</boostvalue><!-- on scale 1-10 -->
+ </boost>
+ <boost>
+ <field>Extension</field>
+ <boostvalue>5</boostvalue>
+ </boost>
+ </relevancy>
+</category>
--- a/harvesterplugins/file/fastfindfileserverplugin/traces/OstTraceDefinitions.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/fastfindfileserverplugin/traces/OstTraceDefinitions.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+/*
+* This is Default Licence added by TraceCompiler
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
#ifndef __OSTTRACEDEFINITIONS_H__
#define __OSTTRACEDEFINITIONS_H__
// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
--- a/harvesterplugins/file/fastfindfileserverplugin/traces/fastfindfileserverpluginTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/fastfindfileserverplugin/traces/fastfindfileserverpluginTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Monitors file creations, modifications and deletions.
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __FASTFINDFILESERVERPLUGINTRACES_H__
@@ -122,6 +138,9 @@
#ifndef __KERNEL_MODE__
+#ifndef __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+#define __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+
inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC16& aParam1 )
{
TBool retval;
@@ -156,6 +175,9 @@
}
return retval;
}
+
+#endif // __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+
#endif
--- a/harvesterplugins/file/fastfindfileserverplugin/traces/fixed_id.definitions Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/fastfindfileserverplugin/traces/fixed_id.definitions Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+##
+# This is Default Licence added by TraceCompiler
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+##
#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
[GROUP]TRACE_FLOW=0x8a
[GROUP]TRACE_NORMAL=0x86
--- a/harvesterplugins/file/group/bld.inf Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/group/bld.inf Tue Oct 05 13:32:14 2010 +0530
@@ -21,3 +21,5 @@
PRJ_MMPFILES
fileplugin.mmp
+PRJ_EXPORTS
+../data/filesconfig.xml /epoc32/data/z/resource/qt/plugins/searchsrv/contentconfig/filesconfig.xml
--- a/harvesterplugins/file/inc/cfileharvester.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/inc/cfileharvester.h Tue Oct 05 13:32:14 2010 +0530
@@ -35,9 +35,8 @@
{
EHarvesterIdleState,
EHarvesterStartHarvest,
- EHarvesterGetFileId
+ EHarvesterGetFileId
};
-
/**
* Construction
* @return Harvester image plugin
@@ -66,6 +65,10 @@
* @param aDriveNumber drive to remove the paths from
*/
void RemoveIgnorePaths( const TDriveNumber aDriveNumber );
+ /**
+ * On Resume plugin, continue with file harvesting
+ */
+ void ResumeRequest();
private: //From CActive
--- a/harvesterplugins/file/inc/cfileplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/inc/cfileplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -44,7 +44,15 @@
class CFilePlugin : public CIndexingPlugin
{
-public:
+public:
+
+ struct TRecord
+ {
+ TFileName iUri;
+ TCPixActionType iActionType;
+ TBool isFolder;
+ };
+
static CFilePlugin* NewL();
static CFilePlugin* NewLC();
virtual ~CFilePlugin();
@@ -54,7 +62,8 @@
*/
void StartPluginL();
void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
-
+ void PausePluginL();
+ void ResumePluginL();
/**
* CreateContentIndexItemL sends a file for indexing contents
* @aFilename full path and filename of the file to be indexed
@@ -67,6 +76,11 @@
* @aActionType action to be taken on the file
*/
void CreateFolderFileIndexItemL(const TDesC& aFilename, TCPixActionType aActionType, TBool aIsDir = ETrue);
+ /**
+ * Get the current file plugin harvesting state
+ * ETrue on pause, EFalse on resume
+ */
+ TBool GetHarvesterState();
private:
/**
* CreateCpixDocumentL creates a document file
@@ -79,6 +93,12 @@
* @aExt file extention
*/
TBool IsFileTypeMedia(const TDesC& aExt);
+
+ /**
+ * RemoveFileDatabaseL deletes the database file from the requested drive
+ * @aDrive drive number
+ */
+ void RemoveFileDatabaseL(TDriveNumber aDrive);
public:
//
@@ -132,6 +152,12 @@
* returns pointer to the IndexDb path.
*/
HBufC* DatabasePathLC(TDriveNumber aMedia,const TDesC& aPath);
+
+ void MountAvailableDrivesInQueue();
+
+ void AddToQueueL(const TDesC& aFilename, TCPixActionType aActionType, TBool aIsFolder);
+
+ void IndexQueuedItems();
protected:
CFilePlugin();
@@ -142,6 +168,10 @@
CCPixIndexer* iIndexer[EDriveZ+1]; // EDriveZ enum value is 25, so add 1.
CCPixIndexer* iFolderIndexer[EDriveZ+1];
+
+ RArray<TDriveNumber> iMountDrives;
+
+ RArray<TRecord> iJobQueue;
// File system session
RFs iFs;
@@ -154,7 +184,9 @@
CFileMonitor* iMonitor;
// MMC monitor
- CMMCMonitor* iMmcMonitor;
+ CMMCMonitor* iMmcMonitor;
+
+ TBool iIndexState;
//for unit testing.
#ifdef HARVESTERPLUGINTESTER_FRIEND
--- a/harvesterplugins/file/src/cfileharvester.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/src/cfileharvester.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -375,14 +375,26 @@
{
TParse fileParser;
fileParser.Set( iDirscan->FullPath(), &(*iDir)[iCurrentIndex].iName, NULL );
- if(aEntry.IsDir())
- {
- iFilePlugin.CreateFolderFileIndexItemL(fileParser.FullName(), ECPixAddAction);
+ if( iFilePlugin.GetHarvesterState() )
+ {
+ if(aEntry.IsDir())
+ {
+ iFilePlugin.CreateFolderFileIndexItemL(fileParser.FullName(), ECPixAddAction);
+ }
+ else
+ {
+ iFilePlugin.CreateContentIndexItemL(fileParser.FullName(), ECPixAddAction);
+ iFilePlugin.CreateFolderFileIndexItemL(fileParser.FullName(), ECPixAddAction, false);
+ }
}
else
{
- iFilePlugin.CreateContentIndexItemL(fileParser.FullName(), ECPixAddAction);
- iFilePlugin.CreateFolderFileIndexItemL(fileParser.FullName(), ECPixAddAction, false);
+ TBool isFolder = EFalse;
+ if(aEntry.IsDir())
+ {
+ isFolder = ETrue;
+ }
+ iFilePlugin.AddToQueueL(fileParser.FullName(), ECPixAddAction, isFolder);
}
// TODO: If this is not TRAPPED, state machine breaks
iStepNumber++;
@@ -484,14 +496,23 @@
{
OstTrace0( TRACE_NORMAL, CFILEHARVESTER_SETNEXTREQUEST, "CFileHarvester::SetNextRequest" );
CPIXLOGSTRING("CFileHarvester::SetNextRequest");
- if ( !IsActive() )
+ if ( !IsActive() && (iFilePlugin.GetHarvesterState()) )
{
iHarvestState = aState;
SetActive();
TRequestStatus* status = &iStatus;
User::RequestComplete( status, KErrNone );
}
+ else
+ iHarvestState = aState;
}
+void CFileHarvester::ResumeRequest()
+ {
+ OstTraceFunctionEntry0( CFILEHARVESTER_RESUMEREQUEST_ENTRY );
+ if(iHarvestState != EHarvesterIdleState)
+ SetNextRequest(iHarvestState);
+ OstTraceFunctionExit0( CFILEHARVESTER_RESUMEREQUEST_EXIT );
+ }
// End of File
--- a/harvesterplugins/file/src/cfilemonitor.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/src/cfilemonitor.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -137,9 +137,16 @@
CPIXLOGSTRING2("CFileMonitor::RunL, EFastFindFileCreated old = %S", &fileNameOld);
OstTraceExt1( TRACE_NORMAL, DUP2_CFILEMONITOR_RUNL, "CFileMonitor::RunL;EFastFindFileCreated new=%S", fileNameNew );
CPIXLOGSTRING2("CFileMonitor::RunL, EFastFindFileCreated new = %S", &fileNameNew);
- // File creation (for example over PC suite) gives fileNameOld as the created files, fileNameOld is empty.
- iFilePlugin.CreateContentIndexItemL(fileNameOld, ECPixAddAction);
- iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixAddAction, false);
+ // File creation (for example over PC suite) gives fileNameOld as the created files, fileNameOld is empty.
+ if(iFilePlugin.GetHarvesterState())
+ {
+ iFilePlugin.CreateContentIndexItemL(fileNameOld, ECPixAddAction);
+ iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixAddAction, EFalse);
+ }
+ else
+ {
+ iFilePlugin.AddToQueueL(fileNameOld, ECPixAddAction, EFalse);
+ }
}
break;
@@ -160,8 +167,15 @@
OstTraceExt1( TRACE_NORMAL, DUP5_CFILEMONITOR_RUNL, "CFileMonitor::RunL;EFastFindFileModified new=%S", fileNameNew );
CPIXLOGSTRING2("CFileMonitor::RunL, EFastFindFileModified new = %S", &fileNameNew);
// File copy, fileNameOld contains the file name, fileNameNew is empty
- iFilePlugin.CreateContentIndexItemL(fileNameOld, ECPixUpdateAction);
- iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixUpdateAction, false);
+ if(iFilePlugin.GetHarvesterState())
+ {
+ iFilePlugin.CreateContentIndexItemL(fileNameOld, ECPixUpdateAction);
+ iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixUpdateAction, EFalse);
+ }
+ else
+ {
+ iFilePlugin.AddToQueueL(fileNameOld, ECPixUpdateAction, EFalse);
+ }
}
break;
@@ -178,11 +192,21 @@
{
if (fileNameOld.Length()>0 && fileNameOld.Compare(fileNameNew)!=0)
{
- iFilePlugin.CreateContentIndexItemL(fileNameOld, ECPixRemoveAction);
- iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixRemoveAction, false);
+ if (iFilePlugin.GetHarvesterState())
+ {
+ iFilePlugin.CreateContentIndexItemL(fileNameOld, ECPixRemoveAction);
+ iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixRemoveAction, EFalse);
+ }
+ else
+ iFilePlugin.AddToQueueL(fileNameOld, ECPixRemoveAction, EFalse);
}
- iFilePlugin.CreateContentIndexItemL(fileNameNew, ECPixUpdateAction);
- iFilePlugin.CreateFolderFileIndexItemL(fileNameNew, ECPixUpdateAction, false);
+ if( iFilePlugin.GetHarvesterState())
+ {
+ iFilePlugin.CreateContentIndexItemL(fileNameNew, ECPixUpdateAction);
+ iFilePlugin.CreateFolderFileIndexItemL(fileNameNew, ECPixUpdateAction, EFalse);
+ }
+ else
+ iFilePlugin.AddToQueueL(fileNameNew, ECPixUpdateAction, EFalse);
}
else
{
@@ -201,11 +225,21 @@
// File rename (funnily), fileNameOld contains the old file name, fileNameNew the new name
if (fileNameOld.Length()>0 && fileNameOld.Compare(fileNameNew)!=0)
{
- iFilePlugin.CreateContentIndexItemL(fileNameOld, ECPixRemoveAction);
- iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixRemoveAction, false);
+ if( iFilePlugin.GetHarvesterState() )
+ {
+ iFilePlugin.CreateContentIndexItemL(fileNameOld, ECPixRemoveAction);
+ iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixRemoveAction, EFalse);
+ }
+ else
+ iFilePlugin.AddToQueueL(fileNameOld, ECPixRemoveAction, EFalse);
}
- iFilePlugin.CreateContentIndexItemL(fileNameNew, ECPixUpdateAction);
- iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixUpdateAction, false);
+ if( iFilePlugin.GetHarvesterState() )
+ {
+ iFilePlugin.CreateContentIndexItemL(fileNameNew, ECPixUpdateAction);
+ iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixUpdateAction, EFalse);
+ }
+ else
+ iFilePlugin.AddToQueueL(fileNameOld, ECPixUpdateAction, EFalse);
}
break;
@@ -216,20 +250,31 @@
OstTraceExt1( TRACE_NORMAL, DUP11_CFILEMONITOR_RUNL, "CFileMonitor::RunL;EFastFindFileDeleted new=%S", fileNameNew );
CPIXLOGSTRING2("CFileMonitor::RunL, EFastFindFileDeleted new = %S", &fileNameNew);
// File delete, fileNameOld contains the name of the deleted file
- iFilePlugin.CreateContentIndexItemL(fileNameOld, ECPixRemoveAction);
- iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixRemoveAction, false);
+ if( iFilePlugin.GetHarvesterState() )
+ {
+ iFilePlugin.CreateContentIndexItemL(fileNameOld, ECPixRemoveAction);
+ iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixRemoveAction, EFalse);
+ }
+ else
+ iFilePlugin.AddToQueueL(fileNameOld, ECPixRemoveAction, EFalse);
}
break;
case EFastFindDirCreated:
{
- iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixAddAction);
+ if (iFilePlugin.GetHarvesterState())
+ iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixAddAction);
+ else
+ iFilePlugin.AddToQueueL(fileNameOld, ECPixAddAction, ETrue);
}
break;
case EFastFindDirDeleted:
{
- iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixRemoveAction);
+ if(iFilePlugin.GetHarvesterState())
+ iFilePlugin.CreateFolderFileIndexItemL(fileNameOld, ECPixRemoveAction);
+ else
+ iFilePlugin.AddToQueueL(fileNameOld, ECPixRemoveAction, ETrue);
}
break;
default:
--- a/harvesterplugins/file/src/cfileplugin.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/src/cfileplugin.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -41,7 +41,9 @@
namespace {
_LIT(KCPixSearchServerPrivateDirectory, "\\Private\\2001f6f7\\");
+_LIT(KIndexingDBPath,"indexing\\indexdb");
_LIT(KPathIndexDbPath, CPIX_INDEVICE_INDEXDB);
+_LIT(KfileDBPath, "\\root\\file");
_LIT(KPathFolder, "\\root\\file\\folder");
_LIT(KPathFileContent, "\\root\\file\\content");
_LIT(KFileBaseAppClassContent, "root file content");
@@ -109,6 +111,7 @@
TBool CFilePlugin::IsFileTypeMedia(const TDesC& aExt)
{
+ OstTraceFunctionEntry0( CFILEPLUGIN_ISFILETYPEMEDIA_ENTRY );
const TText* KMediaExt[] = {_S("txt"),_S("pdf"), _S("jpg"),_S("mp3"), _S("jpeg"), _S("wma"), _S("3gp"), _S("mpg4"),
_S("avi"), _S("jpf"), _S("mbm"), _S("png"), _S("gif"), _S("bmp"), _S("mp4"), _S("mpeg4"),
@@ -131,6 +134,7 @@
break;
}
}
+ OstTraceFunctionExit0( CFILEPLUGIN_ISFILETYPEMEDIA_EXIT );
return isValid;
}
@@ -169,8 +173,10 @@
}
delete iHarvester;
delete iMonitor;
- delete iMmcMonitor;
-
+ delete iMmcMonitor;
+ iMountDrives.Close();
+ iJobQueue.Reset();
+ iJobQueue.Close();
TInt err = iFs.DismountPlugin(KFastFindFSPluginName);
CPIXLOGSTRING2("CFilePlugin::~CFilePlugin(), iFs.DismountPlugin: %i", err);
err = iFs.RemovePlugin(KFastFindFSPluginName);
@@ -180,6 +186,7 @@
void CFilePlugin::ConstructL()
{
+ iIndexState = ETrue;
User::LeaveIfError( iFs.Connect() );
TInt err = iFs.AddPlugin(KFastFindFSPluginFile);
OstTrace1( TRACE_NORMAL, CFILEPLUGIN_CONSTRUCTL, "CFilePlugin::ConstructL;iFs.AddPlugin=%d", err );
@@ -268,6 +275,11 @@
// Check if already exists
if (iIndexer[aMedia] && iFolderIndexer[aMedia])
return;
+ //remove the database incase of memory card insertion before harvesting
+ if (aForceReharvest)
+ {
+ RemoveFileDatabaseL(aMedia);
+ }
// Add Notifications paths prior to opening IndexDB.
AddNotificationPathsL(aMedia);
@@ -371,13 +383,21 @@
iFolderIndexer[drive]->ResetL();
// Start the actual harvest
- iHarvester->StartL(drive);
+ if( iIndexState )
+ {
+ iHarvester->StartL(drive);
+ }
+ else
+ {
+ iMountDrives.Append(TDriveNumber(drive));
+ }
CPIXLOGSTRING("END CFilePlugin::StartHarvestingL ");
OstTraceFunctionExit0( CFILEPLUGIN_STARTHARVESTINGL_EXIT );
}
void CFilePlugin::CreateContentIndexItemL(const TDesC& aFilename, TCPixActionType aActionType)
{
+ OstTraceFunctionEntry0( CFILEPLUGIN_CREATECONTENTINDEXITEML_ENTRY );
TFileName lowerCaseFilename(aFilename);
lowerCaseFilename.LowerCase();
@@ -394,9 +414,11 @@
{
OstTrace0( TRACE_NORMAL, DUP2_CFILEPLUGIN_CREATECONTENTINDEXITEML, "CFilePlugin::CreateFileIndexItemL(): Could not map file to drive." );
CPIXLOGSTRING("CFilePlugin::CreateFileIndexItemL(): Could not map file to drive.");
+ OstTraceFunctionExit0( CFILEPLUGIN_CREATECONTENTINDEXITEML_EXIT );
return;
}
-
+ OstTrace0( TRACE_NORMAL, DUP5_CFILEPLUGIN_CREATECONTENTINDEXITEML, "CFilePlugin::Indexing File content" );
+
// Index an empty item if removal action
if (aActionType == ECPixRemoveAction)
{
@@ -436,10 +458,12 @@
}
CleanupStack::PopAndDestroy(index_item);
}
+ OstTraceFunctionExit0( DUP1_CFILEPLUGIN_CREATECONTENTINDEXITEML_EXIT );
}
void CFilePlugin::CreateFolderFileIndexItemL(const TDesC& aFilename, TCPixActionType aActionType, TBool aIsDir)
{
+ OstTraceFunctionEntry0( CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML_ENTRY );
CSearchDocument* index_item = NULL;
TBool isMediaFile = false;
TFileName lowerCaseFilename(aFilename);
@@ -460,6 +484,8 @@
//Check for extension type, if media items do not index them
if(!isMediaFile)
{
+ OstTrace0( TRACE_NORMAL, DUP5_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML, "CFilePlugin::Indexing File Folder" );
+
OstTraceExt2( TRACE_NORMAL, CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML, "CFilePlugin::CreateFolderFileIndexItemL;lowerCaseFilename=%S;aActionType=%d", lowerCaseFilename, aActionType );
CPIXLOGSTRING3("CFilePlugin::CreateFolderFileIndexItemL lowerCaseFilename = %S aActionType = %d ",
&lowerCaseFilename, aActionType);
@@ -472,6 +498,7 @@
{
OstTrace0( TRACE_NORMAL, DUP1_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML, "CFilePlugin::CreateFolderFileIndexItemL(): Could not map file to drive." );
CPIXLOGSTRING("CFilePlugin::CreateFolderFileIndexItemL(): Could not map file to drive.");
+ OstTraceFunctionExit0( CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML_EXIT );
return;
}
@@ -512,6 +539,7 @@
delete index_item;
}
}
+ OstTraceFunctionExit0( DUP1_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML_EXIT );
}
void CFilePlugin::HarvestingCompleted(TDriveNumber aDriveNumber, TInt aError)
@@ -614,6 +642,7 @@
CSearchDocument* CFilePlugin::CreateCpixDocumentL(const TDesC& aFilePath, TBool aIsDir)
{
+ OstTraceFunctionEntry0( CFILEPLUGIN_CREATECPIXDOCUMENTL_ENTRY );
CSearchDocument* index_item = CSearchDocument::NewLC(aFilePath, KFileBaseAppClassFolder);
@@ -653,9 +682,98 @@
index_item->AddExcerptL(aFilePath);
CleanupStack::Pop(index_item);
+ OstTraceFunctionExit0( CFILEPLUGIN_CREATECPIXDOCUMENTL_EXIT );
return index_item;
}
+void CFilePlugin::RemoveFileDatabaseL(TDriveNumber aDrive)
+ {
+ RFs aFs;
+ User::LeaveIfError( aFs.Connect() );
+ TChar drive;
+ TInt err = aFs.DriveToChar((TDriveNumber)aDrive,drive);
+ if ( err == KErrNone )
+ {
+ TBuf<KMaxFileName> folderpath;
+ folderpath.Append(drive);
+ folderpath.Append(KFilePluginColon);
+ folderpath.Append(KCPixSearchServerPrivateDirectory);
+ folderpath.Append(KIndexingDBPath);
+ folderpath.Append(KfileDBPath);
+ CFileMan* FileMan = CFileMan::NewL(aFs);
+ if ( FileMan )
+ FileMan->Delete( folderpath );
+ delete FileMan;
+ }
+ aFs.Close();
+ }
+
+void CFilePlugin::PausePluginL()
+ {
+ OstTraceFunctionEntry0( CFILEPLUGIN_PAUSEPLUGINL_ENTRY );
+ iIndexState = EFalse;
+ //iHarvester->SetHarvesterState(iIndexState);
+ OstTraceFunctionExit0( CFILEPLUGIN_PAUSEPLUGINL_EXIT );
+ }
+
+void CFilePlugin::ResumePluginL()
+ {
+ OstTraceFunctionEntry0( CFILEPLUGIN_RESUMEPLUGINL_ENTRY );
+ iIndexState = ETrue;
+ IndexQueuedItems();
+ iHarvester->ResumeRequest();
+ MountAvailableDrivesInQueue();
+ //iHarvester->SetHarvesterState(iIndexState);
+ OstTraceFunctionExit0( CFILEPLUGIN_RESUMEPLUGINL_EXIT );
+ }
+
+void CFilePlugin::MountAvailableDrivesInQueue()
+ {
+ OstTraceFunctionEntry0( CFILEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_ENTRY );
+ for(TInt i=0;i<iMountDrives.Count();i++)
+ {
+ TDriveNumber drive = iMountDrives[i];
+ iMountDrives.Remove(i);
+ iHarvester->StartL(drive);
+ }
+ OstTraceFunctionExit0( CFILEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_EXIT );
+ }
+
+TBool CFilePlugin::GetHarvesterState()
+ {
+ return iIndexState;
+ }
+
+void CFilePlugin::AddToQueueL(const TDesC& aFilename, TCPixActionType aActionType, TBool aIsFolder)
+ {
+ OstTraceFunctionEntry0( CFILEPLUGIN_ADDTOQUEUEL_ENTRY );
+ TRecord entry;
+ entry.isFolder = aIsFolder;
+ entry.iUri.Copy(aFilename);
+ entry.iActionType = aActionType;
+ iJobQueue.AppendL(entry);
+ OstTraceFunctionExit0( CFILEPLUGIN_ADDTOQUEUEL_EXIT );
+ }
+
+void CFilePlugin::IndexQueuedItems()
+ {
+ OstTraceFunctionEntry0( CFILEPLUGIN_INDEXQUEUEDITEMS_ENTRY );
+ while (iJobQueue.Count()>0 && GetHarvesterState())
+ {
+ TRecord entry = iJobQueue[0];
+ //Let the indexer handle this object TRAP it as it can leave
+ if(entry.isFolder)
+ CreateFolderFileIndexItemL( entry.iUri, entry.iActionType );
+ else
+ {
+ CreateContentIndexItemL( entry.iUri, entry.iActionType );
+ CreateFolderFileIndexItemL( entry.iUri, entry.iActionType, entry.isFolder );
+ }
+ iJobQueue.Remove(0);
+ }
+ OstTraceFunctionExit0( CFILEPLUGIN_INDEXQUEUEDITEMS_EXIT );
+ }
+
#ifdef __PERFORMANCE_DATA
void CFilePlugin::UpdatePerformaceDataL(TDriveNumber aDriveNumber)
{
--- a/harvesterplugins/file/src/cfolderrenamedharvester.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/src/cfolderrenamedharvester.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -292,16 +292,32 @@
oldFileName.Append( leaf );
if(entry.IsDir())
{
- iFilePlugin.CreateFolderFileIndexItemL( oldFileName, ECPixRemoveAction );
- iFilePlugin.CreateFolderFileIndexItemL( fileParser.FullName(), ECPixAddAction );
+ if(iFilePlugin.GetHarvesterState())
+ {
+ iFilePlugin.CreateFolderFileIndexItemL( oldFileName, ECPixRemoveAction );
+ iFilePlugin.CreateFolderFileIndexItemL( fileParser.FullName(), ECPixAddAction );
+ }
+ else
+ {
+ iFilePlugin.AddToQueueL( oldFileName, ECPixRemoveAction, ETrue );
+ iFilePlugin.AddToQueueL( fileParser.FullName(), ECPixAddAction, ETrue );
+ }
}
else
{
- iFilePlugin.CreateContentIndexItemL( oldFileName, ECPixRemoveAction );
- iFilePlugin.CreateFolderFileIndexItemL( oldFileName, ECPixRemoveAction, false );
+ if( iFilePlugin.GetHarvesterState() )
+ {
+ iFilePlugin.CreateContentIndexItemL( oldFileName, ECPixRemoveAction );
+ iFilePlugin.CreateFolderFileIndexItemL( oldFileName, ECPixRemoveAction, EFalse );
- iFilePlugin.CreateContentIndexItemL( fileParser.FullName(), ECPixAddAction );
- iFilePlugin.CreateFolderFileIndexItemL( fileParser.FullName(), ECPixAddAction, false );
+ iFilePlugin.CreateContentIndexItemL( fileParser.FullName(), ECPixAddAction );
+ iFilePlugin.CreateFolderFileIndexItemL( fileParser.FullName(), ECPixAddAction, EFalse );
+ }
+ else
+ {
+ iFilePlugin.AddToQueueL( oldFileName, ECPixRemoveAction, EFalse );
+ iFilePlugin.AddToQueueL( fileParser.FullName(), ECPixAddAction, EFalse );
+ }
}
// TODO: If this is not TRAPPED, state machine breaks
iStepNumber++;
@@ -422,9 +438,17 @@
void CFolderRenamedHarvester::HandleFolderRenameL()
{
+ OstTraceFunctionEntry0( CFOLDERRENAMEDHARVESTER_HANDLEFOLDERRENAMEL_ENTRY );
RemoveBackslash(iOldFolderName);
- iFilePlugin.CreateFolderFileIndexItemL( iOldFolderName, ECPixRemoveAction );
RemoveBackslash(iNewFolderName);
- iFilePlugin.CreateFolderFileIndexItemL( iNewFolderName, ECPixAddAction );
+ if(iFilePlugin.GetHarvesterState())
+ {
+ iFilePlugin.CreateFolderFileIndexItemL( iOldFolderName, ECPixRemoveAction );
+ iFilePlugin.CreateFolderFileIndexItemL( iNewFolderName, ECPixAddAction );
+ }
+ else
+ iFilePlugin.AddToQueueL(iOldFolderName, ECPixRemoveAction, ETrue);
+ iFilePlugin.AddToQueueL(iNewFolderName, ECPixAddAction, ETrue);
+ OstTraceFunctionExit0( CFOLDERRENAMEDHARVESTER_HANDLEFOLDERRENAMEL_EXIT );
}
// End of File
--- a/harvesterplugins/file/src/cmmcmonitor.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/src/cmmcmonitor.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -133,7 +133,34 @@
{
OstTraceFunctionEntry0( CMMCMONITOR_STARTMONITORING_ENTRY );
CPIXLOGSTRING("ENTER CMMCMonitor::StartMonitoring");
- TRAP_IGNORE( RunL() );//Need to TRAP this rather than use RunError
+ iProperty.Subscribe( iStatus );
+ SetActive();
+ User::LeaveIfError( iProperty.Get( KPSUidUikon, KUikMMCInserted, iMmcStatus ) );
+
+ for ( TInt driveNumber = EDriveA; driveNumber <= EDriveZ; driveNumber++ )
+ {
+ const TBool foundMmc = MmcStatus( driveNumber );
+ if ( !foundMmc )
+ {
+ continue;
+ }
+
+ // This drive has been recognized as MMC.
+ TDriveNumber drv = TDriveNumber( driveNumber );
+
+ TUint drvStatus( 0 );
+
+ const TInt err = DriveInfo::GetDriveStatus( *iFsSession, driveNumber, drvStatus );
+ if ( err )
+ {
+ continue; // should not happen
+ }
+
+ if ( drvStatus & DriveInfo::EDrivePresent )
+ {
+ iFilePlugin.MountL(drv, EFalse);
+ }
+ }
CPIXLOGSTRING("END CMMCMonitor::StartMonitoring");
OstTraceFunctionExit0( CMMCMONITOR_STARTMONITORING_EXIT );
return ETrue;
@@ -242,7 +269,7 @@
OstTrace0( TRACE_NORMAL, DUP2_CMMCMONITOR_RUNL, "CMMCMonitor::RunL insert event" );
CPIXLOGSTRING("CMMCMonitor::RunL insert event");
// Mount MMC and force reharvest
- iFilePlugin.MountL(drv, EFalse);//dont force reharvest
+ iFilePlugin.MountL(drv, ETrue);
}
else
{
--- a/harvesterplugins/file/traces/OstTraceDefinitions.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/traces/OstTraceDefinitions.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+/*
+* This is Default Licence added by TraceCompiler
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
#ifndef __OSTTRACEDEFINITIONS_H__
#define __OSTTRACEDEFINITIONS_H__
// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
--- a/harvesterplugins/file/traces/cfileharvesterTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/traces/cfileharvesterTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CFILEHARVESTERTRACES_H__
@@ -16,6 +32,8 @@
#define CFILEHARVESTER_GETFILEIDL_EXIT 0x8a0008
#define CFILEHARVESTER_RUNL_ENTRY 0x8a0009
#define CFILEHARVESTER_RUNL_EXIT 0x8a000a
+#define CFILEHARVESTER_RESUMEREQUEST_ENTRY 0x8a003a
+#define CFILEHARVESTER_RESUMEREQUEST_EXIT 0x8a003b
#define CFILEHARVESTER_ADDIGNOREPATHSL 0x860001
#define DUP1_CFILEHARVESTER_ADDIGNOREPATHSL 0x860002
#define DUP2_CFILEHARVESTER_ADDIGNOREPATHSL 0x860003
@@ -33,6 +51,9 @@
#ifndef __KERNEL_MODE__
+#ifndef __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+#define __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+
inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC16& aParam1 )
{
TBool retval;
@@ -67,6 +88,9 @@
}
return retval;
}
+
+#endif // __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+
#endif
--- a/harvesterplugins/file/traces/cfilemonitorTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/traces/cfilemonitorTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CFILEMONITORTRACES_H__
@@ -44,6 +60,9 @@
#ifndef __KERNEL_MODE__
+#ifndef __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+#define __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+
inline TBool OstTraceGen1( TUint32 aTraceID, const TDesC16& aParam1 )
{
TBool retval;
@@ -78,6 +97,9 @@
}
return retval;
}
+
+#endif // __OSTTRACEGEN1_TUINT32_CONST_TDESC16REF__
+
#endif
--- a/harvesterplugins/file/traces/cfilepluginTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/traces/cfilepluginTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CFILEPLUGINTRACES_H__
@@ -23,6 +39,26 @@
#define CFILEPLUGIN_FORMBASEAPPCLASS_EXIT 0x8a0022
#define CFILEPLUGIN_DATABASEPATHLC_ENTRY 0x8a0023
#define CFILEPLUGIN_DATABASEPATHLC_EXIT 0x8a0024
+#define CFILEPLUGIN_ISFILETYPEMEDIA_ENTRY 0x8a003c
+#define CFILEPLUGIN_ISFILETYPEMEDIA_EXIT 0x8a003d
+#define CFILEPLUGIN_CREATECONTENTINDEXITEML_ENTRY 0x8a003e
+#define CFILEPLUGIN_CREATECONTENTINDEXITEML_EXIT 0x8a003f
+#define DUP1_CFILEPLUGIN_CREATECONTENTINDEXITEML_EXIT 0x8a0040
+#define CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML_ENTRY 0x8a0041
+#define CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML_EXIT 0x8a0042
+#define DUP1_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML_EXIT 0x8a0043
+#define CFILEPLUGIN_CREATECPIXDOCUMENTL_ENTRY 0x8a0044
+#define CFILEPLUGIN_CREATECPIXDOCUMENTL_EXIT 0x8a0045
+#define CFILEPLUGIN_PAUSEPLUGINL_ENTRY 0x8a0046
+#define CFILEPLUGIN_PAUSEPLUGINL_EXIT 0x8a0047
+#define CFILEPLUGIN_RESUMEPLUGINL_ENTRY 0x8a0048
+#define CFILEPLUGIN_RESUMEPLUGINL_EXIT 0x8a0049
+#define CFILEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_ENTRY 0x8a004a
+#define CFILEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_EXIT 0x8a004b
+#define CFILEPLUGIN_ADDTOQUEUEL_ENTRY 0x8a004c
+#define CFILEPLUGIN_ADDTOQUEUEL_EXIT 0x8a004d
+#define CFILEPLUGIN_INDEXQUEUEDITEMS_ENTRY 0x8a004e
+#define CFILEPLUGIN_INDEXQUEUEDITEMS_EXIT 0x8a004f
#define CFILEPLUGIN_CONSTRUCTL 0x860029
#define DUP1_CFILEPLUGIN_CONSTRUCTL 0x86002a
#define DUP2_CFILEPLUGIN_CONSTRUCTL 0x86002b
@@ -42,9 +78,14 @@
#define DUP2_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML 0x860039
#define DUP3_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML 0x86003a
#define DUP4_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML 0x86003b
+#define DUP5_CFILEPLUGIN_CREATECONTENTINDEXITEML 0x86004b
+#define DUP5_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML 0x86004c
#ifndef __KERNEL_MODE__
+#ifndef __OSTTRACEGEN2_TUINT32_CONST_TDESC16REF_TINT__
+#define __OSTTRACEGEN2_TUINT32_CONST_TDESC16REF_TINT__
+
inline TBool OstTraceGen2( TUint32 aTraceID, const TDesC16& aParam1, TInt aParam2 )
{
TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID );
@@ -101,6 +142,12 @@
return retval;
}
+#endif // __OSTTRACEGEN2_TUINT32_CONST_TDESC16REF_TINT__
+
+
+#ifndef __OSTTRACEGEN2_TUINT32_CONST_TDESC16REF_TINT32__
+#define __OSTTRACEGEN2_TUINT32_CONST_TDESC16REF_TINT32__
+
inline TBool OstTraceGen2( TUint32 aTraceID, const TDesC16& aParam1, TInt32 aParam2 )
{
TBool retval = BTraceFiltered8( EXTRACT_GROUP_ID(aTraceID), EOstTraceActivationQuery, KOstTraceComponentID, aTraceID );
@@ -156,6 +203,9 @@
}
return retval;
}
+
+#endif // __OSTTRACEGEN2_TUINT32_CONST_TDESC16REF_TINT32__
+
#endif
--- a/harvesterplugins/file/traces/cfolderrenamedharvesterTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/traces/cfolderrenamedharvesterTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CFOLDERRENAMEDHARVESTERTRACES_H__
@@ -17,6 +33,8 @@
#define CFOLDERRENAMEDHARVESTER_RUNL_ENTRY 0x8a002d
#define CFOLDERRENAMEDHARVESTER_RUNL_EXIT 0x8a002e
#define DUP1_CFOLDERRENAMEDHARVESTER_RUNL_EXIT 0x8a002f
+#define CFOLDERRENAMEDHARVESTER_HANDLEFOLDERRENAMEL_ENTRY 0x8a0050
+#define CFOLDERRENAMEDHARVESTER_HANDLEFOLDERRENAMEL_EXIT 0x8a0051
#define CFOLDERRENAMEDHARVESTER_GETNEXTFOLDERL 0x86003c
#define DUP1_CFOLDERRENAMEDHARVESTER_GETNEXTFOLDERL 0x86003d
#define CFOLDERRENAMEDHARVESTER_DOCANCEL 0x86003e
--- a/harvesterplugins/file/traces/cmmcmonitorTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/traces/cmmcmonitorTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Mmc monitor
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CMMCMONITORTRACES_H__
--- a/harvesterplugins/file/traces/fixed_id.definitions Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/file/traces/fixed_id.definitions Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+##
+# This is Default Licence added by TraceCompiler
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+##
#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
[GROUP]TRACE_FLOW=0x8a
[GROUP]TRACE_NORMAL=0x86
@@ -7,6 +24,8 @@
[TRACE]TRACE_FLOW[0x8A]_CFILEHARVESTER_GETFILEIDL_EXIT=0x8
[TRACE]TRACE_FLOW[0x8A]_CFILEHARVESTER_GETNEXTFOLDERL_ENTRY=0x5
[TRACE]TRACE_FLOW[0x8A]_CFILEHARVESTER_GETNEXTFOLDERL_EXIT=0x6
+[TRACE]TRACE_FLOW[0x8A]_CFILEHARVESTER_RESUMEREQUEST_ENTRY=0x3a
+[TRACE]TRACE_FLOW[0x8A]_CFILEHARVESTER_RESUMEREQUEST_EXIT=0x3b
[TRACE]TRACE_FLOW[0x8A]_CFILEHARVESTER_RUNL_ENTRY=0x9
[TRACE]TRACE_FLOW[0x8A]_CFILEHARVESTER_RUNL_EXIT=0xa
[TRACE]TRACE_FLOW[0x8A]_CFILEHARVESTER_STARTL_ENTRY=0x3
@@ -21,16 +40,34 @@
[TRACE]TRACE_FLOW[0x8A]_CFILEMONITOR_STARTMONITORING_EXIT=0x10
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_ADDNOTIFICATIONPATHSL_ENTRY=0x1d
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_ADDNOTIFICATIONPATHSL_EXIT=0x1e
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_ADDTOQUEUEL_ENTRY=0x4c
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_ADDTOQUEUEL_EXIT=0x4d
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_CREATECONTENTINDEXITEML_ENTRY=0x3e
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_CREATECONTENTINDEXITEML_EXIT=0x3f
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_CREATECPIXDOCUMENTL_ENTRY=0x44
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_CREATECPIXDOCUMENTL_EXIT=0x45
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML_ENTRY=0x41
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML_EXIT=0x42
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_DATABASEPATHLC_ENTRY=0x23
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_DATABASEPATHLC_EXIT=0x24
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_FORMBASEAPPCLASS_ENTRY=0x21
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_FORMBASEAPPCLASS_EXIT=0x22
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_HARVESTINGCOMPLETED_ENTRY=0x1b
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_HARVESTINGCOMPLETED_EXIT=0x1c
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_INDEXQUEUEDITEMS_ENTRY=0x4e
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_INDEXQUEUEDITEMS_EXIT=0x4f
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_ISFILETYPEMEDIA_ENTRY=0x3c
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_ISFILETYPEMEDIA_EXIT=0x3d
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_ENTRY=0x4a
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_EXIT=0x4b
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_MOUNTL_ENTRY=0x14
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_MOUNTL_EXIT=0x15
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_PAUSEPLUGINL_ENTRY=0x46
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_PAUSEPLUGINL_EXIT=0x47
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_REMOVENOTIFICATIONPATHS_ENTRY=0x1f
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_REMOVENOTIFICATIONPATHS_EXIT=0x20
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_RESUMEPLUGINL_ENTRY=0x48
+[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_RESUMEPLUGINL_EXIT=0x49
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_STARTHARVESTINGL_ENTRY=0x19
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_STARTHARVESTINGL_EXIT=0x1a
[TRACE]TRACE_FLOW[0x8A]_CFILEPLUGIN_UNMOUNT_ENTRY=0x16
@@ -41,6 +78,8 @@
[TRACE]TRACE_FLOW[0x8A]_CFOLDERRENAMEDHARVESTER_GETFILEIDL_EXIT=0x2c
[TRACE]TRACE_FLOW[0x8A]_CFOLDERRENAMEDHARVESTER_GETNEXTFOLDERL_ENTRY=0x29
[TRACE]TRACE_FLOW[0x8A]_CFOLDERRENAMEDHARVESTER_GETNEXTFOLDERL_EXIT=0x2a
+[TRACE]TRACE_FLOW[0x8A]_CFOLDERRENAMEDHARVESTER_HANDLEFOLDERRENAMEL_ENTRY=0x50
+[TRACE]TRACE_FLOW[0x8A]_CFOLDERRENAMEDHARVESTER_HANDLEFOLDERRENAMEL_EXIT=0x51
[TRACE]TRACE_FLOW[0x8A]_CFOLDERRENAMEDHARVESTER_RUNL_ENTRY=0x2d
[TRACE]TRACE_FLOW[0x8A]_CFOLDERRENAMEDHARVESTER_RUNL_EXIT=0x2e
[TRACE]TRACE_FLOW[0x8A]_CFOLDERRENAMEDHARVESTER_STARTL_ENTRY=0x27
@@ -56,6 +95,8 @@
[TRACE]TRACE_FLOW[0x8A]_CMMCMONITOR_STARTMONITORING_ENTRY=0x34
[TRACE]TRACE_FLOW[0x8A]_CMMCMONITOR_STARTMONITORING_EXIT=0x35
[TRACE]TRACE_FLOW[0x8A]_DUP1_CFILEMONITOR_INITIALIZE_EXIT=0x13
+[TRACE]TRACE_FLOW[0x8A]_DUP1_CFILEPLUGIN_CREATECONTENTINDEXITEML_EXIT=0x40
+[TRACE]TRACE_FLOW[0x8A]_DUP1_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML_EXIT=0x43
[TRACE]TRACE_FLOW[0x8A]_DUP1_CFILEPLUGIN_UNMOUNT_EXIT=0x18
[TRACE]TRACE_FLOW[0x8A]_DUP1_CFOLDERRENAMEDHARVESTER_RUNL_EXIT=0x2f
[TRACE]TRACE_NORMAL[0x86]_CFILEHARVESTER_ADDIGNOREPATHSL=0x1
@@ -128,6 +169,8 @@
[TRACE]TRACE_NORMAL[0x86]_DUP4_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML=0x3b
[TRACE]TRACE_NORMAL[0x86]_DUP5_CFILEMONITOR_RUNL=0x14
[TRACE]TRACE_NORMAL[0x86]_DUP5_CFILEPLUGIN_CONSTRUCTL=0x2e
+[TRACE]TRACE_NORMAL[0x86]_DUP5_CFILEPLUGIN_CREATECONTENTINDEXITEML=0x4b
+[TRACE]TRACE_NORMAL[0x86]_DUP5_CFILEPLUGIN_CREATEFOLDERFILEINDEXITEML=0x4c
[TRACE]TRACE_NORMAL[0x86]_DUP6_CFILEMONITOR_RUNL=0x15
[TRACE]TRACE_NORMAL[0x86]_DUP7_CFILEMONITOR_RUNL=0x16
[TRACE]TRACE_NORMAL[0x86]_DUP8_CFILEMONITOR_RUNL=0x17
--- a/harvesterplugins/inc/s60performance.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/inc/s60performance.h Tue Oct 05 13:32:14 2010 +0530
@@ -17,4 +17,4 @@
//MACRO __PERFORMANCE_DATA
// For enabling Highlighter
-MACRO USE_HIGHLIGHTER
+//MACRO USE_HIGHLIGHTER
--- a/harvesterplugins/media/audio/data/20029ab9.rss Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/audio/data/20029ab9.rss Tue Oct 05 13:32:14 2010 +0530
@@ -36,9 +36,9 @@
{
implementation_uid = 0x20029AB9;
version_no = 1;
- display_name = "Audios";
+ display_name = "Audio";
default_data = "Media";
- opaque_data = "";
+ opaque_data = "z:\\resource\\qt\\plugins\\searchsrv\\contentconfig\\audioconfig.xml";
}
};
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvesterplugins/media/audio/data/audioconfig.xml Tue Oct 05 13:32:14 2010 +0530
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<category>
+ <name>Audio</name>
+ <mime>audio/mp3</mime>
+ <licon>qtg_large_tone</licon>
+ <baseapp>root media audio</baseapp>
+ <lname>txt_search_list_media</lname>
+ <displayorder>2</displayorder>
+ <exceptionstring>txt_mus_dblist_val_unknown4</exceptionstring>
+ <tsfile>Z:/resource/qt/translations/music_</tsfile>
+ <actionuri>
+ <uri>
+ <uristring></uristring>
+ <lname></lname>
+ <licon></licon>
+ <uriref></uriref>
+ <action></action><!-- primary action or default action. alternatively, we could always use first entry as this one -->
+ </uri>
+ </actionuri>
+ <fieldmap>
+ <resulthit>
+ <field></field>
+ <auri></auri><!-- alternatively <auriorder>1,2,3,4</auriorder> instead of four lines -->
+ </resulthit>
+ </fieldmap>
+ <indexcontentsize>L</indexcontentsize> <!-- possible values S, M, L, XL, XXL. or scale of 1 to 10. -->
+ <policy>
+ <capability>WriteDeviceData<!-- Allow search on my data from clients with only Write Device Data capability it is combination of SID/VID/capability --></capability>
+ </policy>
+ <resultfirstline>
+ <list>
+ <field>Name</field><!-- commo seperated list, if there is a chance that certain field could be empty -->
+ <field>Title</field>
+ </list>
+ </resultfirstline>
+ <relevancy>
+ <boost>
+ <field>Name</field>
+ <boostvalue>10</boostvalue><!-- on scale 1-10 -->
+ </boost>
+ <boost>
+ <field>Title</field>
+ <boostvalue>5</boostvalue>
+ </boost>
+ </relevancy>
+</category>
--- a/harvesterplugins/media/audio/group/bld.inf Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/audio/group/bld.inf Tue Oct 05 13:32:14 2010 +0530
@@ -19,3 +19,5 @@
PRJ_MMPFILES
audioplugin.mmp
+PRJ_EXPORTS
+../data/audioconfig.xml /epoc32/data/z/resource/qt/plugins/searchsrv/contentconfig/audioconfig.xml
--- a/harvesterplugins/media/audio/inc/mediaplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/audio/inc/mediaplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -80,6 +80,8 @@
* Leaves in case of errors.
*/
void StartHarvestingL(const TDesC & aQualifiedBaseAppClass);
+ void PausePluginL();
+ void ResumePluginL();
/*
* HandleMdeItemL callback from MMediaObjectHandler
* @param TItemId aObjId object Id
--- a/harvesterplugins/media/audio/src/cpixmediaaudiodoc.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/audio/src/cpixmediaaudiodoc.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -112,7 +112,7 @@
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText);
AddToFieldExcerptL(textProperty->Value());//Add artist to excerpt
}
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
/*//Get the media file extension and store
TBuf<KMaxExtLength> extension;
GetExtension(aObject.Uri(),extension);
@@ -128,7 +128,7 @@
index_item->AddHLDisplayFieldL(textProperty->Value());
}
}
-#endif
+//#endif
CMdEPropertyDef& albumPropDef = aObjectDef.GetPropertyDefL(MdeConstants::Audio::KAlbumProperty );
if(aObject.Property( albumPropDef, property )!= KErrNotFound)
{
--- a/harvesterplugins/media/audio/src/mediaplugin.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/audio/src/mediaplugin.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -99,7 +99,7 @@
// -----------------------------------------------------------------------------
void CAudioPlugin::ConstructL()
{
-
+ iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this);
}
// -----------------------------------------------------------------------------
@@ -116,7 +116,7 @@
//Instantiate all monitoring and harvesting class here
iMdsUtils = CMdsSessionObjectUtils::NewL();
iMdsUtils->InitializeL(); //Create valid session in it
- iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this);
+ //iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this);
iMdeHarvester = CMdeHarvester::NewL(iMdsUtils->GetSession(),
this,iObjectJobQueueManager);
iMdsMonitor = CMdsMediaMonitor::NewL(iMdsUtils->GetSession(),iObjectJobQueueManager);
@@ -208,6 +208,8 @@
CPIXLOGSTRING("CAudioPlugin::HandleMdeItemL(): Indexer not found");
return;
}
+ OstTrace0( TRACE_NORMAL, DUP12_CAUDIOPLUGIN_HANDLEMDEITEML, "CAudioPlugin::HandleMdeItemL Indexing Audio" );
+
// Send for indexing
if (aActionType == ECPixAddAction)
{
@@ -330,6 +332,20 @@
}
}
+void CAudioPlugin::PausePluginL()
+ {
+ OstTraceFunctionEntry0( CAUDIOPLUGIN_PAUSEPLUGINL_ENTRY );
+ iObjectJobQueueManager->PauseL();
+ OstTraceFunctionExit0( CAUDIOPLUGIN_PAUSEPLUGINL_EXIT );
+ }
+
+void CAudioPlugin::ResumePluginL()
+ {
+ OstTraceFunctionEntry0( CAUDIOPLUGIN_RESUMEPLUGINL_ENTRY );
+ iObjectJobQueueManager->ResumeL();
+ OstTraceFunctionExit0( CAUDIOPLUGIN_RESUMEPLUGINL_EXIT );
+ }
+
#ifdef __PERFORMANCE_DATA
void CAudioPlugin::UpdateLogL()
{
--- a/harvesterplugins/media/audio/traces/OstTraceDefinitions.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/audio/traces/OstTraceDefinitions.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+/*
+* This is Default Licence added by TraceCompiler
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
#ifndef __OSTTRACEDEFINITIONS_H__
#define __OSTTRACEDEFINITIONS_H__
// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
--- a/harvesterplugins/media/audio/traces/cpixmediaaudiodocTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/audio/traces/cpixmediaaudiodocTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MDS to CPIX Audio Document fetcher
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CPIXMEDIAAUDIODOCTRACES_H__
--- a/harvesterplugins/media/audio/traces/fixed_id.definitions Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/audio/traces/fixed_id.definitions Tue Oct 05 13:32:14 2010 +0530
@@ -1,6 +1,27 @@
+##
+# This is Default Licence added by TraceCompiler
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+##
#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
[GROUP]TRACE_FLOW=0x8a
[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FLOW[0x8A]_CAUDIOPLUGIN_PAUSEPLUGINL_ENTRY=0x7
+[TRACE]TRACE_FLOW[0x8A]_CAUDIOPLUGIN_PAUSEPLUGINL_EXIT=0x8
+[TRACE]TRACE_FLOW[0x8A]_CAUDIOPLUGIN_RESUMEPLUGINL_ENTRY=0x9
+[TRACE]TRACE_FLOW[0x8A]_CAUDIOPLUGIN_RESUMEPLUGINL_EXIT=0xa
[TRACE]TRACE_FLOW[0x8A]_CAUDIOPLUGIN_STARTHARVESTINGL_ENTRY=0x5
[TRACE]TRACE_FLOW[0x8A]_CAUDIOPLUGIN_STARTHARVESTINGL_EXIT=0x6
[TRACE]TRACE_FLOW[0x8A]_CAUDIOPLUGIN_STARTPLUGINL_ENTRY=0x3
@@ -10,6 +31,7 @@
[TRACE]TRACE_NORMAL[0x86]_CAUDIOPLUGIN_HANDLEMDEITEML=0x1
[TRACE]TRACE_NORMAL[0x86]_DUP10_CAUDIOPLUGIN_HANDLEMDEITEML=0xb
[TRACE]TRACE_NORMAL[0x86]_DUP11_CAUDIOPLUGIN_HANDLEMDEITEML=0xc
+[TRACE]TRACE_NORMAL[0x86]_DUP12_CAUDIOPLUGIN_HANDLEMDEITEML=0xd
[TRACE]TRACE_NORMAL[0x86]_DUP1_CAUDIOPLUGIN_HANDLEMDEITEML=0x2
[TRACE]TRACE_NORMAL[0x86]_DUP2_CAUDIOPLUGIN_HANDLEMDEITEML=0x3
[TRACE]TRACE_NORMAL[0x86]_DUP3_CAUDIOPLUGIN_HANDLEMDEITEML=0x4
--- a/harvesterplugins/media/audio/traces/mediapluginTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/audio/traces/mediapluginTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Media Audio harvester plugin implementation
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __MEDIAPLUGINTRACES_H__
@@ -10,6 +26,10 @@
#define CAUDIOPLUGIN_STARTPLUGINL_EXIT 0x8a0004
#define CAUDIOPLUGIN_STARTHARVESTINGL_ENTRY 0x8a0005
#define CAUDIOPLUGIN_STARTHARVESTINGL_EXIT 0x8a0006
+#define CAUDIOPLUGIN_PAUSEPLUGINL_ENTRY 0x8a0007
+#define CAUDIOPLUGIN_PAUSEPLUGINL_EXIT 0x8a0008
+#define CAUDIOPLUGIN_RESUMEPLUGINL_ENTRY 0x8a0009
+#define CAUDIOPLUGIN_RESUMEPLUGINL_EXIT 0x8a000a
#define CAUDIOPLUGIN_HANDLEMDEITEML 0x860001
#define DUP1_CAUDIOPLUGIN_HANDLEMDEITEML 0x860002
#define DUP2_CAUDIOPLUGIN_HANDLEMDEITEML 0x860003
@@ -22,6 +42,7 @@
#define DUP9_CAUDIOPLUGIN_HANDLEMDEITEML 0x86000a
#define DUP10_CAUDIOPLUGIN_HANDLEMDEITEML 0x86000b
#define DUP11_CAUDIOPLUGIN_HANDLEMDEITEML 0x86000c
+#define DUP12_CAUDIOPLUGIN_HANDLEMDEITEML 0x86000d
#endif
--- a/harvesterplugins/media/image/data/20029abb.rss Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/image/data/20029abb.rss Tue Oct 05 13:32:14 2010 +0530
@@ -36,9 +36,9 @@
{
implementation_uid = 0x20029ABB;
version_no = 1;
- display_name = "Images";
+ display_name = "Image";
default_data = "Images";
- opaque_data = "";
+ opaque_data = "z:\\resource\\qt\\plugins\\searchsrv\\contentconfig\\imageconfig.xml";
}
};
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvesterplugins/media/image/data/imageconfig.xml Tue Oct 05 13:32:14 2010 +0530
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<category>
+ <name>Image</name>
+ <mime>image/jpg</mime>
+ <licon>qtg_large_photos</licon>
+ <baseapp>root media image</baseapp>
+ <lname>txt_search_list_media</lname>
+ <displayorder>2</displayorder>
+ <exceptionstring></exceptionstring>
+ <tsfile></tsfile>
+ <actionuri>
+ <uri>
+ <uristring></uristring>
+ <lname></lname>
+ <licon></licon>
+ <uriref></uriref>
+ <action></action><!-- primary action or default action. alternatively, we could always use first entry as this one -->
+ </uri>
+ </actionuri>
+ <fieldmap>
+ <resulthit>
+ <field></field>
+ <auri></auri><!-- alternatively <auriorder>1,2,3,4</auriorder> instead of four lines -->
+ </resulthit>
+ </fieldmap>
+ <indexcontentsize>L</indexcontentsize> <!-- possible values S, M, L, XL, XXL. or scale of 1 to 10. -->
+ <policy>
+ <capability>WriteDeviceData<!-- Allow search on my data from clients with only Write Device Data capability it is combination of SID/VID/capability --></capability>
+ </policy>
+ <resultfirstline>
+ <list>
+ <field>Name</field><!-- commo seperated list, if there is a chance that certain field could be empty -->
+ <field>Title</field>
+ </list>
+ </resultfirstline>
+ <relevancy>
+ <boost>
+ <field>Title</field>
+ <boostvalue>10</boostvalue><!-- on scale 1-10 -->
+ </boost>
+ <boost>
+ <field>Name</field>
+ <boostvalue>5</boostvalue>
+ </boost>
+ </relevancy>
+</category>
--- a/harvesterplugins/media/image/group/bld.inf Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/image/group/bld.inf Tue Oct 05 13:32:14 2010 +0530
@@ -19,3 +19,5 @@
PRJ_MMPFILES
imageplugin.mmp
+PRJ_EXPORTS
+../data/imageconfig.xml /epoc32/data/z/resource/qt/plugins/searchsrv/contentconfig/imageconfig.xml
--- a/harvesterplugins/media/image/inc/imageplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/image/inc/imageplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -80,6 +80,8 @@
* Leaves in case of errors.
*/
void StartHarvestingL(const TDesC & aQualifiedBaseAppClass);
+ void PausePluginL();
+ void ResumePluginL();
/*
* HandleMdeItemL callback from MMediaObjectHandler
* @param TItemId aObjId object Id
--- a/harvesterplugins/media/image/src/cpixmediaimagedoc.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/image/src/cpixmediaimagedoc.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -107,11 +107,11 @@
AddToFieldExcerptL(textProperty->Value());
}
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
TInt slashpos = GetUri().LocateReverse('\\');
TPtrC name = GetUri().Mid( (slashpos+1) );
index_item->AddHLDisplayFieldL(name);
-#endif
+//#endif
//Get user comment field
CMdEPropertyDef& commentPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KCommentProperty );
if(aObject.Property( commentPropDef, property )!= KErrNotFound)
--- a/harvesterplugins/media/image/src/imageplugin.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/image/src/imageplugin.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -97,7 +97,7 @@
// -----------------------------------------------------------------------------
void CImagePlugin::ConstructL()
{
-
+ iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this);
}
// -----------------------------------------------------------------------------
@@ -114,7 +114,7 @@
//Instantiate all monitoring and harvesting class here
iMdsUtils = CMdsSessionObjectUtils::NewL();
iMdsUtils->InitializeL(); //Create valid session in it
- iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this);
+ //iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this);
iMdeHarvester = CMdeHarvester::NewL(iMdsUtils->GetSession(),
this,iObjectJobQueueManager);
iMdsMonitor = CMdsMediaMonitor::NewL(iMdsUtils->GetSession(),iObjectJobQueueManager);
@@ -204,6 +204,8 @@
CPIXLOGSTRING("CImagePlugin::HandleMdeItemL(): Indexer not found");
return;
}
+ OstTrace0( TRACE_NORMAL, DUP12_CIMAGEPLUGIN_HANDLEMDEITEML, "CImagePlugin::Indexing Image" );
+
// Send for indexing
if (aActionType == ECPixAddAction)
{
@@ -328,6 +330,20 @@
}
}
+void CImagePlugin::PausePluginL()
+ {
+ OstTraceFunctionEntry0( CIMAGEPLUGIN_PAUSEPLUGINL_ENTRY );
+ iObjectJobQueueManager->PauseL();
+ OstTraceFunctionExit0( CIMAGEPLUGIN_PAUSEPLUGINL_EXIT );
+ }
+
+void CImagePlugin::ResumePluginL()
+ {
+ OstTraceFunctionEntry0( CIMAGEPLUGIN_RESUMEPLUGINL_ENTRY );
+ iObjectJobQueueManager->ResumeL();
+ OstTraceFunctionExit0( CIMAGEPLUGIN_RESUMEPLUGINL_EXIT );
+ }
+
#ifdef __PERFORMANCE_DATA
void CImagePlugin::UpdateLogL()
{
--- a/harvesterplugins/media/image/traces/OstTraceDefinitions.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/image/traces/OstTraceDefinitions.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+/*
+* This is Default Licence added by TraceCompiler
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
#ifndef __OSTTRACEDEFINITIONS_H__
#define __OSTTRACEDEFINITIONS_H__
// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
--- a/harvesterplugins/media/image/traces/cpixmediaimagedocTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/image/traces/cpixmediaimagedocTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MDS to CPIX Image Document fetcher
+ *
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CPIXMEDIAIMAGEDOCTRACES_H__
--- a/harvesterplugins/media/image/traces/fixed_id.definitions Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/image/traces/fixed_id.definitions Tue Oct 05 13:32:14 2010 +0530
@@ -1,8 +1,29 @@
+##
+# This is Default Licence added by TraceCompiler
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+##
#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
[GROUP]TRACE_FLOW=0x8a
[GROUP]TRACE_NORMAL=0x86
[TRACE]TRACE_FLOW[0x8A]_CCPIXMEDIAIMAGEDOC_GETCPIXDOCUMENTL_ENTRY=0x1
[TRACE]TRACE_FLOW[0x8A]_CCPIXMEDIAIMAGEDOC_GETCPIXDOCUMENTL_EXIT=0x2
+[TRACE]TRACE_FLOW[0x8A]_CIMAGEPLUGIN_PAUSEPLUGINL_ENTRY=0x7
+[TRACE]TRACE_FLOW[0x8A]_CIMAGEPLUGIN_PAUSEPLUGINL_EXIT=0x8
+[TRACE]TRACE_FLOW[0x8A]_CIMAGEPLUGIN_RESUMEPLUGINL_ENTRY=0x9
+[TRACE]TRACE_FLOW[0x8A]_CIMAGEPLUGIN_RESUMEPLUGINL_EXIT=0xa
[TRACE]TRACE_FLOW[0x8A]_CIMAGEPLUGIN_STARTHARVESTINGL_ENTRY=0x5
[TRACE]TRACE_FLOW[0x8A]_CIMAGEPLUGIN_STARTHARVESTINGL_EXIT=0x6
[TRACE]TRACE_FLOW[0x8A]_CIMAGEPLUGIN_STARTPLUGINL_ENTRY=0x3
@@ -10,6 +31,7 @@
[TRACE]TRACE_NORMAL[0x86]_CIMAGEPLUGIN_HANDLEMDEITEML=0x1
[TRACE]TRACE_NORMAL[0x86]_DUP10_CIMAGEPLUGIN_HANDLEMDEITEML=0xb
[TRACE]TRACE_NORMAL[0x86]_DUP11_CIMAGEPLUGIN_HANDLEMDEITEML=0xc
+[TRACE]TRACE_NORMAL[0x86]_DUP12_CIMAGEPLUGIN_HANDLEMDEITEML=0xd
[TRACE]TRACE_NORMAL[0x86]_DUP1_CIMAGEPLUGIN_HANDLEMDEITEML=0x2
[TRACE]TRACE_NORMAL[0x86]_DUP2_CIMAGEPLUGIN_HANDLEMDEITEML=0x3
[TRACE]TRACE_NORMAL[0x86]_DUP3_CIMAGEPLUGIN_HANDLEMDEITEML=0x4
--- a/harvesterplugins/media/image/traces/imagepluginTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/image/traces/imagepluginTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Media Image harvester plugin implementation
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __IMAGEPLUGINTRACES_H__
@@ -10,6 +26,10 @@
#define CIMAGEPLUGIN_STARTPLUGINL_EXIT 0x8a0004
#define CIMAGEPLUGIN_STARTHARVESTINGL_ENTRY 0x8a0005
#define CIMAGEPLUGIN_STARTHARVESTINGL_EXIT 0x8a0006
+#define CIMAGEPLUGIN_PAUSEPLUGINL_ENTRY 0x8a0007
+#define CIMAGEPLUGIN_PAUSEPLUGINL_EXIT 0x8a0008
+#define CIMAGEPLUGIN_RESUMEPLUGINL_ENTRY 0x8a0009
+#define CIMAGEPLUGIN_RESUMEPLUGINL_EXIT 0x8a000a
#define CIMAGEPLUGIN_HANDLEMDEITEML 0x860001
#define DUP1_CIMAGEPLUGIN_HANDLEMDEITEML 0x860002
#define DUP2_CIMAGEPLUGIN_HANDLEMDEITEML 0x860003
@@ -22,6 +42,7 @@
#define DUP9_CIMAGEPLUGIN_HANDLEMDEITEML 0x86000a
#define DUP10_CIMAGEPLUGIN_HANDLEMDEITEML 0x86000b
#define DUP11_CIMAGEPLUGIN_HANDLEMDEITEML 0x86000c
+#define DUP12_CIMAGEPLUGIN_HANDLEMDEITEML 0x86000d
#endif
--- a/harvesterplugins/media/mediautils/inc/cpixindexerutils.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/mediautils/inc/cpixindexerutils.h Tue Oct 05 13:32:14 2010 +0530
@@ -144,6 +144,13 @@
* @param TDriveNumber aMedia drive
*/
void RemoveUnmountedDrive(TDriveNumber aMedia);
+
+ /*
+ * Remove unmounted drive database
+ * @param TDriveNumber aMedia drive
+ * @param TDesC& aPath path of database
+ */
+ void RemoveUnmountedDatabaseL(TDriveNumber aMedia, const TDesC& aPath);
private:
RArray<TDriveNumber> iMountedDrives; //Array of mounted drives
--- a/harvesterplugins/media/mediautils/inc/mdeobjectqueuemanager.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/mediautils/inc/mdeobjectqueuemanager.h Tue Oct 05 13:32:14 2010 +0530
@@ -52,6 +52,8 @@
void RunL();
void DoCancel();
TInt RunError();
+ void PauseL();
+ void ResumeL();
private:
/*
* OverWriteOrAddToQueueL add or update item to queue
@@ -65,6 +67,10 @@
*/
CMdeObjectQueueManager(MMediaObjectHandler* );
/*
+ * Activate the timer object to index queued media items
+ */
+ void ActivateAO();
+ /*
* Second phase constructor
*/
void ConstructL();
@@ -74,6 +80,11 @@
EStateNone = 0,
EStateWaiting
};
+ enum THarvestingState
+ {
+ EStateResume = 0,
+ EStatePause
+ };
struct TMdeActionRecord
{
TItemId iObjectId;
@@ -89,6 +100,7 @@
RArray<TMdeActionRecord> iJobQueue;
// State machine's state
TState iState;
+ THarvestingState iHState;
// Timer which is used to delay indexing messages
RTimer iTimer; //Timer for self activation of AO
MMediaObjectHandler* iMdeObjectHandler; //media object handler
--- a/harvesterplugins/media/mediautils/src/cpixindexerutils.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/mediautils/src/cpixindexerutils.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -28,6 +28,7 @@
// local declarations and functions
namespace {
_LIT(KCPixSearchServerPrivateDirectory, "\\Private\\2001f6f7\\");
+_LIT(KIndexingDBPath,"indexing\\indexdb");
_LIT(KPathIndexDbPath, CPIX_INDEVICE_INDEXDB);
_LIT(KAtSign, "@");
@@ -276,6 +277,8 @@
}
if(IsDriveCanbeMountedL(aMedia))
{
+ //clean the existing database if any
+ RemoveUnmountedDatabaseL(aMedia,aPath);
// Form the baseappclass for this media
TBuf<KMsgPluginBaseAppClassMaxLen> baseAppClass;
FormBaseAppClass(TDriveNumber(aMedia), aBaseAppClassGeneric,baseAppClass);
@@ -467,4 +470,30 @@
return iMountedDrives;
}
+// -----------------------------------------------------------------------------
+// CCPixIndexerUtils::RemoveUnmountedDatabase()
+// -----------------------------------------------------------------------------
+//
+void CCPixIndexerUtils::RemoveUnmountedDatabaseL(TDriveNumber aMedia, const TDesC& aPath)
+ {
+ RFs aFs;
+ User::LeaveIfError( aFs.Connect() );
+ TChar drive;
+ TInt err = aFs.DriveToChar((TDriveNumber)aMedia,drive);
+ if ( err == KErrNone )
+ {
+ TBuf<KMaxFileName> folderpath;
+ folderpath.Append(drive);
+ folderpath.Append(KColon);
+ folderpath.Append(KCPixSearchServerPrivateDirectory);
+ folderpath.Append(KIndexingDBPath);
+ folderpath.Append(aPath);
+ CFileMan* FileMan = CFileMan::NewL(aFs);
+ if ( FileMan )
+ FileMan->Delete( folderpath );
+ delete FileMan;
+ }
+ aFs.Close();
+ }
+
//End of file
--- a/harvesterplugins/media/mediautils/src/mdeobjectqueuemanager.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/mediautils/src/mdeobjectqueuemanager.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -75,6 +75,7 @@
{
CActiveScheduler::Add(this);
User::LeaveIfError(iTimer.CreateLocal());
+ iHState = EStateResume;
}
// -----------------------------------------------------------------------------
@@ -84,32 +85,8 @@
void CMdeObjectQueueManager::AddMdeItemToQueueL( TItemId aMsgId,
TCPixActionType aActionType)
{
- OverWriteOrAddToQueueL(aMsgId,aActionType);
- // Check the size against maximum queue size
- if (iJobQueue.Count() > INDEXING_QUEUE_MAX)
- {
- // Maximum is exceeded, force the write immediately
- if (iState == EStateWaiting)
- {
- iTimer.Cancel(); // RunL will be called with iStatus of KErrCancelled
- }
- else if (iState == EStateNone)
- {
- SetActive();
- TRequestStatus* status = &iStatus;
- User::RequestComplete(status, KErrNone); // RunL will be called with iStatus of KErrNone
- }
- }
- else
- {
- // Maximum is not exceeded, keep waiting
- if (iState == EStateNone)
- {
- iState = EStateWaiting;
- iTimer.After(iStatus, INDEXING_DELAY); // Wait 5 seconds before putting this to index
- SetActive();
- }
- }
+ OverWriteOrAddToQueueL(aMsgId,aActionType);
+ ActivateAO();
}
// -----------------------------------------------------------------------------
@@ -137,6 +114,38 @@
iJobQueue.AppendL(object);
}
+void CMdeObjectQueueManager::ActivateAO()
+ {
+ // Proceed only if the plugin is not in pause state
+ if ( iHState == EStateResume )
+ {
+ // Check the size against maximum queue size
+ if (iJobQueue.Count() > INDEXING_QUEUE_MAX)
+ {
+ // Maximum is exceeded, force the write immediately
+ if (iState == EStateWaiting)
+ {
+ iTimer.Cancel(); // RunL will be called with iStatus of KErrCancelled
+ }
+ else if (iState == EStateNone)
+ {
+ SetActive();
+ TRequestStatus* status = &iStatus;
+ User::RequestComplete(status, KErrNone); // RunL will be called with iStatus of KErrNone
+ }
+ }
+ else
+ {
+ // Maximum is not exceeded, keep waiting
+ if (iState == EStateNone)
+ {
+ iState = EStateWaiting;
+ iTimer.After(iStatus, INDEXING_DELAY); // Wait 5 seconds before putting this to index
+ SetActive();
+ }
+ }
+ }
+ }
// -----------------------------------------------------------------------------
// CCPixIndexerUtils::RunL()
// -----------------------------------------------------------------------------
@@ -144,7 +153,14 @@
void CMdeObjectQueueManager::RunL()
{
CPIXLOGSTRING("START CMdeObjectQueueManager::RunL");
- while (iJobQueue.Count()>0)
+
+ if ( iHState == EStatePause )
+ {
+ iState = EStateNone;
+ CPIXLOGSTRING("END CMdeObjectQueueManager::RunL as Harvester in Pause state");
+ return;
+ }
+ while (iJobQueue.Count()>0 )
{
TMdeActionRecord object = iJobQueue[0];
//iJobQueue.Remove(0);
@@ -194,4 +210,23 @@
{
return KErrNone;
}
+
+// -----------------------------------------------------------------------------
+// CCPixIndexerUtils::PauseL()
+// -----------------------------------------------------------------------------
+//
+void CMdeObjectQueueManager::PauseL()
+ {
+ iHState = EStatePause;
+ }
+// -----------------------------------------------------------------------------
+// CCPixIndexerUtils::ResumeL()
+// -----------------------------------------------------------------------------
+//
+void CMdeObjectQueueManager::ResumeL()
+ {
+ iHState = EStateResume;
+ ActivateAO();
+ }
+
//End of file
--- a/harvesterplugins/media/mediautils/src/mdsmediamonitor.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/mediautils/src/mdsmediamonitor.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -81,7 +81,7 @@
//
CMdsMediaMonitor::~CMdsMediaMonitor()
{
-
+ StopMonitoringL();
}
// -----------------------------------------------------------------------------
@@ -131,6 +131,7 @@
if(iMdsSession)
{
iMdsSession->RemoveObjectObserverL(*this,&iMdsSession->GetDefaultNamespaceDefL());
+ iMdsSession->RemoveObjectPresentObserverL(*this);
}
}
--- a/harvesterplugins/media/video/data/20029aba.rss Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/video/data/20029aba.rss Tue Oct 05 13:32:14 2010 +0530
@@ -36,9 +36,9 @@
{
implementation_uid = 0x20029ABA;
version_no = 1;
- display_name = "Videos";
+ display_name = "Video";
default_data = "Videos";
- opaque_data = "";
+ opaque_data = "z:\\resource\\qt\\plugins\\searchsrv\\contentconfig\\videoconfig.xml";
}
};
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvesterplugins/media/video/data/videoconfig.xml Tue Oct 05 13:32:14 2010 +0530
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<category>
+ <name>Video</name>
+ <mime>application\video</mime>
+ <licon>qtg_large_video</licon>
+ <baseapp>root media video</baseapp>
+ <lname>txt_search_list_media</lname>
+ <displayorder>2</displayorder>
+ <exceptionstring></exceptionstring>
+ <tsfile></tsfile>
+ <actionuri>
+ <uri>
+ <uristring></uristring>
+ <lname></lname>
+ <licon></licon>
+ <uriref></uriref>
+ <action></action><!-- primary action or default action. alternatively, we could always use first entry as this one -->
+ </uri>
+ </actionuri>
+ <fieldmap>
+ <resulthit>
+ <field></field>
+ <auri></auri><!-- alternatively <auriorder>1,2,3,4</auriorder> instead of four lines -->
+ </resulthit>
+ </fieldmap>
+ <indexcontentsize>L</indexcontentsize> <!-- possible values S, M, L, XL, XXL. or scale of 1 to 10. -->
+ <policy>
+ <capability>WriteDeviceData<!-- Allow search on my data from clients with only Write Device Data capability it is combination of SID/VID/capability --></capability>
+ </policy>
+ <resultfirstline>
+ <list>
+ <field>Name</field><!-- commo seperated list, if there is a chance that certain field could be empty -->
+ <field>Title</field>
+ </list>
+ </resultfirstline>
+ <relevancy>
+ <boost>
+ <field>Name</field>
+ <boostvalue>10</boostvalue><!-- on scale 1-10 -->
+ </boost>
+ <boost>
+ <field>Title</field>
+ <boostvalue>5</boostvalue>
+ </boost>
+ </relevancy>
+</category>
--- a/harvesterplugins/media/video/group/bld.inf Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/video/group/bld.inf Tue Oct 05 13:32:14 2010 +0530
@@ -17,4 +17,7 @@
PRJ_MMPFILES
-videoplugin.mmp
\ No newline at end of file
+videoplugin.mmp
+
+PRJ_EXPORTS
+../data/videoconfig.xml /epoc32/data/z/resource/qt/plugins/searchsrv/contentconfig/videoconfig.xml
--- a/harvesterplugins/media/video/inc/videoplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/video/inc/videoplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -49,6 +49,11 @@
*/
static CVideoPlugin* NewL();
/*
+ * NewLC
+ * @return instance of Media plugin
+ */
+ static CVideoPlugin* NewLC();
+ /*
* Destructor
*/
~CVideoPlugin();
@@ -67,6 +72,10 @@
* Leaves in case of errors.
*/
void StartHarvestingL(const TDesC & aQualifiedBaseAppClass);
+
+ void PausePluginL();
+ void ResumePluginL();
+
/*
* HandleMdeItemL callback from MMediaObjectHandler
* @param TItemId aObjId object Id
@@ -92,7 +101,11 @@
/*
* Default constructor
*/
- CVideoPlugin();
+ CVideoPlugin();
+ /*
+ * Second phase constructor
+ */
+ void ConstructL();
private:
// data
--- a/harvesterplugins/media/video/src/cpixmediavideodoc.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/video/src/cpixmediavideodoc.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -106,18 +106,18 @@
CMdETextProperty* textProperty = ( CMdETextProperty* ) property;
if( textProperty->Value().Compare(KNullDesC) > 0 )
{
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
index_item->AddHLDisplayFieldL(textProperty->Value());
AddToFieldExcerptL(name); //Add name to excerpt field
-#else
- AddToFieldExcerptL(name); //Add name to excerpt field
-#endif
+//#else
+// AddToFieldExcerptL(name); //Add name to excerpt field
+//#endif
}
else
{
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
index_item->AddHLDisplayFieldL(name);
-#endif
+//#endif
}
}
//URI and Excerpt is done add additional properties here
--- a/harvesterplugins/media/video/src/videoplugin.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/video/src/videoplugin.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -51,10 +51,18 @@
//Member Functions
-
CVideoPlugin* CVideoPlugin::NewL()
{
- CVideoPlugin* self = new (ELeave) CVideoPlugin;
+ CVideoPlugin* self = CVideoPlugin::NewLC();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CVideoPlugin* CVideoPlugin::NewLC()
+ {
+ CVideoPlugin* self = new (ELeave) CVideoPlugin();
+ CleanupStack::PushL(self);
+ self->ConstructL();
return self;
}
@@ -81,6 +89,11 @@
delete iMdsItem;
}
+void CVideoPlugin::ConstructL()
+ {
+ iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this);
+ }
+
void CVideoPlugin::StartPluginL()
{
OstTraceFunctionEntry0( CVIDEOPLUGIN_STARTPLUGINL_ENTRY );
@@ -93,7 +106,7 @@
// Instansiate harvesting and monitering
iMdsUtils = CMdsSessionObjectUtils::NewL();
iMdsUtils->InitializeL();
- iObjectJobQueueManager = CMdeObjectQueueManager::NewL( this );
+ //iObjectJobQueueManager = CMdeObjectQueueManager::NewL( this );
iMdeHarvester = CMdeHarvester::NewL( iMdsUtils->GetSession(), this,
iObjectJobQueueManager );
iMdsMonitor = CMdsMediaMonitor::NewL( iMdsUtils->GetSession(), iObjectJobQueueManager );
@@ -185,6 +198,8 @@
return;
}
// Send for indexing
+ OstTrace0( TRACE_NORMAL, DUP12_CVIDEOPLUGIN_HANDLEMDEITEML, "CVideoPlugin::Indexing Video" );
+
if (aActionType == ECPixAddAction)
{
#ifdef __PERFORMANCE_DATA
@@ -306,6 +321,20 @@
}
}
+void CVideoPlugin::PausePluginL()
+ {
+ OstTraceFunctionEntry0( CVIDEOPLUGIN_PAUSEPLUGINL_ENTRY );
+ iObjectJobQueueManager->PauseL();
+ OstTraceFunctionExit0( CVIDEOPLUGIN_PAUSEPLUGINL_EXIT );
+ }
+
+void CVideoPlugin::ResumePluginL()
+ {
+ OstTraceFunctionEntry0( CVIDEOPLUGIN_RESUMEPLUGINL_ENTRY );
+ iObjectJobQueueManager->ResumeL();
+ OstTraceFunctionExit0( CVIDEOPLUGIN_RESUMEPLUGINL_EXIT );
+ }
+
#ifdef __PERFORMANCE_DATA
void CVideoPlugin::UpdateLogL()
{
--- a/harvesterplugins/media/video/traces/OstTraceDefinitions.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/video/traces/OstTraceDefinitions.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+/*
+* This is Default Licence added by TraceCompiler
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
#ifndef __OSTTRACEDEFINITIONS_H__
#define __OSTTRACEDEFINITIONS_H__
// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
--- a/harvesterplugins/media/video/traces/cpixmediavideodocTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/video/traces/cpixmediavideodocTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MDS to CPIX Audio Document fetcher
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CPIXMEDIAVIDEODOCTRACES_H__
--- a/harvesterplugins/media/video/traces/fixed_id.definitions Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/video/traces/fixed_id.definitions Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+##
+# This is Default Licence added by TraceCompiler
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+##
#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
[GROUP]TRACE_FLOW=0x8a
[GROUP]TRACE_NORMAL=0x86
@@ -5,6 +22,10 @@
[TRACE]TRACE_FLOW[0x8A]_CCPIXMEDIAVIDEODOC_GETCPIXDOCUMENTL_EXIT=0x2
[TRACE]TRACE_FLOW[0x8A]_CVIDEOPLUGIN_HARVESTINGCOMPLETEDL_ENTRY=0x7
[TRACE]TRACE_FLOW[0x8A]_CVIDEOPLUGIN_HARVESTINGCOMPLETEDL_EXIT=0x8
+[TRACE]TRACE_FLOW[0x8A]_CVIDEOPLUGIN_PAUSEPLUGINL_ENTRY=0x9
+[TRACE]TRACE_FLOW[0x8A]_CVIDEOPLUGIN_PAUSEPLUGINL_EXIT=0xa
+[TRACE]TRACE_FLOW[0x8A]_CVIDEOPLUGIN_RESUMEPLUGINL_ENTRY=0xb
+[TRACE]TRACE_FLOW[0x8A]_CVIDEOPLUGIN_RESUMEPLUGINL_EXIT=0xc
[TRACE]TRACE_FLOW[0x8A]_CVIDEOPLUGIN_STARTHARVESTINGL_ENTRY=0x5
[TRACE]TRACE_FLOW[0x8A]_CVIDEOPLUGIN_STARTHARVESTINGL_EXIT=0x6
[TRACE]TRACE_FLOW[0x8A]_CVIDEOPLUGIN_STARTPLUGINL_ENTRY=0x3
@@ -12,6 +33,7 @@
[TRACE]TRACE_NORMAL[0x86]_CVIDEOPLUGIN_HANDLEMDEITEML=0x1
[TRACE]TRACE_NORMAL[0x86]_DUP10_CVIDEOPLUGIN_HANDLEMDEITEML=0xb
[TRACE]TRACE_NORMAL[0x86]_DUP11_CVIDEOPLUGIN_HANDLEMDEITEML=0xc
+[TRACE]TRACE_NORMAL[0x86]_DUP12_CVIDEOPLUGIN_HANDLEMDEITEML=0xd
[TRACE]TRACE_NORMAL[0x86]_DUP1_CVIDEOPLUGIN_HANDLEMDEITEML=0x2
[TRACE]TRACE_NORMAL[0x86]_DUP2_CVIDEOPLUGIN_HANDLEMDEITEML=0x3
[TRACE]TRACE_NORMAL[0x86]_DUP3_CVIDEOPLUGIN_HANDLEMDEITEML=0x4
--- a/harvesterplugins/media/video/traces/videopluginTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/media/video/traces/videopluginTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.1.2
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Media Video harvester plugin implementation
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __VIDEOPLUGINTRACES_H__
@@ -12,6 +28,10 @@
#define CVIDEOPLUGIN_STARTHARVESTINGL_EXIT 0x8a0006
#define CVIDEOPLUGIN_HARVESTINGCOMPLETEDL_ENTRY 0x8a0007
#define CVIDEOPLUGIN_HARVESTINGCOMPLETEDL_EXIT 0x8a0008
+#define CVIDEOPLUGIN_PAUSEPLUGINL_ENTRY 0x8a0009
+#define CVIDEOPLUGIN_PAUSEPLUGINL_EXIT 0x8a000a
+#define CVIDEOPLUGIN_RESUMEPLUGINL_ENTRY 0x8a000b
+#define CVIDEOPLUGIN_RESUMEPLUGINL_EXIT 0x8a000c
#define CVIDEOPLUGIN_HANDLEMDEITEML 0x860001
#define DUP1_CVIDEOPLUGIN_HANDLEMDEITEML 0x860002
#define DUP2_CVIDEOPLUGIN_HANDLEMDEITEML 0x860003
@@ -24,6 +44,7 @@
#define DUP9_CVIDEOPLUGIN_HANDLEMDEITEML 0x86000a
#define DUP10_CVIDEOPLUGIN_HANDLEMDEITEML 0x86000b
#define DUP11_CVIDEOPLUGIN_HANDLEMDEITEML 0x86000c
+#define DUP12_CVIDEOPLUGIN_HANDLEMDEITEML 0x86000d
#endif
--- a/harvesterplugins/messaging/email/data/20029b09.rss Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/email/data/20029b09.rss Tue Oct 05 13:32:14 2010 +0530
@@ -39,7 +39,7 @@
version_no = 1;
display_name = "Email";
default_data = "Messaging";
- opaque_data = "";
+ opaque_data = "z:\\resource\\qt\\plugins\\searchsrv\\contentconfig\\emailconfig.xml";
}
};
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvesterplugins/messaging/email/data/emailconfig.xml Tue Oct 05 13:32:14 2010 +0530
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<category>
+ <name>Email</name>
+ <mime>application/messaging</mime>
+ <licon>qtg_large_email</licon>
+ <baseapp>root msg email</baseapp>
+ <lname>txt_search_list_messagemail</lname>
+ <displayorder>3</displayorder>
+ <exceptionstring></exceptionstring>
+ <tsfile></tsfile>
+ <actionuri>
+ <uri>
+ <uristring></uristring>
+ <lname></lname>
+ <licon></licon>
+ <uriref></uriref>
+ <action></action><!-- primary action or default action. alternatively, we could always use first entry as this one -->
+ </uri>
+ </actionuri>
+ <fieldmap>
+ <resulthit>
+ <field></field>
+ <auri></auri><!-- alternatively <auriorder>1,2,3,4</auriorder> instead of four lines -->
+ </resulthit>
+ </fieldmap>
+ <indexcontentsize>L</indexcontentsize> <!-- possible values S, M, L, XL, XXL. or scale of 1 to 10. -->
+ <policy>
+ <capability>WriteDeviceData<!-- Allow search on my data from clients with only Write Device Data capability it is combination of SID/VID/capability --></capability>
+ </policy>
+ <resultfirstline>
+ <list>
+ <field>Subject</field><!-- commo seperated list, if there is a chance that certain field could be empty -->
+ <field>Recipients</field>
+ </list>
+ </resultfirstline>
+ <relevancy>
+ <boost>
+ <field>Recipients</field>
+ <boostvalue>10</boostvalue><!-- on scale 1-10 -->
+ </boost>
+ <boost>
+ <field>Subject</field>
+ <boostvalue>5</boostvalue>
+ </boost>
+ </relevancy>
+</category>
--- a/harvesterplugins/messaging/email/group/bld.inf Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/email/group/bld.inf Tue Oct 05 13:32:14 2010 +0530
@@ -20,3 +20,5 @@
emailplugin.mmp
+PRJ_EXPORTS
+../data/emailconfig.xml /epoc32/data/z/resource/qt/plugins/searchsrv/contentconfig/emailconfig.xml
--- a/harvesterplugins/messaging/email/inc/cemailplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/email/inc/cemailplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -51,6 +51,10 @@
*/
void HarvestingCompleted();
+ void PausePluginL();
+
+ void ResumePluginL();
+
/**
* Gets the database observer class
*/
--- a/harvesterplugins/messaging/email/qtemailfetcher/qtemailfetcher.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/email/qtemailfetcher/qtemailfetcher.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -235,9 +235,9 @@
excerpt += msgBody ;
doc->AddExcerptL( qt_QString2TPtrC(excerpt) );
);
- #ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
doc->AddHLDisplayFieldL(qt_QString2TPtrC( const_cast<NmApiMessageEnvelope&>(aEnvelope).sender() ));
- #endif
+//#endif
qDebug() << "QEmailFetcher::getSearchDocumentL :END";
return doc;
}
--- a/harvesterplugins/messaging/email/src/cemailplugin.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/email/src/cemailplugin.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -383,6 +383,16 @@
iObserver->HarvestingCompleted(this, baseAppClass, aError);
}
+void CEmailPlugin::PausePluginL()
+ {
+
+ }
+
+void CEmailPlugin::ResumePluginL()
+ {
+
+ }
+
// ---------------------------------------------------------------------------
// CEmailPlugin::UpdatePerformaceDataL
// ---------------------------------------------------------------------------
--- a/harvesterplugins/messaging/smsmms/data/2001f701.rss Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/data/2001f701.rss Tue Oct 05 13:32:14 2010 +0530
@@ -37,9 +37,9 @@
{
implementation_uid = 0x2001F701;
version_no = 1;
- display_name = "Messages";
+ display_name = "smsmms";
default_data = "Messaging";
- opaque_data = "";
+ opaque_data = "z:\\resource\\qt\\plugins\\searchsrv\\contentconfig\\smsmmsconfig.xml";
}
};
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvesterplugins/messaging/smsmms/data/smsmmsconfig.xml Tue Oct 05 13:32:14 2010 +0530
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<category>
+ <name>smsmms</name>
+ <mime>application/messaging</mime>
+ <licon>qtg_large_message</licon>
+ <baseapp>root msg</baseapp>
+ <lname>txt_search_list_messagemail</lname>
+ <displayorder>3</displayorder>
+ <exceptionstring>(no recipient)</exceptionstring>
+ <tsfile>Z:/resource/qt/translations/messaging_</tsfile>
+ <actionuri>
+ <uri>
+ <uristring></uristring>
+ <lname></lname>
+ <licon></licon>
+ <uriref></uriref>
+ <action></action><!-- primary action or default action. alternatively, we could always use first entry as this one -->
+ </uri>
+ </actionuri>
+ <fieldmap>
+ <resulthit>
+ <field></field>
+ <auri></auri><!-- alternatively <auriorder>1,2,3,4</auriorder> instead of four lines -->
+ </resulthit>
+ </fieldmap>
+ <indexcontentsize>L</indexcontentsize> <!-- possible values S, M, L, XL, XXL. or scale of 1 to 10. -->
+ <policy>
+ <capability>WriteDeviceData<!-- Allow search on my data from clients with only Write Device Data capability it is combination of SID/VID/capability --></capability>
+ </policy>
+ <resultfirstline>
+ <list>
+ <field>To</field><!-- commo seperated list, if there is a chance that certain field could be empty -->
+ <field>From</field>
+ </list>
+ </resultfirstline>
+ <relevancy>
+ <boost>
+ <field>To</field>
+ <boostvalue>10</boostvalue><!-- on scale 1-10 -->
+ </boost>
+ <boost>
+ <field>From</field>
+ <boostvalue>5</boostvalue>
+ </boost>
+ <boost>
+ <field>Body</field>
+ <boostvalue>7</boostvalue>
+ </boost>
+ </relevancy>
+</category>
--- a/harvesterplugins/messaging/smsmms/group/bld.inf Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/group/bld.inf Tue Oct 05 13:32:14 2010 +0530
@@ -20,3 +20,5 @@
messageplugin.mmp
+PRJ_EXPORTS
+../data/smsmmsconfig.xml /epoc32/data/z/resource/qt/plugins/searchsrv/contentconfig/smsmmsconfig.xml
--- a/harvesterplugins/messaging/smsmms/inc/cmessagedatahandler.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/inc/cmessagedatahandler.h Tue Oct 05 13:32:14 2010 +0530
@@ -55,6 +55,8 @@
* @param TMsvId& aFolderId Id of the folder where message is located
*/
void GatherDataL(TMsvId& aMessageId, TCPixActionType aActionType, TMsvId& aFolderId);
+
+ void ResumeL();
private:
//From CActive
--- a/harvesterplugins/messaging/smsmms/inc/cmessageharvester.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/inc/cmessageharvester.h Tue Oct 05 13:32:14 2010 +0530
@@ -46,6 +46,8 @@
* Start harvesting message items
*/
void StartHarvestingL();
+
+ void ResumeRequest();
private: //From CActive
--- a/harvesterplugins/messaging/smsmms/inc/cmessagemonitor.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/inc/cmessagemonitor.h Tue Oct 05 13:32:14 2010 +0530
@@ -65,6 +65,8 @@
*/
void HandleMsgDeletedL( const CMsvEntrySelection& aSelection );
+ void ResumeL();
+
protected:
/**
* inherited from CActive
--- a/harvesterplugins/messaging/smsmms/inc/cmessageplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/inc/cmessageplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -52,7 +52,9 @@
*/
void StartPluginL();
void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
-
+ void PausePluginL();
+ void ResumePluginL();
+
/**
* callback from MMsvSessionObserver
*/
@@ -117,6 +119,10 @@
* returns ETrue if it is removable else EFalse.
*/
TBool IsMediaRemovableL(TDriveNumber& aDrive);
+
+ TBool GetHarvesterState();
+
+ void MountAvailableDrivesInQueue();
public:
/*
@@ -142,6 +148,10 @@
// CPix indexer
CCPixIndexer* iIndexer[EDriveZ+1]; // EDriveZ enum value is 25, so add 1.
+ TBool iIndexState;
+
+ RArray<TDriveNumber> iMountDrives;
+
#ifdef HARVESTERPLUGINTESTER_FRIEND
friend class CHarvesterPluginTester;
#endif
--- a/harvesterplugins/messaging/smsmms/src/cmessagedatahandler.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/src/cmessagedatahandler.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -42,7 +42,7 @@
/** Number of symbols from MsgBody taken to excerpt */
-const TInt KMsgBodyExcerptSymbols = 160;
+//const TInt KMsgBodyExcerptSymbols = 160;
// For Ucs2 detection
const TInt KUtf8BomLength = 3;
@@ -51,7 +51,7 @@
// CSearchDocument ID max length
const TUint KMaxDocId = 20;
// Hardcoded limit for the body size to index (and store)
-const TInt KMaxDocumentSize = 1024;
+//const TInt KMaxDocumentSize = 1024;
_LIT8(KMimeTypeText, "text/plain" );
@@ -60,17 +60,17 @@
/** Field names */
_LIT(KToField, TO_FIELD);
-_LIT(KCcField, CC_FIELD);
-_LIT(KBccField, BCC_FIELD);
+//_LIT(KCcField, CC_FIELD);
+//_LIT(KBccField, BCC_FIELD);
_LIT(KFromField, FROM_FIELD);
_LIT(KFolderField, FOLDER_FIELD);
_LIT(KBodyField, BODY_FIELD);
_LIT(KSubjectField, SUBJECT_FIELD);
_LIT(KAttachmentField, ATTACHMENT_FIELD);
_LIT(KValueAttachment, "Attachment");
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
_LIT(KExcerptDelimiter, " ");
-#endif
+//#endif
// ============================ MEMBER FUNCTIONS ===============================
// ---------------------------------------------------------------------------
@@ -192,6 +192,7 @@
{
OstTrace1( TRACE_NORMAL, CMESSAGEDATAHANDLER_CREATEMESSAGEINDEXITEML, "CMessageDataHandler::CreateMessageIndexItemL;aMsvId=%d", aMsvId );
CPIXLOGSTRING2("CMessageDataHandler::CreateMessageIndexItemL(): aMsvId = %d ", aMsvId );
+ OstTrace0( TRACE_NORMAL, DUP5_CMESSAGEDATAHANDLER_CREATEMESSAGEINDEXITEML, "CMessageDataHandler::Indexing Message" );
// Index an empty item if removal action
if (aActionType == ECPixRemoveAction)
@@ -302,19 +303,19 @@
HBufC *fromNameOrNumberBuf = entry.iDetails.AllocLC();
index_item->AddFieldL(KFromField, *fromNameOrNumberBuf,
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText);
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
if( aFolderId == KMsvGlobalInBoxIndexEntryIdValue)
{
index_item->AddHLDisplayFieldL(*fromNameOrNumberBuf);
}
-#endif
+//#endif
// Add the recipients as content items
TBuf<64> to_field;
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
HBufC* toList = HBufC::NewL(5);
-#endif
+//#endif
const CDesCArray
& recipientArray =
static_cast<const CDesCArray&> (iSmsMtm->AddresseeList().RecipientList());
@@ -326,7 +327,7 @@
index_item->AddFieldL(to_field, recipientArray.MdcaPoint(i),
CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText);
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
// Folder field
// Iterate through the list of recipients and add them under To field
if( aFolderId != KMsvGlobalInBoxIndexEntryIdValue)
@@ -341,16 +342,16 @@
ptr.Append(recipientArray.MdcaPoint(i));
ptr.Append(KExcerptDelimiter);
}
-#endif
+//#endif
}
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
if( aFolderId != KMsvGlobalInBoxIndexEntryIdValue)
{
index_item->AddHLDisplayFieldL( *toList);
}
delete toList;
toList = NULL;
-#endif
+//#endif
// Add the body text as a content item
TInt msgLength = iSmsMtm->Body().DocumentLength();
HBufC* bodyText = HBufC::NewLC(msgLength);
@@ -389,18 +390,18 @@
// Add from field
index_item->AddFieldL(KFromField, iMmsMtm->Sender());
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
if( aFolderId == KMsvGlobalInBoxIndexEntryIdValue)
{
index_item->AddHLDisplayFieldL(iMmsMtm->Sender());
}
-#endif
+//#endif
// Add the recipients as content items
TBuf<64> to_field;
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
HBufC* toList = HBufC::NewL(5);
-#endif
+//#endif
const CDesCArray
& recipientArray =
static_cast<const CDesCArray&> (iMmsMtm->AddresseeList().RecipientList());
@@ -411,7 +412,7 @@
to_field.AppendNum(i);
index_item->AddFieldL(to_field, recipientArray.MdcaPoint(i));
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
// Folder field
// Iterate through the list of recipients and add them under To field
if( aFolderId != KMsvGlobalInBoxIndexEntryIdValue)
@@ -426,17 +427,17 @@
ptr.Append(recipientArray.MdcaPoint(i));
ptr.Append(KExcerptDelimiter);
}
-#endif
+//#endif
}
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
if( aFolderId != KMsvGlobalInBoxIndexEntryIdValue)
{
index_item->AddHLDisplayFieldL( *toList);
}
delete toList;
toList = NULL;
-#endif
+//#endif
// Add subject
TPtrC subject(iMmsMtm->SubjectL());
index_item->AddFieldL(KSubjectField, subject);
@@ -565,11 +566,11 @@
_LIT(KEllipsis, "...");
_LIT(KSpace, " ");
//
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
TInt excerptLength = aBodyText.Length() + KEllipsis().Length();
-#else
- TInt excerptLength = KMsgBodyExcerptSymbols + KEllipsis().Length();
-#endif
+//#else
+// TInt excerptLength = KMsgBodyExcerptSymbols + KEllipsis().Length();
+//#endif
//Not removing commented out code as this may come back into use in near future.
// TMsvEntry entry;
// TMsvId service = 0;
@@ -623,13 +624,13 @@
// excerptPtr.Append(aSubject);
// excerptPtr.Append(KSpace);
// }
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
excerptPtr.Append(aBodyText);
-#else
- excerptPtr.Append(aBodyText.Left(KMsgBodyExcerptSymbols));
- if (aBodyText.Length() > KMsgBodyExcerptSymbols)
- excerptPtr.Append(KEllipsis);
-#endif
+//#else
+// excerptPtr.Append(aBodyText.Left(KMsgBodyExcerptSymbols));
+// if (aBodyText.Length() > KMsgBodyExcerptSymbols)
+// excerptPtr.Append(KEllipsis);
+//#endif
// CleanupStack::PopAndDestroy(folder_str);
CleanupStack::PushL(excerpt);
return excerpt;
@@ -856,13 +857,30 @@
//
void CMessageDataHandler::HandleNextRequest()
{
- if (!IsActive())
+ OstTraceFunctionEntry0( CMESSAGEDATAHANDLER_HANDLENEXTREQUEST_ENTRY );
+ if (!IsActive() && iMessagePlugin.GetHarvesterState())
{
SetActive();
TRequestStatus* status = &iStatus;
User::RequestComplete(status, KErrNone);
}
+ OstTraceFunctionExit0( CMESSAGEDATAHANDLER_HANDLENEXTREQUEST_EXIT );
}
+void CMessageDataHandler::ResumeL()
+ {
+ OstTraceFunctionEntry0( CMESSAGEDATAHANDLER_RESUMEL_ENTRY );
+ if (iMessageArray.Count() > 0 && iMessagePlugin.GetHarvesterState())
+ {
+ // Take first id from array
+ CreateMessageIndexItemL(iMessageArray[0].iMessageId,
+ iMessageArray[0].iActionType, iMessageArray[0].iFolderId);
+
+ // Remove item that is handled
+ iMessageArray.Remove(0);
+ }
+ OstTraceFunctionExit0( CMESSAGEDATAHANDLER_RESUMEL_EXIT );
+ }
+
// End of File
--- a/harvesterplugins/messaging/smsmms/src/cmessageharvester.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/src/cmessageharvester.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -30,6 +30,11 @@
#include <msvuids.h>
#include <mmsconst.h>
#include "cmessageharvester.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cmessageharvesterTraces.h"
+#endif
+
// ============================ MEMBER FUNCTIONS ===============================
@@ -180,8 +185,8 @@
{
if (iChildren && iChildren->Count() > 0)
{
- // Take first item from list of message items, and give it for indexing
- iMessagePlugin.MessageItemL((*iChildren)[0], ECPixAddAction, iCurrentFolder);
+ // Take first item from list of message items, and give it for indexing
+ iMessagePlugin.MessageItemL((*iChildren)[0], ECPixAddAction, iCurrentFolder);
// Delete the item from list
iChildren->Delete( 0 );
@@ -276,13 +281,23 @@
//
void CMessageHarvester::HandleNextRequest()
{
- if (!IsActive())
+ OstTraceFunctionEntry0( CMESSAGEHARVESTER_HANDLENEXTREQUEST_ENTRY );
+ if (!IsActive() && iMessagePlugin.GetHarvesterState())
{
SetActive();
TRequestStatus* status = &iStatus;
User::RequestComplete( status, KErrNone );
}
+ OstTraceFunctionExit0( CMESSAGEHARVESTER_HANDLENEXTREQUEST_EXIT );
}
-
+void CMessageHarvester::ResumeRequest()
+ {
+ OstTraceFunctionEntry0( CMESSAGEHARVESTER_RESUMEREQUEST_ENTRY );
+ if(iState != EStateIdle)
+ {
+ HandleNextRequest();
+ }
+ OstTraceFunctionExit0( CMESSAGEHARVESTER_RESUMEREQUEST_EXIT );
+ }
// End of File
--- a/harvesterplugins/messaging/smsmms/src/cmessagemonitor.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/src/cmessagemonitor.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -278,5 +278,17 @@
return KErrNone; // Don't panic
}
+void CMessageMonitor::ResumeL()
+ {
+ OstTraceFunctionEntry0( CMESSAGEMONITOR_RESUMEL_ENTRY );
+ while (iMessages.Count()>0 && iMessagePlugin.GetHarvesterState())
+ {
+ TMessageRecord message = iMessages[0];
+ iMessages.Remove(0);
+ iMessagePlugin.MessageItemL(message.iMsvId, message.iAction, message.iFolderId);
+ }
+ OstTraceFunctionExit0( CMESSAGEMONITOR_RESUMEL_EXIT );
+ }
+
// End Of File
--- a/harvesterplugins/messaging/smsmms/src/cmessageplugin.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/src/cmessageplugin.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -131,6 +131,7 @@
// remove notification paths before destroying iMonitor
for (TInt i=EDriveA; i<=EDriveZ; i++)
UnMount(TDriveNumber(i), EFalse);
+ iMountDrives.Close();
delete iMessageDataHandler;
delete iMessageHarvester;
delete iMessageMonitor;
@@ -144,6 +145,7 @@
//
void CMessagePlugin::ConstructL()
{
+ iIndexState = ETrue;
TInt err = iFs.Connect();
OstTrace1( TRACE_NORMAL, CMESSAGEPLUGIN_CONSTRUCTL, "CMessagePlugin::ConstructL;iFs Connect Error=%d", err );
CPIXLOGSTRING2("CMessagePlugin::ConstructL, iFs.Connect: %i", err);
@@ -195,7 +197,14 @@
#ifdef __PERFORMANCE_DATA
iStartTime.UniversalTime();
#endif
- iMessageHarvester->StartHarvestingL();
+ if( iIndexState )
+ {
+ iMessageHarvester->StartHarvestingL();
+ }
+ else
+ {
+ iMountDrives.Append(TDriveNumber(drive));
+ }
OstTraceFunctionExit0( CMESSAGEPLUGIN_STARTHARVESTINGL_EXIT );
}
@@ -536,6 +545,42 @@
iObserver->HarvestingCompleted(this, baseAppClass, aError);
}
+void CMessagePlugin::PausePluginL()
+ {
+ OstTraceFunctionEntry0( CMESSAGEPLUGIN_PAUSEPLUGINL_ENTRY );
+ iIndexState = EFalse;
+ OstTraceFunctionExit0( CMESSAGEPLUGIN_PAUSEPLUGINL_EXIT );
+ }
+
+void CMessagePlugin::ResumePluginL()
+ {
+ OstTraceFunctionEntry0( CMESSAGEPLUGIN_RESUMEPLUGINL_ENTRY );
+ iIndexState = ETrue;
+ //IndexQueuedItems();
+ iMessageDataHandler->ResumeL();
+ iMessageMonitor->ResumeL();
+ iMessageHarvester->ResumeRequest();
+ MountAvailableDrivesInQueue();
+ OstTraceFunctionExit0( CMESSAGEPLUGIN_RESUMEPLUGINL_EXIT );
+ }
+
+void CMessagePlugin::MountAvailableDrivesInQueue()
+ {
+ OstTraceFunctionEntry0( CMESSAGEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_ENTRY );
+ for(TInt i=0;i<iMountDrives.Count();i++)
+ {
+ TDriveNumber drive = iMountDrives[i];
+ iMountDrives.Remove(i);
+ iMessageHarvester->StartHarvestingL();
+ }
+ OstTraceFunctionExit0( CMESSAGEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_EXIT );
+ }
+
+TBool CMessagePlugin::GetHarvesterState()
+ {
+ return iIndexState;
+ }
+
// ---------------------------------------------------------------------------
// CMessagePlugin::UpdatePerformaceDataL
// ---------------------------------------------------------------------------
--- a/harvesterplugins/messaging/smsmms/traces/OstTraceDefinitions.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/traces/OstTraceDefinitions.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+/*
+* This is Default Licence added by TraceCompiler
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
#ifndef __OSTTRACEDEFINITIONS_H__
#define __OSTTRACEDEFINITIONS_H__
// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
--- a/harvesterplugins/messaging/smsmms/traces/cmessagedatahandlerTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/traces/cmessagedatahandlerTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.2.3
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Harvester message plugin
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CMESSAGEDATAHANDLERTRACES_H__
@@ -10,6 +26,10 @@
#define CMESSAGEDATAHANDLER_NEWL_EXIT 0x8a0002
#define CMESSAGEDATAHANDLER_ISVALIDMESSAGETYPE_ENTRY 0x8a0003
#define CMESSAGEDATAHANDLER_ISVALIDMESSAGETYPE_EXIT 0x8a0004
+#define CMESSAGEDATAHANDLER_HANDLENEXTREQUEST_ENTRY 0x8a001b
+#define CMESSAGEDATAHANDLER_HANDLENEXTREQUEST_EXIT 0x8a001c
+#define CMESSAGEDATAHANDLER_RESUMEL_ENTRY 0x8a001d
+#define CMESSAGEDATAHANDLER_RESUMEL_EXIT 0x8a001e
#define CMESSAGEDATAHANDLER_CONSTRUCTL 0x860001
#define DUP1_CMESSAGEDATAHANDLER_CONSTRUCTL 0x860002
#define CMESSAGEDATAHANDLER_ISVALIDMESSAGETYPE 0x860003
@@ -24,6 +44,7 @@
#define DUP14_CMESSAGEDATAHANDLER_CREATEMESSAGEINDEXITEML 0x860013
#define CMESSAGEDATAHANDLER_RUNL 0x860014
#define CMESSAGEDATAHANDLER_RUNERROR 0x860015
+#define DUP5_CMESSAGEDATAHANDLER_CREATEMESSAGEINDEXITEML 0x86002e
#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvesterplugins/messaging/smsmms/traces/cmessageharvesterTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Harvester message plugin
+*
+*/
+// Created by TraceCompiler 2.3.0
+// DO NOT EDIT, CHANGES WILL BE LOST
+
+#ifndef __CMESSAGEHARVESTERTRACES_H__
+#define __CMESSAGEHARVESTERTRACES_H__
+
+#define KOstTraceComponentID 0x2001f701
+
+#define CMESSAGEHARVESTER_HANDLENEXTREQUEST_ENTRY 0x8a001f
+#define CMESSAGEHARVESTER_HANDLENEXTREQUEST_EXIT 0x8a0020
+#define CMESSAGEHARVESTER_RESUMEREQUEST_ENTRY 0x8a0021
+#define CMESSAGEHARVESTER_RESUMEREQUEST_EXIT 0x8a0022
+
+
+#endif
+
+// End of file
+
--- a/harvesterplugins/messaging/smsmms/traces/cmessagemonitorTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/traces/cmessagemonitorTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.2.3
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CMESSAGEMONITORTRACES_H__
@@ -16,6 +32,8 @@
#define CMESSAGEMONITOR_HANDLEMSGCREATEDCHANGEDL_EXIT 0x8a000c
#define CMESSAGEMONITOR_HANDLEMSGDELETEDL_ENTRY 0x8a000d
#define CMESSAGEMONITOR_HANDLEMSGDELETEDL_EXIT 0x8a000e
+#define CMESSAGEMONITOR_RESUMEL_ENTRY 0x8a0023
+#define CMESSAGEMONITOR_RESUMEL_EXIT 0x8a0024
#define CMESSAGEMONITOR_HANDLEMSGMOVEDL 0x860016
#define CMESSAGEMONITOR_HANDLEMSGCREATEDCHANGEDL 0x860017
#define DUP1_CMESSAGEMONITOR_HANDLEMSGCREATEDCHANGEDL 0x860018
--- a/harvesterplugins/messaging/smsmms/traces/cmessagepluginTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/traces/cmessagepluginTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.2.3
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __CMESSAGEPLUGINTRACES_H__
@@ -18,6 +34,12 @@
#define CMESSAGEPLUGIN_HANDLESESSIONEVENTL_EXIT 0x8a0018
#define CMESSAGEPLUGIN_CALCULATEMESSAGETYPE_ENTRY 0x8a0019
#define CMESSAGEPLUGIN_CALCULATEMESSAGETYPE_EXIT 0x8a001a
+#define CMESSAGEPLUGIN_PAUSEPLUGINL_ENTRY 0x8a0025
+#define CMESSAGEPLUGIN_PAUSEPLUGINL_EXIT 0x8a0026
+#define CMESSAGEPLUGIN_RESUMEPLUGINL_ENTRY 0x8a0027
+#define CMESSAGEPLUGIN_RESUMEPLUGINL_EXIT 0x8a0028
+#define CMESSAGEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_ENTRY 0x8a0029
+#define CMESSAGEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_EXIT 0x8a002a
#define CMESSAGEPLUGIN_CONSTRUCTL 0x86001f
#define CMESSAGEPLUGIN_STARTPLUGINL 0x860020
#define CMESSAGEPLUGIN_MOUNTL 0x860021
--- a/harvesterplugins/messaging/smsmms/traces/fixed_id.definitions Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/messaging/smsmms/traces/fixed_id.definitions Tue Oct 05 13:32:14 2010 +0530
@@ -1,10 +1,35 @@
+##
+# This is Default Licence added by TraceCompiler
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+##
#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
[GROUP]TRACE_FLOW=0x8a
[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEDATAHANDLER_HANDLENEXTREQUEST_ENTRY=0x1b
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEDATAHANDLER_HANDLENEXTREQUEST_EXIT=0x1c
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEDATAHANDLER_ISVALIDMESSAGETYPE_ENTRY=0x3
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEDATAHANDLER_ISVALIDMESSAGETYPE_EXIT=0x4
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEDATAHANDLER_NEWL_ENTRY=0x1
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEDATAHANDLER_NEWL_EXIT=0x2
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEDATAHANDLER_RESUMEL_ENTRY=0x1d
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEDATAHANDLER_RESUMEL_EXIT=0x1e
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEHARVESTER_HANDLENEXTREQUEST_ENTRY=0x1f
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEHARVESTER_HANDLENEXTREQUEST_EXIT=0x20
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEHARVESTER_RESUMEREQUEST_ENTRY=0x21
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEHARVESTER_RESUMEREQUEST_EXIT=0x22
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEMONITOR_CMESSAGEMONITOR_ENTRY=0x5
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEMONITOR_CMESSAGEMONITOR_EXIT=0x6
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEMONITOR_CONSTRUCTL_ENTRY=0x7
@@ -15,14 +40,22 @@
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEMONITOR_HANDLEMSGDELETEDL_EXIT=0xe
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEMONITOR_HANDLEMSGMOVEDL_ENTRY=0x9
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEMONITOR_HANDLEMSGMOVEDL_EXIT=0xa
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEMONITOR_RESUMEL_ENTRY=0x23
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEMONITOR_RESUMEL_EXIT=0x24
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_CALCULATEMESSAGETYPE_ENTRY=0x19
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_CALCULATEMESSAGETYPE_EXIT=0x1a
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_DATABASEPATHLC_ENTRY=0x15
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_DATABASEPATHLC_EXIT=0x16
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_HANDLESESSIONEVENTL_ENTRY=0x17
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_HANDLESESSIONEVENTL_EXIT=0x18
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_ENTRY=0x29
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_EXIT=0x2a
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_MOUNTL_ENTRY=0x11
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_MOUNTL_EXIT=0x12
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_PAUSEPLUGINL_ENTRY=0x25
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_PAUSEPLUGINL_EXIT=0x26
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_RESUMEPLUGINL_ENTRY=0x27
+[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_RESUMEPLUGINL_EXIT=0x28
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_STARTHARVESTINGL_ENTRY=0xf
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_STARTHARVESTINGL_EXIT=0x10
[TRACE]TRACE_FLOW[0x8A]_CMESSAGEPLUGIN_UNMOUNT_ENTRY=0x13
@@ -54,6 +87,7 @@
[TRACE]TRACE_NORMAL[0x86]_DUP3_CMESSAGEPLUGIN_HANDLESESSIONEVENTL=0x25
[TRACE]TRACE_NORMAL[0x86]_DUP4_CMESSAGEDATAHANDLER_CREATEMESSAGEINDEXITEML=0x9
[TRACE]TRACE_NORMAL[0x86]_DUP4_CMESSAGEMONITOR_HANDLEMSGCREATEDCHANGEDL=0x1a
+[TRACE]TRACE_NORMAL[0x86]_DUP5_CMESSAGEDATAHANDLER_CREATEMESSAGEINDEXITEML=0x2e
[TRACE]TRACE_NORMAL[0x86]_DUP5_CMESSAGEMONITOR_HANDLEMSGCREATEDCHANGEDL=0x1b
[TRACE]TRACE_NORMAL[0x86]_DUP5_CMESSAGEPLUGIN_CALCULATEMESSAGETYPE=0x2b
[TRACE]TRACE_NORMAL[0x86]_DUP6_CMESSAGEMONITOR_HANDLEMSGCREATEDCHANGEDL=0x1c
--- a/harvesterplugins/notes/data/2001a9d8.rss Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/notes/data/2001a9d8.rss Tue Oct 05 13:32:14 2010 +0530
@@ -38,7 +38,7 @@
version_no = 1;
display_name = "Notes";
default_data = "Notes";
- opaque_data = "";
+ opaque_data = "z:\\resource\\qt\\plugins\\searchsrv\\contentconfig\\notesconfig.xml";
}
};
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/harvesterplugins/notes/data/notesconfig.xml Tue Oct 05 13:32:14 2010 +0530
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<category>
+ <name>Notes</name>
+ <mime>application/notes</mime>
+ <licon>qtg_large_notes</licon>
+ <baseapp>root notes</baseapp>
+ <lname>txt_search_list_calendarnotes</lname>
+ <displayorder>4</displayorder>
+ <exceptionstring>txt_notes_dblist_unnamed</exceptionstring>
+ <tsfile>Z:/resource/qt/translations/notes_</tsfile>
+ <actionuri>
+ <uri>
+ <uristring></uristring>
+ <lname></lname>
+ <licon></licon>
+ <uriref></uriref>
+ <action></action><!-- primary action or default action. alternatively, we could always use first entry as this one -->
+ </uri>
+ </actionuri>
+ <fieldmap>
+ <resulthit>
+ <field></field>
+ <auri></auri><!-- alternatively <auriorder>1,2,3,4</auriorder> instead of four lines -->
+ </resulthit>
+ </fieldmap>
+ <indexcontentsize>L</indexcontentsize> <!-- possible values S, M, L, XL, XXL. or scale of 1 to 10. -->
+ <policy>
+ <capability>WriteDeviceData<!-- Allow search on my data from clients with only Write Device Data capability it is combination of SID/VID/capability --></capability>
+ </policy>
+ <resultfirstline>
+ <list>
+ <field>Memo</field><!-- commo seperated list, if there is a chance that certain field could be empty -->
+ <field>Date</field>
+ </list>
+ </resultfirstline>
+ <relevancy>
+ <boost>
+ <field>Memo</field>
+ <boostvalue>10</boostvalue><!-- on scale 1-10 -->
+ </boost>
+ <boost>
+ <field>Date</field>
+ <boostvalue>5</boostvalue>
+ </boost>
+ </relevancy>
+</category>
--- a/harvesterplugins/notes/group/bld.inf Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/notes/group/bld.inf Tue Oct 05 13:32:14 2010 +0530
@@ -19,3 +19,5 @@
PRJ_MMPFILES
notesplugin.mmp
+PRJ_EXPORTS
+../data/notesconfig.xml /epoc32/data/z/resource/qt/plugins/searchsrv/contentconfig/notesconfig.xml
--- a/harvesterplugins/notes/inc/notesplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/notes/inc/notesplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -38,7 +38,18 @@
class CNotesPlugin : public CIndexingPlugin, public MDelayedCallbackObserver, public MCalChangeCallBack2
{
-public: // Constructors and destructor
+public: // Constructors and destructo
+
+ enum THarvesterState
+ {
+ EHarvesterIdleState,
+ EHarvesterStartHarvest
+ };
+ struct TRecord
+ {
+ TCalLocalUid iLocalUid;
+ TCPixActionType iActionType;
+ };
/*
* NewL
* @return instance of Notes plugin
@@ -57,6 +68,8 @@
public: // From CIndexingPlugin
void StartPluginL();
void StartHarvestingL(const TDesC& aQualifiedBaseAppClass);
+ void PausePluginL();
+ void ResumePluginL();
public: // From MCalChangeCallBack2
@@ -90,6 +103,10 @@
* Leaves in case of errors.
*/
void InitTimeValuesL( TTime& aStartTime, TTime& aEndTime );
+
+ void OverWriteOrAddToQueueL(const TCalLocalUid& aLocalUid, TCPixActionType aActionType);
+
+ void IndexQueuedItems();
private: // Constructors
@@ -126,6 +143,13 @@
//Notes count
TInt iNoteCount;
+ //State of harvester either to pause/resume
+ TBool iIndexState;
+ // Queue of documents to be indexed
+ RArray<TRecord> iJobQueue;
+ //harvesting state
+ THarvesterState iHarvestState;
+
//for unit testing.
#ifdef HARVESTERPLUGINTESTER_FRIEND
friend class CHarvesterPluginTester;
--- a/harvesterplugins/notes/src/notesplugin.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/notes/src/notesplugin.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -55,7 +55,7 @@
//Reference from CPix calender harvester plugin.
_LIT(KNotesTimeFormat,"%04d %02d %02d %02d %02d");
-_LIT(KExcerptDelimiter, " ");
+//_LIT(KExcerptDelimiter, " ");
// ---------------------------------------------------------------------------
// CNotesPlugin::NewL
// ---------------------------------------------------------------------------
@@ -99,6 +99,8 @@
delete iIndexer;
delete iNotesInstanceView;
delete iEntryView;
+ iJobQueue.Reset();
+ iJobQueue.Close();
iNotesInstanceArray.ResetAndDestroy();
if( iSession )
{
@@ -113,6 +115,7 @@
//
void CNotesPlugin::ConstructL()
{
+ iIndexState = ETrue;
iAsynchronizer = CDelayedCallback::NewL( CActive::EPriorityIdle );
iSession = CCalSession::NewL();
TRAPD ( err , iSession->OpenL( iSession->DefaultFileNameL() ) );
@@ -171,6 +174,7 @@
OstTraceFunctionEntry0( CNOTESPLUGIN_STARTHARVESTINGL_ENTRY );
CPIXLOGSTRING("CNotesPlugin::StartHarvestingL: Enter");
iIndexer->ResetL();
+ iHarvestState = EHarvesterStartHarvest;
//Have taken start time and end time reference from calender plugin
TTime startTime , endTime;
InitTimeValuesL( startTime , endTime );
@@ -199,6 +203,10 @@
OstTraceFunctionEntry0( CNOTESPLUGIN_DELAYEDCALLBACKL_ENTRY );
// Harvest items on each call
CPIXLOGSTRING("CNotesPlugin::DelayedCallbackL: Enter");
+ //If paused state
+ if(!iIndexState)
+ return;
+
if( iNoteCount )
{
OstTrace1( TRACE_NORMAL, CNOTESPLUGIN_DELAYEDCALLBACKL, "CNotesPlugin::DelayedCallbackL;Remaining Notes Count=%d", iNoteCount );
@@ -219,7 +227,8 @@
#ifdef __PERFORMANCE_DATA
UpdatePerformaceDataL();
#endif
- iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), KErrNone);
+ iHarvestState = EHarvesterIdleState;
+ iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), KErrNone);
}
OstTraceFunctionExit0( CNOTESPLUGIN_DELAYEDCALLBACKL_EXIT );
}
@@ -232,6 +241,7 @@
{
// Harvesting was completed
Flush(*iIndexer);
+ iHarvestState = EHarvesterIdleState;
iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), aError);
}
@@ -266,7 +276,10 @@
{
OstTrace1( TRACE_NORMAL, CNOTESPLUGIN_HANDLENOTECHANGEDENTRYL, "CNotesPlugin::HandleNoteChangedEntryL;Monitored add id=%d", changedEntry.iEntryId );
CPIXLOGSTRING2("CNotesPlugin::HandleNoteChangedEntryL(): Monitored add id=%d.", changedEntry.iEntryId);
- CreateNoteEntryL( changedEntry.iEntryId, ECPixAddAction );
+ if( iIndexState )
+ CreateNoteEntryL( changedEntry.iEntryId, ECPixAddAction );
+ else
+ OverWriteOrAddToQueueL(changedEntry.iEntryId, ECPixAddAction);
break;
}
@@ -274,7 +287,10 @@
{
OstTrace1( TRACE_NORMAL, DUP1_CNOTESPLUGIN_HANDLENOTECHANGEDENTRYL, "CNotesPlugin::HandleNoteChangedEntryL;Monitored delete id=%d", changedEntry.iEntryId );
CPIXLOGSTRING2("CNotesPlugin::HandleNoteChangedEntryL(): Monitored delete id=%d.", changedEntry.iEntryId);
- CreateNoteEntryL( changedEntry.iEntryId, ECPixRemoveAction );
+ if( iIndexState )
+ CreateNoteEntryL( changedEntry.iEntryId, ECPixRemoveAction );
+ else
+ OverWriteOrAddToQueueL(changedEntry.iEntryId, ECPixRemoveAction);
break;
}
@@ -282,7 +298,10 @@
{
OstTrace1( TRACE_NORMAL, DUP2_CNOTESPLUGIN_HANDLENOTECHANGEDENTRYL, "CNotesPlugin::HandleNoteChangedEntryL;Monitored update id=%d", changedEntry.iEntryId );
CPIXLOGSTRING2("CNotesPlugin::HandleNoteChangedEntryL(): Monitored update id=%d.", changedEntry.iEntryId);
- CreateNoteEntryL( changedEntry.iEntryId, ECPixUpdateAction );
+ if( iIndexState )
+ CreateNoteEntryL( changedEntry.iEntryId, ECPixUpdateAction );
+ else
+ OverWriteOrAddToQueueL(changedEntry.iEntryId, ECPixUpdateAction);
break;
}
@@ -297,6 +316,7 @@
// Now add it to the harvesting queue and force a reharvest.
Flush(*iIndexer);
+ iJobQueue.Reset();
iObserver->HarvestingCompleted(this, iIndexer->GetBaseAppClass(), KErrCancel);
iObserver->RemoveHarvestingQueue(this, iIndexer->GetBaseAppClass());
iObserver->AddHarvestingQueue(this, iIndexer->GetBaseAppClass(), ETrue);
@@ -340,6 +360,8 @@
CleanupStack::PopAndDestroy(entry);
return;
}
+ OstTrace0( TRACE_NORMAL, DUP4_CNOTESPLUGIN_CREATENOTEENTRYL, "CNotesPlugin::Indexing Notes" );
+
OstTrace0( TRACE_NORMAL, DUP2_CNOTESPLUGIN_CREATENOTEENTRYL, "CNotesPlugin::CreateNoteEntryL(): Creating document." );
CPIXLOGSTRING("CNotesPlugin::CreateNoteEntryL(): Creating document.");
CSearchDocument* index_item = CSearchDocument::NewLC(docid_str, _L(NOTESAPPCLASS));
@@ -360,7 +382,7 @@
//For notes, no content is expected in excerpt for now.
//See appclass-hierarchy.txt for details.
-#ifdef USE_HIGHLIGHTER
+//#ifdef USE_HIGHLIGHTER
_LIT(KExcerptTimeFormat,"%04d/%02d/%02d %02d:%02d");
index_item->AddHLDisplayFieldL(entry->DescriptionL());
@@ -371,7 +393,7 @@
datetime.Minute());
index_item->AddExcerptL(dateString);
-#endif
+//#endif
// Send for indexing
if (aActionType == ECPixAddAction)
@@ -443,6 +465,81 @@
CPIXLOGSTRING2("CNotesPlugin::InitTimeValuesL: Exit with Error = %d", error);
OstTraceFunctionExit0( CNOTESPLUGIN_INITTIMEVALUESL_EXIT );
}
+// ---------------------------------------------------------------------------
+// CNotesPlugin::PausePluginL
+// ---------------------------------------------------------------------------
+//
+void CNotesPlugin::PausePluginL()
+ {
+ OstTraceFunctionEntry0( CNOTESPLUGIN_PAUSEPLUGINL_ENTRY );
+ iIndexState = EFalse;
+ OstTraceFunctionExit0( CNOTESPLUGIN_PAUSEPLUGINL_EXIT );
+ }
+// ---------------------------------------------------------------------------
+// CNotesPlugin::ResumePluginL
+// ---------------------------------------------------------------------------
+//
+void CNotesPlugin::ResumePluginL()
+ {
+ OstTraceFunctionEntry0( CNOTESPLUGIN_RESUMEPLUGINL_ENTRY );
+ iIndexState = ETrue;
+
+ if(iHarvestState == EHarvesterStartHarvest)
+ {
+ if(iAsynchronizer->CallbackPending())
+ iAsynchronizer->CancelCallback();
+ iAsynchronizer->Start( 0, this, KHarvestingDelay );
+ }
+ else
+ {
+ IndexQueuedItems();
+ }
+ OstTraceFunctionExit0( CNOTESPLUGIN_RESUMEPLUGINL_EXIT );
+ }
+// ---------------------------------------------------------------------------
+// CNotesPlugin::OverWriteOrAddToQueueL
+// ---------------------------------------------------------------------------
+//
+void CNotesPlugin::OverWriteOrAddToQueueL(const TCalLocalUid& aLocalUid, TCPixActionType aActionType)
+ {
+ OstTraceFunctionEntry0( CNOTESPLUGIN_OVERWRITEORADDTOQUEUEL_ENTRY );
+ TRecord entry;
+ for (TInt i=0; i<iJobQueue.Count(); i++)
+ {
+ if (iJobQueue[i].iLocalUid == aLocalUid)
+ {
+ // Older version found
+ iJobQueue[i].iLocalUid = aLocalUid;
+ iJobQueue[i].iActionType = aActionType;
+ OstTraceFunctionExit0( CNOTESPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT );
+ return;
+ }
+ }
+ // older not found, append
+ entry.iActionType = aActionType;
+ entry.iLocalUid = aLocalUid;
+ iJobQueue.AppendL(entry);
+ OstTraceFunctionExit0( DUP1_CNOTESPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT );
+ }
+// ---------------------------------------------------------------------------
+// CNotesPlugin::IndexQueuedItems
+// ---------------------------------------------------------------------------
+//
+void CNotesPlugin::IndexQueuedItems()
+ {
+ OstTraceFunctionEntry0( CNOTESPLUGIN_INDEXQUEUEDITEMS_ENTRY );
+ while (iJobQueue.Count()>0)
+ {
+ TRecord entry = iJobQueue[0];
+ //Let the indexer handle this object TRAP it as it can leave
+ TRAPD(err,CreateNoteEntryL( entry.iLocalUid, entry.iActionType ));
+ if(KErrNone == err)
+ {
+ iJobQueue.Remove(0);
+ }
+ }
+ OstTraceFunctionExit0( CNOTESPLUGIN_INDEXQUEUEDITEMS_EXIT );
+ }
#ifdef __PERFORMANCE_DATA
void CNotesPlugin::UpdatePerformaceDataL()
--- a/harvesterplugins/notes/traces/OstTraceDefinitions.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/notes/traces/OstTraceDefinitions.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+/*
+* This is Default Licence added by TraceCompiler
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
#ifndef __OSTTRACEDEFINITIONS_H__
#define __OSTTRACEDEFINITIONS_H__
// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
--- a/harvesterplugins/notes/traces/fixed_id.definitions Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/notes/traces/fixed_id.definitions Tue Oct 05 13:32:14 2010 +0530
@@ -1,3 +1,20 @@
+##
+# This is Default Licence added by TraceCompiler
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+##
#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
[GROUP]TRACE_FLOW=0x8a
[GROUP]TRACE_NORMAL=0x86
@@ -5,12 +22,21 @@
[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_CALCHANGENOTIFICATION_EXIT=0x8
[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_DELAYEDCALLBACKL_ENTRY=0x5
[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_DELAYEDCALLBACKL_EXIT=0x6
+[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_INDEXQUEUEDITEMS_ENTRY=0x12
+[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_INDEXQUEUEDITEMS_EXIT=0x13
[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_INITTIMEVALUESL_ENTRY=0x9
[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_INITTIMEVALUESL_EXIT=0xa
+[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_OVERWRITEORADDTOQUEUEL_ENTRY=0xf
+[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT=0x10
+[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_PAUSEPLUGINL_ENTRY=0xb
+[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_PAUSEPLUGINL_EXIT=0xc
+[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_RESUMEPLUGINL_ENTRY=0xd
+[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_RESUMEPLUGINL_EXIT=0xe
[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_STARTHARVESTINGL_ENTRY=0x3
[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_STARTHARVESTINGL_EXIT=0x4
[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_STARTPLUGINL_ENTRY=0x1
[TRACE]TRACE_FLOW[0x8A]_CNOTESPLUGIN_STARTPLUGINL_EXIT=0x2
+[TRACE]TRACE_FLOW[0x8A]_DUP1_CNOTESPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT=0x11
[TRACE]TRACE_NORMAL[0x86]_CNOTESPLUGIN_CALCHANGENOTIFICATION=0x4
[TRACE]TRACE_NORMAL[0x86]_CNOTESPLUGIN_CREATENOTEENTRYL=0x9
[TRACE]TRACE_NORMAL[0x86]_CNOTESPLUGIN_DELAYEDCALLBACKL=0x2
@@ -24,6 +50,7 @@
[TRACE]TRACE_NORMAL[0x86]_DUP2_CNOTESPLUGIN_HANDLENOTECHANGEDENTRYL=0x7
[TRACE]TRACE_NORMAL[0x86]_DUP3_CNOTESPLUGIN_CREATENOTEENTRYL=0xc
[TRACE]TRACE_NORMAL[0x86]_DUP3_CNOTESPLUGIN_HANDLENOTECHANGEDENTRYL=0x8
+[TRACE]TRACE_NORMAL[0x86]_DUP4_CNOTESPLUGIN_CREATENOTEENTRYL=0x14
[TRACE]TRACE_NORMAL[0x86]_DUP9_CNOTESPLUGIN_CREATENOTEENTRYL=0x12
[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DUP4_CNOTESPLUGIN_CREATENOTEENTRYL=0xd
[[OBSOLETE]][TRACE]TRACE_NORMAL[0x86]_DUP5_CNOTESPLUGIN_CREATENOTEENTRYL=0xe
--- a/harvesterplugins/notes/traces/notespluginTraces.h Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/notes/traces/notespluginTraces.h Tue Oct 05 13:32:14 2010 +0530
@@ -1,4 +1,20 @@
-// Created by TraceCompiler 2.2.3
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+ *
+*/
+// Created by TraceCompiler 2.3.0
// DO NOT EDIT, CHANGES WILL BE LOST
#ifndef __NOTESPLUGINTRACES_H__
@@ -16,6 +32,15 @@
#define CNOTESPLUGIN_CALCHANGENOTIFICATION_EXIT 0x8a0008
#define CNOTESPLUGIN_INITTIMEVALUESL_ENTRY 0x8a0009
#define CNOTESPLUGIN_INITTIMEVALUESL_EXIT 0x8a000a
+#define CNOTESPLUGIN_PAUSEPLUGINL_ENTRY 0x8a000b
+#define CNOTESPLUGIN_PAUSEPLUGINL_EXIT 0x8a000c
+#define CNOTESPLUGIN_RESUMEPLUGINL_ENTRY 0x8a000d
+#define CNOTESPLUGIN_RESUMEPLUGINL_EXIT 0x8a000e
+#define CNOTESPLUGIN_OVERWRITEORADDTOQUEUEL_ENTRY 0x8a000f
+#define CNOTESPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT 0x8a0010
+#define DUP1_CNOTESPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT 0x8a0011
+#define CNOTESPLUGIN_INDEXQUEUEDITEMS_ENTRY 0x8a0012
+#define CNOTESPLUGIN_INDEXQUEUEDITEMS_EXIT 0x8a0013
#define CNOTESPLUGIN_STARTHARVESTINGL 0x860001
#define CNOTESPLUGIN_DELAYEDCALLBACKL 0x860002
#define DUP1_CNOTESPLUGIN_DELAYEDCALLBACKL 0x860003
@@ -30,6 +55,7 @@
#define DUP3_CNOTESPLUGIN_CREATENOTEENTRYL 0x86000c
#define DUP9_CNOTESPLUGIN_CREATENOTEENTRYL 0x860012
#define DUP10_CNOTESPLUGIN_CREATENOTEENTRYL 0x860013
+#define DUP4_CNOTESPLUGIN_CREATENOTEENTRYL 0x860014
#endif
--- a/harvesterplugins/tsrc/harvesterplugintester/group/harvesterplugintester.mmp Tue Sep 28 11:50:55 2010 +0530
+++ b/harvesterplugins/tsrc/harvesterplugintester/group/harvesterplugintester.mmp Tue Oct 05 13:32:14 2010 +0530
@@ -139,9 +139,9 @@
SOURCE applicationsplugin.cpp
LIBRARY apgrfx.lib //for RApaLsSession
-LIBRARY apparc.lib //for TApaAppInfo
-LIBRARY widgetregistryclient.lib
+LIBRARY apparc.lib //for TApaAppInfo
LIBRARY centralrepository.lib //for CRepository
+LIBRARY scrclient.lib
//---------------End of additions for Applications Plugin-------------------
//------------------Added for Notes plugin ----------------------------
--- a/rom/cpix_app.iby Tue Sep 28 11:50:55 2010 +0530
+++ b/rom/cpix_app.iby Tue Oct 05 13:32:14 2010 +0530
@@ -61,6 +61,17 @@
data=ZSYSTEM\install\cpixsearchapp_stub.sis System\Install\cpixsearchapp_stub.sis
+data=DATAZ_\resource\qt\plugins\searchsrv\contentconfig\filesconfig.xml resource\qt\plugins\searchsrv\contentconfig\filesconfig.xml
+data=DATAZ_\resource\qt\plugins\searchsrv\contentconfig\applicationconfig.xml resource\qt\plugins\searchsrv\contentconfig\applicationconfig.xml
+data=DATAZ_\resource\qt\plugins\searchsrv\contentconfig\calendarconfig.xml resource\qt\plugins\searchsrv\contentconfig\calendarconfig.xml
+data=DATAZ_\resource\qt\plugins\searchsrv\contentconfig\contactconfig.xml resource\qt\plugins\searchsrv\contentconfig\contactconfig.xml
+data=DATAZ_\resource\qt\plugins\searchsrv\contentconfig\audioconfig.xml resource\qt\plugins\searchsrv\contentconfig\audioconfig.xml
+data=DATAZ_\resource\qt\plugins\searchsrv\contentconfig\imageconfig.xml resource\qt\plugins\searchsrv\contentconfig\imageconfig.xml
+data=DATAZ_\resource\qt\plugins\searchsrv\contentconfig\videoconfig.xml resource\qt\plugins\searchsrv\contentconfig\videoconfig.xml
+data=DATAZ_\resource\qt\plugins\searchsrv\contentconfig\emailconfig.xml resource\qt\plugins\searchsrv\contentconfig\emailconfig.xml
+data=DATAZ_\resource\qt\plugins\searchsrv\contentconfig\smsmmsconfig.xml resource\qt\plugins\searchsrv\contentconfig\smsmmsconfig.xml
+data=DATAZ_\resource\qt\plugins\searchsrv\contentconfig\notesconfig.xml resource\qt\plugins\searchsrv\contentconfig\notesconfig.xml
+
#endif //FF_SEARCH_SW
#endif // __CPIXHARVESTER_IBY__
--- a/search_plat/onlinesearchplugin_api/inc/onlinesearchplugin.h Tue Sep 28 11:50:55 2010 +0530
+++ b/search_plat/onlinesearchplugin_api/inc/onlinesearchplugin.h Tue Oct 05 13:32:14 2010 +0530
@@ -21,6 +21,12 @@
#include <QObject>
/**
+ * @file
+ * @ingroup Common
+ * @brief Provides online search plugin interface definition
+ */
+
+/**
* @ingroup group_onlinesearchpluginmodel
* @brief Represents a plugin plugin in the framework.
*
--- a/search_plat/onlinesearchplugin_api/inc/onlinesearchpluginfactory.h Tue Sep 28 11:50:55 2010 +0530
+++ b/search_plat/onlinesearchplugin_api/inc/onlinesearchpluginfactory.h Tue Oct 05 13:32:14 2010 +0530
@@ -18,6 +18,11 @@
#ifndef ONLINESEARCHPLUGINFACTORY_H
#define ONLINESEARCHPLUGINFACTORY_H
+/**
+ * @file
+ * @ingroup Common
+ * @brief Provides online search plugin factory method interface for loading the actual plugin.
+ */
class OnlineSearchPlugin;
--- a/search_plat/onlinesearchproviders_api/inc/isengine.h Tue Sep 28 11:50:55 2010 +0530
+++ b/search_plat/onlinesearchproviders_api/inc/isengine.h Tue Oct 05 13:32:14 2010 +0530
@@ -15,6 +15,12 @@
*
*/
+/**
+ * @file
+ * @ingroup Common
+ * @brief Provides internet search plugin config db interface
+ */
+
#ifndef ISENGINE_H
#define ISENGINE_H
--- a/search_plat/onlinesearchproviders_api/inc/isproviderdbmanager.h Tue Sep 28 11:50:55 2010 +0530
+++ b/search_plat/onlinesearchproviders_api/inc/isproviderdbmanager.h Tue Oct 05 13:32:14 2010 +0530
@@ -31,6 +31,12 @@
#endif
+/**
+ * @file
+ * @ingroup Common
+ * @brief Provides management facility for internet search provider config db.
+ */
+
class QSqlDatabase;
--- a/search_plat/onlinesearchproviders_api/inc/serviceprovider.h Tue Sep 28 11:50:55 2010 +0530
+++ b/search_plat/onlinesearchproviders_api/inc/serviceprovider.h Tue Oct 05 13:32:14 2010 +0530
@@ -23,6 +23,13 @@
#include <HbIcon>
+/**
+ * @file
+ * @ingroup Common
+ * @brief Provides management functions for service provider in online search plugin ecosystem.
+ */
+
+
class ServiceProvider
{
public:
--- a/searchui/inc/search_global.h Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/inc/search_global.h Tue Oct 05 13:32:14 2010 +0530
@@ -26,8 +26,46 @@
#include <e32hal.h>
#endif
#endif
-//settings file
+
+//settings storage path
const QString SETTINGS_INI_PATH("C:\\private\\2002c377\\searchsettings.ini");
+
+
+#define SEARCHAIWDECLINDEVICE "SearchDeviceQueryView"
+#define SEARCHAIWDECLONLINE "SearchWebQueryView"
+#define SEARCHAIWDECLMAINVIEW "SearchView"
+
+#define SEARCHAIWQUERY "query"
+
+#define SEARCHAPPUID "2002C377"
+
+#define DEFAULT_SEARCH_FIELD "_aggregate"
+
+
+#define SUGGESTIONLINKS "links"
+
+#define FIRSTLINEFIELD "_hlexcerpt"
+#define MAILBOXFIELD "MailBoxId"
+#define FOLDERFIELD "FolderId"
+#define NAMEFIELD "Name"
+#define EXTENSIONFIELD "Extension"
+#define ISFOLDERFIELD "IsFolder"
+#define MEDIAIDFIELD "MediaId"
+
+#define MEDIACATEGORY "media"
+#define AUDIOCATEGORY "audio"
+#define VIDEOCATEGORY "video"
+#define IMAGECATEGORY "image"
+#define EMAILCATEGORY "email"
+#define CONTACTCATEGORY "contact"
+#define CALENDARCATEGORY "calendar"
+#define BOOKMARKCATEGORY "bookmark"
+#define APPLICATIONCATEGORY "applications"
+#define NOTESCATEGORY "notes"
+#define FILECATEGORY "file"
+#define MESSAGECATEGORY "msg"
+#define FILEFOLDERCATEGORY "file folder"
+
//#define OST_TRACE_COMPILER_IN_USE //Uncomment to enable performance measurements.
#ifdef OST_TRACE_COMPILER_IN_USE
--- a/searchui/indevicehandler/inc/indevicehandler.h Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/indevicehandler/inc/indevicehandler.h Tue Oct 05 13:32:14 2010 +0530
@@ -19,7 +19,6 @@
#include <QtCore>
#include <qcoreapplication.h>
-#include <qdebug.h>
#include "search_global.h"
#ifdef BUILD_INDEVICEHANDLER
@@ -28,9 +27,6 @@
#define SEARCH_INDEVICEHANDLER Q_DECL_IMPORT
#endif
-#ifndef DEFAULT_SEARCH_FIELD
-#define DEFAULT_SEARCH_FIELD "_aggregate"
-#endif
class CpixSearcher;
class CpixDocument;
--- a/searchui/indevicehandler/indevicehandler.pro Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/indevicehandler/indevicehandler.pro Tue Oct 05 13:32:14 2010 +0530
@@ -33,7 +33,7 @@
TARGET.UID2 = 0x20004C45
TARGET.UID3 = 0x2002C37B
TARGET.EPOCALLOWDLLDATA=1
- TARGET.CAPABILITY = ALL -TCB -DRM
+ TARGET.CAPABILITY = CAP_GENERAL_DLL
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
--- a/searchui/indevicehandler/src/indevicehandler.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/indevicehandler/src/indevicehandler.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -208,15 +208,8 @@
mSearchInterface = NULL;
}
if (astring.length())
- {
- QString database("root ");
- database.append(astring);
- mSearchInterface = CpixSearcher::newInstance(database,
- DEFAULT_SEARCH_FIELD);
- }
- else
- {
- mSearchInterface = CpixSearcher::newInstance("root",
+ {
+ mSearchInterface = CpixSearcher::newInstance(astring,
DEFAULT_SEARCH_FIELD);
}
if (mSearchInterface)
@@ -230,7 +223,6 @@
SLOT(getBatchDocumentAsync(int,int,CpixDocument**)));
}
}
-
// ---------------------------------------------------------------------------
// InDeviceHandler::isPrepared()
// verify the mSearchInterface is prepared or not
--- a/searchui/onlinehandler/onlinehandler.pro Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/onlinehandler/onlinehandler.pro Tue Oct 05 13:32:14 2010 +0530
@@ -40,7 +40,7 @@
TARGET.UID2 = 0x20004C45
TARGET.UID3 = 0x2002C37C
TARGET.EPOCALLOWDLLDATA=1
- TARGET.CAPABILITY = ALL -TCB -DRM
+ TARGET.CAPABILITY = CAP_GENERAL_DLL
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
--- a/searchui/onlinehandler/src/onlinehandler.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/onlinehandler/src/onlinehandler.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -18,7 +18,6 @@
#include "searchutility.h"
#include "onlinesearchplugin.h" // after export should be included as systeminc
#include "onlinesearchpluginfactory.h" // after export should be included as systeminc
-#include <QDebug>
#include <QPluginLoader>
#ifdef Q_OS_SYMBIAN
#include <QLibraryInfo>
--- a/searchui/runtimeproviders/searchruntimeprovider/searchruntimeprovider.pro Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/runtimeproviders/searchruntimeprovider/searchruntimeprovider.pro Tue Oct 05 13:32:14 2010 +0530
@@ -60,7 +60,7 @@
symbian {
TARGET.UID3 = 0x2002C37D
TARGET.EPOCALLOWDLLDATA=1
- TARGET.CAPABILITY = ALL -TCB -DRM
+ TARGET.CAPABILITY = CAP_GENERAL_DLL
appkey:DEFINES += S60APP_KEY
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
--- a/searchui/runtimeproviders/searchruntimeprovider/src/searchruntime.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/runtimeproviders/searchruntimeprovider/src/searchruntime.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -22,8 +22,8 @@
#include <qstatemachine.h>
#include <qstate.h>
#include <qfinalstate.h>
-#include <qdebug.h>
#include <hbapplication.h>
+#include <xqaiwdecl.h>
#define hbApp qobject_cast<HbApplication*>(qApp)
@@ -125,10 +125,7 @@
SIGNAL(switchToOnlineState()), wizardOnlineState);
connect(wizardSettingState, SIGNAL(clickstatus(bool)),
- wizardProgressiveState, SLOT(settingsaction(bool)));
-
- connect(wizardSettingState, SIGNAL(publishSelectedCategory(int,bool)),
- wizardProgressiveState, SLOT(getSettingCategory(int,bool)));
+ wizardProgressiveState, SLOT(slotsettingsaction(bool)));
connect(wizardSettingState, SIGNAL(publishISProviderIcon(int,HbIcon)),
wizardProgressiveState, SLOT(slotISProvidersIcon(int,HbIcon)));
@@ -147,18 +144,18 @@
{
QVariantHash params = hbApp->activateParams();
- QString var = params.value("activityname").toString();
+ QString var = params.value(XQURI_KEY_ACTIVITY_NAME).toString();
- if (var == "SearchView")
+ if (var == SEARCHAIWDECLMAINVIEW)
{
searchRootState->setInitialState(wizardProgressiveState);
}
- else if (var == "SearchDeviceQueryView")
+ else if (var == SEARCHAIWDECLINDEVICE)
{
searchRootState->setInitialState(wizardProgressiveState);
}
- else if (var == "SearchWebQueryView")
+ else if (var == SEARCHAIWDECLONLINE)
{
searchRootState->setInitialState(wizardOnlineState);
}
--- a/searchui/searchapplication/src/main.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/searchapplication/src/main.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -42,21 +42,7 @@
commonTranslator.load("common_" + lang, path);
search.installTranslator(&commonTranslator);
- QTranslator musicTranslator;
- musicTranslator.load("musicplayer_" + lang, path);
- search.installTranslator(&musicTranslator);
- QTranslator contactsTranslator;
- contactsTranslator.load("contacts_" + lang, path);
- search.installTranslator(&contactsTranslator);
-
- QTranslator calenderTranslator;
- calenderTranslator.load("calendar_" + lang, path);
- search.installTranslator(&calenderTranslator);
-
- QTranslator notesTranslator;
- notesTranslator.load("notes_" + lang, path);
- search.installTranslator(¬esTranslator);
PERF_APP_LAUNCH_END("Search Component Cunstructions starts");
PERF_APP_LAUNCH_END("Search Component Cunstructions Ends");
--- a/searchui/stateproviders/searchstateprovider/inc/searchprogressivestate.h Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/inc/searchprogressivestate.h Tue Oct 05 13:32:14 2010 +0530
@@ -144,13 +144,7 @@
*/
void constructHandlers();
- InDeviceHandler* constructHandlers(int mDatabase);
- /**
- * setting the categories .
- * @since S60 ?S60_version.
- */
- void setSelectedCategories();
/**
* parse the result documents.
@@ -166,7 +160,7 @@
* @param aError error code.
* @param aResultCount number of results
*/
- void onAsyncSearchComplete(int aError, int aResultCount);
+ void slotonAsyncSearchComplete(int aError, int aResultCount);
/**
* slot connects to CSearchHandler to get the result item asynchronously
@@ -174,7 +168,7 @@
* @param aError error code.
* @param aDoc result item
*/
- void onGetDocumentComplete(int aError, CpixDocument* aDoc);
+ void slotonGetDocumentComplete(int aError, CpixDocument* aDoc);
/**
* slot connects to CSearchHandler to get the result item asynchronously
@@ -182,7 +176,7 @@
* @param aError error code.
* @param aDoc result item
*/
- void onGetBatchDocumentComplete(int aError, int aCount,
+ void slotonGetBatchDocumentComplete(int aError, int aCount,
CpixDocument** aDoc);
/**
@@ -190,61 +184,53 @@
* @since S60 ?S60_version.
* @param aIndex index of the activated item.
*/
- void openResultitem(HbListWidgetItem * item);
-
- /**
- * slot connects to settings state to get the selected category information
- * @since S60 ?S60_version.
- * @param aCategory category(database) name.
- * @param aStatus whether the category selected or not
- */
- void getSettingCategory(int, bool);
-
+ void slotopenResultitem(HbListWidgetItem * item);
+
/**
* slot connects to action to change the current state to settings state
* @since S60 ?S60_version.
*/
- void setSettings();
+ void slotsetSettings();
/**
* slot connects to search panel to initiate the fresh search
* @since S60 ?S60_version.
* @param aKeyword search keyword.
*/
- void startNewSearch(const QString &aKeyword);
+ void slotstartNewSearch(const QString &aKeyword);
/**
* slot implemented to avoid repeated search for the same category
* selection when user search for mutiple times
* @since S60 ?S60_version.
*/
- void settingsaction(bool avalue);
+ void slotsettingsaction(bool avalue);
/**
* slot connects to search state for internet search
* @since S60 ?S60_version.
*/
- void handleOk(const QVariant& var);
+ void slothandleOk(const QVariant& var);
/**
* slot added for Application manager
* @since S60 ?S60_version.
*/
- void handleError(int ret, const QString& var);
+ void slothandleError(int ret, const QString& var);
/**
* Slot implemented to delete the calenderviewer plugin
* @since S60 ?S60_version.
*/
- void _viewingCompleted();
+ void slotviewingCompleted();
/**
* Slot to notify when view is ready
* @since S60 ?S60_version.
*/
- void viewReady();
+ void slotviewReady();
/**
* Slot to notify form query update form online state
@@ -262,13 +248,13 @@
* Slot to launch the search result screen with the activity URI
* @since S60 ?S60_version.
*/
- void activityRequested(const QString &name);
+ void slotactivityRequested(const QString &name);
/**
* Slot to notify when theme is changed
* @since S60 ?S60_version.
- */
- void slotPrepareResultIcons();
+ */
+ void slotdbChanged();
private:
/**
@@ -344,6 +330,11 @@
*/
void GetPixmapByFilenameL(TDesC& fileName, const QSize &size,
QPixmap& pixmap);
+
+ /**
+ * function to load the category translator files
+ */
+ void loadTranslator(QString localizationpath);
signals:
@@ -402,22 +393,7 @@
*/
QString mOriginalString;
-
- /**
- * selected categories on a map
- */
- QMap<int, bool> mSelectedCategory;
-
- /**
- * save the previous selected categories,decision to search again
- */
- QMap<int, bool> mTempSelectedCategory;
-
- /**
- * temporary list of selected categories
- */
- QStringList mTemplist;
-
+
/**
* number of categories selected
*
@@ -446,12 +422,7 @@
*/
bool loadSettings;
- /**
- *
- * Icon List to be created in boot up for all categories
- */
- QList<HbIcon> mIconArray;
-
+
/**
* Hbicon to be created
*
@@ -485,6 +456,8 @@
QMap<int, HbIcon> mISprovidersIcon;
bool mOnlineQueryAvailable;
+
+ QMap<int,bool> mSelectedCategory;
private:
/**
@@ -510,6 +483,12 @@
bool mStateStatus;
bool mValidateHandlerCreation;
+
+ /**
+ * to handle exception when searchserver get terminated aburptly.
+ *
+ */
+ bool mContinuationSearch;
#ifdef OST_TRACE_COMPILER_IN_USE
QTime m_totalSearchUiTime;
--- a/searchui/stateproviders/searchstateprovider/inc/searchsettingsstate.h Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/inc/searchsettingsstate.h Tue Oct 05 13:32:14 2010 +0530
@@ -91,13 +91,6 @@
void isInternetOn();
public slots:
/**
- * Called when it receive the selected category information from the settingwidget class
- * @since S60 ?S60_version.
- */
-
- void getItemCategory(int, bool);
-
- /**
* Signalled when back action is triggerd from toolbaar.
* @since S60 ?S60_version.
*/
@@ -120,13 +113,7 @@
* Emitted when ok/cancel clicked on settings page
* @since S60 ?S60_version.
*/
- void clickstatus(bool);
-
- /**
- * Emitted when categories selected for searching
- * @since S60 ?S60_version.
- */
- void publishSelectedCategory(int, bool);
+ void clickstatus(bool);
/**
* Emitted when internet search is selectead
--- a/searchui/stateproviders/searchstateprovider/inc/searchuiloader.h Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/inc/searchuiloader.h Tue Oct 05 13:32:14 2010 +0530
@@ -27,15 +27,15 @@
class HbSearchPanel;
class TsTaskSettings;
class SearchMainWindow;
-class SearchHbApplication;
class HbShrinkingVkbHost;
+class SearchContentInfoDbData;
+class ContentInfoDbRead;
SEARCH_CLASS( SearchStateProviderTest)
class SearchUiLoader : public QObject
{
Q_OBJECT
public:
-
/**
* Singleton construtor
* @since S60 ?S60_version.
@@ -70,6 +70,10 @@
m_instance = 0;
}
}
+
+private:
+ void readDB();
+
public slots:
/**
@@ -84,6 +88,11 @@
*/
void slotbringvkb();
+ void slotdataChanged();
+
+signals:
+ void dbChanged();
+
public:
/**
@@ -112,6 +121,10 @@
{
return mSearchPanel;
}
+ QList<SearchContentInfoDbData*> ContentInfoList()
+ {
+ return mContentInfoList;
+ }
private:
/**
* Constructor.
@@ -184,6 +197,10 @@
* Own.
*/
bool mBringtoForground;
+
+ QList<SearchContentInfoDbData*> mContentInfoList;
+
+ ContentInfoDbRead* mDb;
private:
SEARCH_FRIEND_CLASS ( SearchStateProviderTest)
};
@@ -222,5 +239,127 @@
*/
void bringvkb();
};
+class SearchContentInfoDbData : public QObject
+ {
+Q_OBJECT
+public:
+
+ /**
+ * Constructor.
+ * @since S60 ?S60_version.
+ * @param aParent Owner.
+ */
+ SearchContentInfoDbData()
+ {
+ mSearchProgress = false;
+ mSelected = false;
+ }
+
+ /**
+ * Destructor.
+ * @since S60 ?S60_version.
+ */
+ ~SearchContentInfoDbData()
+ {
+ }
+public:
+ QString getCategoryName()
+ {
+ return mCategoryName;
+ }
+ QString getDisplayName()
+ {
+ return mDisplayName;
+ }
+ QString getDisplayIcon()
+ {
+ return mDisplayIcon;
+ }
+ QString getExceptionString()
+ {
+ return mExceptionString;
+ }
+ QString getBaseApp()
+ {
+ return mBaseApp;
+ }
+ QString getTranslationPath()
+ {
+ return mTranslationPath;
+ }
+ bool getActivityUri()
+ {
+ return mActivityUri;
+ }
+ int getDisplayOrder()
+ {
+ return mDisplayOrder;
+ }
+ bool getSearchProgress()
+ {
+ return mSearchProgress;
+ }
+ bool getSelected()
+ {
+ return mSelected;
+ }
+
+ void setCategoryName(QString aCategoryName)
+ {
+ mCategoryName = aCategoryName;
+ }
+ void setDisplayName(QString aDisplayName)
+ {
+ mDisplayName = aDisplayName;
+ }
+ void setDisplayIcon(QString aDisplayIcon)
+ {
+ mDisplayIcon = aDisplayIcon;
+ }
+ void setExceptionString(QString aExceptionString)
+ {
+ mExceptionString = aExceptionString;
+ }
+ void setBaseApp(QString aBaseApp)
+ {
+ mBaseApp = aBaseApp;
+ }
+ void setTranslationPath(QString aTranslationPath)
+ {
+ mTranslationPath = aTranslationPath;
+ }
+ void setActivityUri(QString aActivityUri)
+ {
+ mActivityUri = false;
+ if (aActivityUri.length())
+ {
+ mActivityUri = true;
+ }
+ }
+ void setDisplayOrder(int aDisplayOrder)
+ {
+ mDisplayOrder = aDisplayOrder;
+ }
+ void setSearchProgress(bool aSearchProgress)
+ {
+ mSearchProgress = aSearchProgress;
+ }
+ void setSelected(bool aSelected)
+ {
+ mSelected = aSelected;
+ }
+private:
+ QString mCategoryName;
+ QString mDisplayName;
+ QString mDisplayIcon;
+ QString mExceptionString;
+ bool mActivityUri;
+ QString mBaseApp;
+ int mDisplayOrder;
+ QString mTranslationPath;
+
+ bool mSearchProgress;
+ bool mSelected;
+ };
#endif //SEARCH_CONTROLLER_H
--- a/searchui/stateproviders/searchstateprovider/inc/settingswidget.h Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/inc/settingswidget.h Tue Oct 05 13:32:14 2010 +0530
@@ -32,7 +32,7 @@
class HbRadioButtonList;
class HbDataFormModelItem;
class HbComboBox;
-
+class SearchUiLoader;
SEARCH_CLASS(SearchStateProviderTest)
class SettingsWidget : public QObject
@@ -48,209 +48,244 @@
*/
~SettingsWidget();
public:
+
/**
* Launching the settings widget
*/
void launchSettingWidget();
+
/**
- * Verifies internet selection
- *
+ * returns true is delimeter is on internet mode otherwise false
*/
bool isInternetSearchOptionSelected();
+
/**
- * unchecking subcategories under the main category once main category unchecked
+ * unchecking subcategories under the main category once selectall unchecked
*/
void unCheckSubCategories();
+
/**
- * checking subcategories under the main category once main category checked
+ * checking subcategories under the main category once selectall checked
*/
void checkSubCategories();
+
/**
* storing settings to application ini file
- *
*/
void storeSettingsToiniFile();
+
/**
- * Load setting from application ini file
- *
+ * Load setting from application ini file
*/
void loadDeviceSettings();
/**
- * Load default settings for search categories to ini file
- *
+ * Load settings whether mode in internet/indevice
*/
-
void loadBaseSettings();
/**
* make "OK" button visible
- *
*/
void setActionVisibility();
+
/**
* enable default settings in the application ini file
- *
*/
void storeDefaultSettings();
/**
* setting up gui for the settings widget
*/
-
void createGui();
/**
* Filter out categories from the sql database provided by the engine
* for only those categories that have been successfully harvested
*/
-
void preparecategories();
/**
* initilize the settings wizard while entering to the setting state
*/
-
void initialize();
+ /**
+ * Load Internet handler and settings
+ */
void loadIS();
public slots:
+
/**
* will be called when settings OK is clicked
*/
- void checkBoxOkEvent();
+ void slotOkEvent();
+
/**
* will be called when setting cancel is called
*/
- void checkBoxCancelEvent();
+ void slotCancelEvent();
+
/**
- * will be called whenn any check box is checked
+ * will be called when any check box is checked
*/
- void itemChecked(int);
+ void slotstateChanged(int);
+
/**
* slot called while clicking items added to the combobox
*/
+ void slotcurrentIndexChanged(int);
- void q_currentIndexChanged(int);
-
+ /**
+ * to get the details of intenet service provider
+ */
void slotproviderDetails(QString, HbIcon, int);
+ /**
+ * to get the details of default intenet service provider
+ */
void slotdefaultProvider(const int);
+ /**
+ * to get notify about selection of internet provider
+ */
void slotitemSelected(int);
+
+ /**
+ * to get notify about contentinfodb changes
+ */
+ void slotdbChanged();
+
signals:
+
/**
* Emitted when setting closed
- *
*/
void settingsEvent(bool);
- /**
- * Emitted if settings changed for "go" button
- *
- */
- void settingsChanged();
+
/**
- * Emitted when categories selected or deselected
- *
+ * to notify the indevice search state to display suggestion links
*/
- void selectedItemCategory(int, bool);
-
void ISProvidersIcon(HbIcon, int);
private:
+
/**
* for Device category list
*/
QList<HbCheckBox*> mDeviceCheckBoxList;
+
/**
* for Internet category list
*/
QList<HbCheckBox*> mInternetCheckBoxList;
+
/**
- * mapper to map checkboxes
- *
+ * mapper to map checkboxes
*/
QSignalMapper* signalMapper;
+
/**
* settings widget popup
*/
HbDialog *popup;
+
/**
* to indicate internet is selected or not
*/
bool isInternetSelected;
/**
- * list of hardcoded device categories
+ * list holds the localised text id's of category name
*/
- QMap<QString, bool> mCategoryDbMapping;
-
QStringList mDeviceListDisplay;
- /**
- * list of hardcoded device categories:cretaed to
- * set up default category values to the ini file
- */
- QStringList mDeviceCategoryRefList;
/**
- * intermediate variable to store selected category values
+ * list holds the localised string of category name
*/
+ QStringList mDeviceStoragelist;
- QList<bool> mDeviceMapping;
/**
- * list of hardcoded service providers
- */
- //QStringList internetCategoryList;
- /**
- * for unit testing
+ * lst holds the modes (indevice/internet)
*/
QStringList mCategoryList;
+
/**
- * DocumentLoader variable for the setting widget
+ * to load the docml and ui objects
*/
-
HbDocumentLoader* mDocumentLoader;
/**
* Dataform for the settingwidget
*/
-
HbDataForm* dataform;
/**
* Dataform model
*/
HbDataFormModel* mModel;
+
/**
* variable for customizing each item the in the dataform
*/
-
QList<HbDataFormModelItem*> mModelItemList;
- QList<QAction*> mActions;
+ /**
+ * primary action for delimeter popup
+ */
+ QAction* primaryAction;
+ /**
+ * secondary action for delimeter popup
+ */
+ QAction* secondaryAction;
+
+ /**
+ * hold the setting value of category mode
+ */
int mSelectedScope;
+ /**
+ * hold the Id of internet service provider
+ */
int mSelectedProvider;
+
/**
* Radio buttion list for internet search categories
*/
-
HbRadioButtonList* mradiolist;
/**
- * combobox items
+ * combobox provide an option to select indevice/internet
*/
HbComboBox *comboBox;
+ /**
+ * to execute the ui preparation at once
+ */
bool mInstialize;
+
+ /**
+ * validating the select all
+ */
bool mchangestate;
+ /**
+ * handler to get the internet service provider details
+ */
OnlineHandler *mInternetHandler;
+ /**
+ * internet service providers and its ID's
+ */
QMap<int, QString> mServiceProviders;
+ /**
+ * common ui controller, to get the contentinfodb details
+ */
+ SearchUiLoader* mUiLoader;
+
SEARCH_FRIEND_CLASS (SearchStateProviderTest)
};
#endif
--- a/searchui/stateproviders/searchstateprovider/searchstateprovider.pro Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/searchstateprovider.pro Tue Oct 05 13:32:14 2010 +0530
@@ -57,8 +57,10 @@
LIBS += -lefsrv
LIBS += -lapgrfx
LIBS += -lws32
-LIBS += -lavkon
-LIBS += -ltstaskmonitorclient.dll
+LIBS += -ltstaskmonitorclient
+LIBS += -lcpixcontentinfodb
+LIBS += -lxqserviceutil
+
coverage:DEFINES += COVERAGE_MEASUREMENT
@@ -83,7 +85,7 @@
TARGET.UID2 = 0x20004C45
TARGET.UID3 = 0x2002C37A
TARGET.EPOCALLOWDLLDATA=1
- TARGET.CAPABILITY = ALL -TCB -DRM
+ TARGET.CAPABILITY = CAP_GENERAL_DLL
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
--- a/searchui/stateproviders/searchstateprovider/src/searchonlinestate.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/src/searchonlinestate.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -25,7 +25,6 @@
#include <hbinstance.h>
#include <hbaction.h>
#include <qstandarditemmodel.h>
-#include <qdebug.h>
#include <qgraphicswidget.h>
#include <qdir.h>
#include <hbsearchpanel.h>
@@ -49,11 +48,7 @@
mView = mUiLoader->View();
mListView = mUiLoader->ListWidget();
- mSearchPanel = mUiLoader->SearchPanel();
- if (mSearchPanel)
- {
- mSearchPanel->setFocus();
- }
+ mSearchPanel = mUiLoader->SearchPanel();
if (mView && mMainWindow)
{
mMainWindow->addView(mView);
@@ -76,7 +71,6 @@
//
void SearchOnlineState::onEntry(QEvent *event)
{
- qDebug() << "search:SearchOnlineState::onEntry";
QState::onEntry(event);
if (mSearchPanel)
{
--- a/searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -57,13 +57,14 @@
#include <xqaiwdeclplat.h>
#include <qservicemanager.h>
#include <qurl.h>
+#include <email_services_api.h>
+#include <xqrequestinfo.h>
QTM_USE_NAMESPACE
#define hbApp qobject_cast<HbApplication*>(qApp)
-const int totalcategories_normalreason = 10;
-const int totalcategories_activityreasonreason = 13;
+
const int intial_iteration = 3;
const int batch_iteration = 20;
-#define SEARCHAPPUID "2002C377"
+
// ---------------------------------------------------------------------------
// SearchProgressiveState::SearchProgressiveState
@@ -73,6 +74,7 @@
mSearchHandler(NULL), mNotesEditor(0), mAiwMgr(0), mRequest(0)
{
mUiLoader = SearchUiLoader::instance();
+ connect(mUiLoader, SIGNAL(dbChanged), this, SLOT(slotdbChanged()));
mMainWindow = hbInstance->allMainWindows().at(0);
@@ -92,11 +94,9 @@
{
mSearchPanel->setPlaceholderText(hbTrId(
"txt_search_dialog_search_device"));
- mSearchPanel->setFocus();
}
constructHandlers();
-
if (mView && mMainWindow)
{
mMainWindow->addView(mView);
@@ -111,7 +111,7 @@
if (hbApp)
{
connect(hbApp->activityManager(), SIGNAL(activityRequested(QString)),
- this, SLOT(activityRequested(QString)));
+ this, SLOT(slotactivityRequested(QString)));
}
#ifdef OST_TRACE_COMPILER_IN_USE
@@ -141,23 +141,26 @@
}
mOnlineQueryAvailable = false;
- //Prepare the icons,listen of theme change
- connect(hbInstance->theme(), SIGNAL(changeFinished()), this,
- SLOT(slotPrepareResultIcons()));
- slotPrepareResultIcons();
-
+
// creating the handler if it is not prepared, useful when user try to create before
mValidateHandlerCreation = false;
+
+ // to retrive the search documents form where it ends when search server crashes
+ mContinuationSearch = false;
}
// ---------------------------------------------------------------------------
// SearchProgressiveState::~SearchProgressiveState
// ---------------------------------------------------------------------------
SearchProgressiveState::~SearchProgressiveState()
{
+ if(mRequest)
+ {
+ delete mRequest;
+ }
if (mAiwMgr)
{
delete mAiwMgr;
- }
+ }
for (int i = 0; i < mSearchHandlerList.count(); i++)
{
delete mSearchHandlerList.at(i);
@@ -174,22 +177,50 @@
// ---------------------------------------------------------------------------
void SearchProgressiveState::constructHandlers()
{
- int categories = totalcategories_normalreason;
+ for (int i = 0; i < mSearchHandlerList.count(); i++)
+ {
+ disconnect(mSearchHandlerList.at(i),
+ SIGNAL(handleAsyncSearchResult(int,int)), this,
+ SLOT(slotonAsyncSearchComplete(int,int)));
+ disconnect(mSearchHandlerList.at(i),
+ SIGNAL(handleDocument(int,CpixDocument*)), this,
+ SLOT(slotonGetDocumentComplete(int,CpixDocument*)));
+ disconnect(mSearchHandlerList.at(i),
+ SIGNAL(handleBatchDocument(int,int,CpixDocument**)), this,
+ SLOT(slotonGetBatchDocumentComplete(int,int,CpixDocument**)));
+ delete mSearchHandlerList.at(i);
+ }
+ mSearchHandlerList.clear();
- if (hbApp && hbApp->activateReason() == Hb::ActivationReasonActivity)
+ for (int i = 0; i < mUiLoader->ContentInfoList().count(); i++)
{
- categories = totalcategories_activityreasonreason;
+ InDeviceHandler* handler = NULL;
+ handler = new InDeviceHandler();
+ handler->setCategory(mUiLoader->ContentInfoList().at(i)->getBaseApp());
+ mSearchHandlerList.append(handler);
+ if(mUiLoader->ContentInfoList().at(i)->getTranslationPath().length())
+ {
+ loadTranslator(mUiLoader->ContentInfoList().at(i)->getTranslationPath());
+ }
}
- for (int i = 0; i < categories; i++)
+ for (int i = 0; i < mSearchHandlerList.count(); i++)
{
- mSearchHandlerList.append(constructHandlers(i));
+ connect(mSearchHandlerList.at(i),
+ SIGNAL(handleAsyncSearchResult(int,int)), this,
+ SLOT(slotonAsyncSearchComplete(int,int)));
+ connect(mSearchHandlerList.at(i),
+ SIGNAL(handleDocument(int,CpixDocument*)), this,
+ SLOT(slotonGetDocumentComplete(int,CpixDocument*)));
+ connect(mSearchHandlerList.at(i),
+ SIGNAL(handleBatchDocument(int,int,CpixDocument**)), this,
+ SLOT(slotonGetBatchDocumentComplete(int,int,CpixDocument**)));
}
}
// ---------------------------------------------------------------------------
// SearchProgressiveState::onEntry
// ---------------------------------------------------------------------------
void SearchProgressiveState::onEntry(QEvent *event)
- {
+ {
QState::onEntry(event);
mStateStatus = true;// used for conditional execution for the slots that are connected as transitions
if (mSearchPanel)
@@ -218,7 +249,6 @@
emit switchProToSettingsState();
loadSettings = false;
}
- setSelectedCategories();
if (mOnlineQueryAvailable)
{
mSearchPanel->setCriteria(mOriginalString);
@@ -239,75 +269,55 @@
// ---------------------------------------------------------------------------
void SearchProgressiveState::activateSignals()
{
- for (int i = 0; i < mSearchHandlerList.count(); i++)
- {
- connect(mSearchHandlerList.at(i),
- SIGNAL(handleAsyncSearchResult(int,int)), this,
- SLOT(onAsyncSearchComplete(int,int)));
- connect(mSearchHandlerList.at(i),
- SIGNAL(handleDocument(int,CpixDocument*)), this,
- SLOT(onGetDocumentComplete(int,CpixDocument*)));
- connect(mSearchHandlerList.at(i),
- SIGNAL(handleBatchDocument(int,int,CpixDocument**)), this,
- SLOT(onGetBatchDocumentComplete(int,int,CpixDocument**)));
-
- }
if (mListView)
{
connect(mListView, SIGNAL(activated(HbListWidgetItem *)), this,
- SLOT(openResultitem(HbListWidgetItem *)));
+ SLOT(slotopenResultitem(HbListWidgetItem *)));
}
if (mSearchPanel)
{
connect(mSearchPanel, SIGNAL(criteriaChanged(QString)), this,
- SLOT(startNewSearch(QString)));
+ SLOT(slotstartNewSearch(QString)));
connect(mSearchPanel, SIGNAL(searchOptionsClicked()), this,
- SLOT(setSettings()));
+ SLOT(slotsetSettings()));
}
- connect(mMainWindow, SIGNAL(viewReady()), this, SLOT(viewReady()));
+ connect(mMainWindow, SIGNAL(viewReady()), this, SLOT(slotviewReady()));
}
// ---------------------------------------------------------------------------
// SearchProgressiveState::deActivateSignals
// ---------------------------------------------------------------------------
void SearchProgressiveState::deActivateSignals()
{
- for (int i = 0; i < mSearchHandlerList.count(); i++)
- {
- disconnect(mSearchHandlerList.at(i),
- SIGNAL(handleAsyncSearchResult(int,int)), this,
- SLOT(onAsyncSearchComplete(int,int)));
- disconnect(mSearchHandlerList.at(i),
- SIGNAL(handleDocument(int,CpixDocument*)), this,
- SLOT(onGetDocumentComplete(int,CpixDocument*)));
- disconnect(mSearchHandlerList.at(i),
- SIGNAL(handleBatchDocument(int,int,CpixDocument**)), this,
- SLOT(onGetBatchDocumentComplete(int,int,CpixDocument**)));
- }
if (mListView)
{
disconnect(mListView, SIGNAL(activated(HbListWidgetItem *)), this,
- SLOT(openResultitem(HbListWidgetItem *)));
+ SLOT(slotopenResultitem(HbListWidgetItem *)));
}
if (mSearchPanel)
{
disconnect(mSearchPanel, SIGNAL(criteriaChanged(QString)), this,
- SLOT(startNewSearch(QString)));
+ SLOT(slotstartNewSearch(QString)));
disconnect(mSearchPanel, SIGNAL(searchOptionsClicked()), this,
- SLOT(setSettings()));
+ SLOT(slotsetSettings()));
}
- disconnect(mMainWindow, SIGNAL(viewReady()), this, SLOT(viewReady()));
+ disconnect(mMainWindow, SIGNAL(viewReady()), this, SLOT(slotviewReady()));
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::onAsyncSearchComplete
+// SearchProgressiveState::slotonAsyncSearchComplete
// ---------------------------------------------------------------------------
-void SearchProgressiveState::onAsyncSearchComplete(int aError,
+void SearchProgressiveState::slotonAsyncSearchComplete(int aError,
int aResultCount)
{
PERF_CAT_API_ENDLOG
PERF_CAT_HITS_ENDLOG
if (aError != 0)
{
- //some error print logs
+ if (aError == KErrServerTerminated) // server terminated refresh the handlers
+ {
+ constructHandlers();
+ mDatabasecount = 0;
+ mLinkindex = 0;
+ }
searchOnCategory(mSearchString);
return;
}
@@ -318,18 +328,42 @@
else if (aResultCount > 0)
{
mResultcount = aResultCount;
- mResultparser = 0;
+ if (mContinuationSearch)
+ {
+ mContinuationSearch = false;
+ }
+ else
+ {
+ mResultparser = 0;
+ }
PERF_CAT_GETDOC_TIME_RESTART
PERF_CAT_GETDOC_ACCUMULATOR_RESET
- mSearchHandler->getDocumentAsyncAtIndex(mResultparser);
+ if (mListView->count() >= intial_iteration)
+ {
+ mSearchHandler->getBatchDocumentAsyncAtIndex(mResultparser,
+ batch_iteration);
+ }
+ else
+ {
+ mSearchHandler->getDocumentAsyncAtIndex(mResultparser);
+ }
}
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::onGetDocumentComplete
+// SearchProgressiveState::slotonGetDocumentComplete
// ---------------------------------------------------------------------------
-void SearchProgressiveState::onGetDocumentComplete(int aError,
+void SearchProgressiveState::slotonGetDocumentComplete(int aError,
CpixDocument* aDoc)
{
+ if (aError == KErrServerTerminated) // server terminated refresh the handlers
+ {
+ constructHandlers();
+ mDatabasecount = 0;
+ mLinkindex = 0;
+ searchOnCategory(mSearchString);
+ mContinuationSearch = true;
+ return;
+ }
if (aError)
return;
parseDocument(aDoc);
@@ -337,7 +371,7 @@
if (mResultparser < mResultcount)
{
PERF_CAT_GETDOC_TIME_RESTART
- if (mResultparser < intial_iteration)
+ if (mListView->count() < intial_iteration)
{
mSearchHandler->getDocumentAsyncAtIndex(mResultparser);
}
@@ -354,11 +388,20 @@
}
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::onGetDocumentComplete
+// SearchProgressiveState::slotonGetDocumentComplete
// ---------------------------------------------------------------------------
-void SearchProgressiveState::onGetBatchDocumentComplete(int aError,
+void SearchProgressiveState::slotonGetBatchDocumentComplete(int aError,
int aCount, CpixDocument** aDoc)
{
+ if (aError == KErrServerTerminated) // server terminated refresh the handlers
+ {
+ constructHandlers();
+ mDatabasecount = 0;
+ mLinkindex = 0;
+ searchOnCategory(mSearchString);
+ mContinuationSearch = true;
+ return;
+ }
if (aError)
return;
for (int i = 0; i < aCount; i++)
@@ -380,39 +423,34 @@
}
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::getSettingCategory
+// SearchProgressiveState::slotopenResultitem
// ---------------------------------------------------------------------------
-void SearchProgressiveState::getSettingCategory(int item, bool avalue)
- {
- mSelectedCategory.insert(item, avalue);
- }
-// ---------------------------------------------------------------------------
-// SearchProgressiveState::openResultitem
-// ---------------------------------------------------------------------------
-void SearchProgressiveState::openResultitem(HbListWidgetItem * item)
+void SearchProgressiveState::slotopenResultitem(HbListWidgetItem * item)
{
if (item == NULL)
return;
PERF_RESULT_ITEM_LAUNCH_TIME_RESTART
QList<QVariant> args;
bool t;
+ if(mRequest)
+ delete mRequest;
mRequest = NULL;
- if (item->data(Qt::UserRole + 1).toString().contains("contact"))
+ if (item->data(Qt::UserRole + 1).toString().contains(CONTACTCATEGORY))
{
- PERF_RESULT_ITEM_FOR_LAUNCHING("contact")
+ PERF_RESULT_ITEM_FOR_LAUNCHING(CONTACTCATEGORY)
mRequest = mAiwMgr->create(XQI_CONTACTS_VIEW,XQOP_CONTACTS_VIEW_CONTACT_CARD, true);
int uid = (item->data(Qt::UserRole)).toInt(&t);
args << uid;
}
- else if (item->data(Qt::UserRole + 1).toString().contains("bookmark"))
+ else if (item->data(Qt::UserRole + 1).toString().contains(BOOKMARKCATEGORY))
{
- PERF_RESULT_ITEM_FOR_LAUNCHING("bookmark")
+ PERF_RESULT_ITEM_FOR_LAUNCHING(BOOKMARKCATEGORY)
QDesktopServices::openUrl(item->data(Qt::UserRole + 2).toString());
PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG ("")
}
- else if (item->data(Qt::UserRole + 1).toString().contains("calendar"))
+ else if (item->data(Qt::UserRole + 1).toString().contains(CALENDARCATEGORY))
{
QDir pluginDir = QDir(CALENDAR_EVENTVIEWER_PLUGIN_PATH);
QPluginLoader *calAgandaViewerPluginLoader = new QPluginLoader(
@@ -423,76 +461,98 @@
calAgandaViewerPluginLoader->instance());
connect(calAgandaViewerPluginInstance, SIGNAL(viewingCompleted()),
- this, SLOT(_viewingCompleted()));
+ this, SLOT(slotviewingCompleted()));
calAgandaViewerPluginInstance->viewEvent(
item->data(Qt::UserRole).toInt(),
EventViewerPluginInterface::ActionEditDelete, NULL);
}
- else if (item->data(Qt::UserRole + 1).toString().contains("applications"))
+ else if (item->data(Qt::UserRole + 1).toString().contains(APPLICATIONCATEGORY))
{
- PERF_RESULT_ITEM_FOR_LAUNCHING("applications")
+ PERF_RESULT_ITEM_FOR_LAUNCHING(APPLICATIONCATEGORY)
TRAP_IGNORE(LaunchApplicationL((item->data(Qt::UserRole)).toString()));
PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG("")
}
- else if (item->data(Qt::UserRole + 1).toString().contains("file"))
+ else if (item->data(Qt::UserRole + 1).toString().contains(FILECATEGORY))
{
- PERF_RESULT_ITEM_FOR_LAUNCHING("file")
+ PERF_RESULT_ITEM_FOR_LAUNCHING(FILECATEGORY)
QString uid = item->data(Qt::UserRole).toString();
QFile file(uid);
mRequest = mAiwMgr->create(file, true);
args << file.fileName();
}
- else if ((item->data(Qt::UserRole + 1).toString().contains("video"))
- || (item->data(Qt::UserRole + 1).toString().contains("audio"))
- || (item->data(Qt::UserRole + 1).toString().contains("image")))
+ else if ((item->data(Qt::UserRole + 1).toString().contains(VIDEOCATEGORY))
+ || (item->data(Qt::UserRole + 1).toString().contains(AUDIOCATEGORY)))
{
- PERF_RESULT_ITEM_FOR_LAUNCHING("media")
+ PERF_RESULT_ITEM_FOR_LAUNCHING(AUDIOCATEGORY)
QString uid = getDrivefromMediaId(
item->data(Qt::UserRole + 2).toString());
uid.append(':');
uid.append(item->data(Qt::UserRole).toString());
QFile file(uid);
- mRequest = mAiwMgr->create(file, true);
+ mRequest = mAiwMgr->create(file, false);
args << file.fileName();
+ if(mRequest)
+ {
+ QVariant title(hbTrId("txt_search_title_search"));
+ XQRequestInfo info;
+ info.setInfo(XQINFO_KEY_WINDOW_TITLE, title);
+ mRequest->setInfo(info);
+ mRequest->setBackground(false);
+ mRequest->setSynchronous(false);
+ }
}
-
- else if (item->data(Qt::UserRole + 1).toString().contains("notes"))
+ else if ((item->data(Qt::UserRole + 1).toString().contains(IMAGECATEGORY)))
+ {
+ PERF_RESULT_ITEM_FOR_LAUNCHING(IMAGECATEGORY)
+ QString uid = getDrivefromMediaId(
+ item->data(Qt::UserRole + 2).toString());
+ uid.append(':');
+ uid.append(item->data(Qt::UserRole).toString());
+ QFile file(uid);
+ mRequest = mAiwMgr->create(file, true);
+ args << file.fileName();
+ }
+ else if (item->data(Qt::UserRole + 1).toString().contains(NOTESCATEGORY))
{
- PERF_RESULT_ITEM_FOR_LAUNCHING("notes")
+ PERF_RESULT_ITEM_FOR_LAUNCHING(NOTESCATEGORY)
if (mNotesEditor)
{
mNotesEditor->edit(item->data(Qt::UserRole).toInt());
}
PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG("")
}
- else if (item->data(Qt::UserRole + 1).toString().contains("msg email"))
+ else if (item->data(Qt::UserRole + 1).toString().contains(EMAILCATEGORY))
{
-
- mRequest = mAiwMgr->create(XQI_EMAIL_MESSAGE_VIEW,XQOP_EMAIL_MESSAGE_VIEW, true);
-
- args << item->data(Qt::UserRole + 2).toULongLong(&t) << item->data(
- Qt::UserRole + 3).toULongLong(&t)
- << item->data(Qt::UserRole).toULongLong(&t);
+ QVariantList listarg;
+ listarg.append(item->data(Qt::UserRole + 2).toULongLong(&t));
+ listarg.append(item->data(Qt::UserRole + 3).toULongLong(&t));
+ listarg.append(item->data(Qt::UserRole).toULongLong(&t));
+
+ QVariant idListAsVariant = QVariant::fromValue(listarg);
+
+ mRequest = mAiwMgr->create(XQI_EMAIL_MESSAGE_VIEW,XQOP_EMAIL_MESSAGE_VIEW, true);
+ args.append(idListAsVariant);
+ args.append(EmailNoFlags);
}
- else if (item->data(Qt::UserRole + 1).toString().contains("msg"))
+ else if (item->data(Qt::UserRole + 1).toString().contains(MESSAGECATEGORY))
{
- PERF_RESULT_ITEM_FOR_LAUNCHING("msg")
+ PERF_RESULT_ITEM_FOR_LAUNCHING(MESSAGECATEGORY)
mRequest = mAiwMgr->create(XQI_MESSAGE_VIEW, XQOP_MESSAGE_VIEW, true);
int uid = (item->data(Qt::UserRole)).toInt(&t);
args << uid;
}
- else if (item->data(Qt::UserRole + 1).toString().contains("links"))
+ else if (item->data(Qt::UserRole + 1).toString().contains(SUGGESTIONLINKS))
{
emit launchLink((item->data(Qt::UserRole)).toInt(&t), mOriginalString);
}
if (mRequest)
{
connect(mRequest, SIGNAL(requestOk(const QVariant&)), this,
- SLOT(handleOk(const QVariant&)));
+ SLOT(slothandleOk(const QVariant&)));
connect(mRequest, SIGNAL(requestError(int,const QString&)), this,
- SLOT(handleError(int,const QString&)));// Connect error handling signal or apply lastError function instead.
+ SLOT(slothandleError(int,const QString&)));// Connect error handling signal or apply lastError function instead.
mRequest->setArguments(args);
if (!mRequest->send())// Make the request
@@ -500,10 +560,9 @@
qDebug() << "AIW-ERROR: Send failed" << mRequest->lastError();
}
disconnect(mRequest, SIGNAL(requestOk(const QVariant&)), this,
- SLOT(handleOk(const QVariant&)));
+ SLOT(slothandleOk(const QVariant&)));
disconnect(mRequest, SIGNAL(requestError(int,const QString&)), this,
- SLOT(handleError(int,const QString&)));// Connect error handling signal or apply lastError function instead.
- mRequest->deleteLater();
+ SLOT(slothandleError(int,const QString&)));// Connect error handling signal or apply lastError function instead.
}
else
{
@@ -512,17 +571,17 @@
}
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::handleOk
+// SearchProgressiveState::slothandleOk
// ---------------------------------------------------------------------------
-void SearchProgressiveState::handleOk(const QVariant& var)
+void SearchProgressiveState::slothandleOk(const QVariant& var)
{
Q_UNUSED(var);
PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG ("")
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::handleError
+// SearchProgressiveState::slothandleError
// ---------------------------------------------------------------------------
-void SearchProgressiveState::handleError(int ret, const QString& var)
+void SearchProgressiveState::slothandleError(int ret, const QString& var)
{
Q_UNUSED(ret);
Q_UNUSED(var);
@@ -542,7 +601,7 @@
listitem->setText(linkString);
listitem->setData(i.key(), Qt::UserRole);
listitem->setData(i.value(), Qt::DecorationRole);
- listitem->setData("links", Qt::UserRole + 1);
+ listitem->setData(SUGGESTIONLINKS, Qt::UserRole + 1);
mListView->addItem(listitem);
}
}
@@ -582,66 +641,31 @@
#endif
mResultparser = 0;
mResultcount = 0;
- if (mDatabasecount < mTemplist.count())
+ mSearchHandler = NULL;
+ if (mDatabasecount < mUiLoader->ContentInfoList().count())
{
- if (mTemplist.at(mDatabasecount).contains("selectall"))
- {
- mSearchHandler = mSearchHandlerList.at(0);
- }
- else if (mTemplist.at(mDatabasecount).contains("contact"))
- {
- mSearchHandler = mSearchHandlerList.at(1);
- }
- else if (mTemplist.at(mDatabasecount).contains("image"))
- {
- mSearchHandler = mSearchHandlerList.at(10);
- }
- else if (mTemplist.at(mDatabasecount).contains("audio"))
- {
- mSearchHandler = mSearchHandlerList.at(11);
- }
- else if (mTemplist.at(mDatabasecount).contains("video"))
- {
- mSearchHandler = mSearchHandlerList.at(12);
- }
- else if (mTemplist.at(mDatabasecount).contains("media"))
- {
- mSearchHandler = mSearchHandlerList.at(2);
- }
- else if (mTemplist.at(mDatabasecount).contains("msg"))
+ for (int i = 0; i < mUiLoader->ContentInfoList().count(); i++)
{
- mSearchHandler = mSearchHandlerList.at(3);
- }
- else if (mTemplist.at(mDatabasecount).contains("email"))
- {
- mSearchHandler = mSearchHandlerList.at(4);
- }
- else if (mTemplist.at(mDatabasecount).contains("calendar"))
- {
- mSearchHandler = mSearchHandlerList.at(5);
- }
- else if (mTemplist.at(mDatabasecount).contains("notes"))
- {
- mSearchHandler = mSearchHandlerList.at(6);
+ //skip all categories if "selectall" option get selected, skip other iterations
+ if (i == 0 && mUiLoader->ContentInfoList().at(i)->getSelected())
+ {
+ mSearchHandler = mSearchHandlerList.at(i);
+ mDatabasecount = mUiLoader->ContentInfoList().count();
+ break;
+ }
+ if (mUiLoader->ContentInfoList().at(i)->getSelected()
+ && (!mUiLoader->ContentInfoList().at(i)->getSearchProgress()))
+ {
+ mSearchHandler = mSearchHandlerList.at(i);
+ mUiLoader->ContentInfoList().at(i)->setSearchProgress(true);
+ break;
+ }
}
- else if (mTemplist.at(mDatabasecount).contains("applications"))
- {
- mSearchHandler = mSearchHandlerList.at(7);
- }
- else if (mTemplist.at(mDatabasecount).contains("file"))
- {
- mSearchHandler = mSearchHandlerList.at(8);
- }
- else if (mTemplist.at(mDatabasecount).contains("bookmark"))
- {
- mSearchHandler = mSearchHandlerList.at(9);
- }
- // mSearchHandler->setCategory(mTemplist.at(mDatabasecount));
mDatabasecount++;
if (mSearchHandler != NULL && mSearchHandler->isPrepared())
{
PERF_CAT_API_TIME_RESTART
- mSearchHandler->searchAsync(aKeyword, "_aggregate");
+ mSearchHandler->searchAsync(aKeyword, DEFAULT_SEARCH_FIELD);
}
else
@@ -649,7 +673,7 @@
searchOnCategory(mSearchString);
}
}
- else if (mDatabasecount >= mTemplist.count())
+ else
{
PERF_TOTAL_UI_ENDLOG
if (mListView->count() == 0 && aKeyword.length() != 0)
@@ -661,32 +685,17 @@
}
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::startNewSearch
+// SearchProgressiveState::slotstartNewSearch
// ---------------------------------------------------------------------------
-void SearchProgressiveState::startNewSearch(const QString &aKeyword)
+void SearchProgressiveState::slotstartNewSearch(const QString &aKeyword)
{
PERF_CAT_TOTAL_TIME_RESTART
mOriginalString = aKeyword.trimmed();
- if (!mValidateHandlerCreation)
+ for (int j = 0; j < mUiLoader->ContentInfoList().count(); j++)
{
- for (int i = 0; i < mSearchHandlerList.count(); i++)
- {
- /* ignoring bookmark to getrid of unnecesary check as bookmark support is withdrawn
- * keeping perfomance into consideration, otherwise not
- */
- if (!mSearchHandlerList.at(i)->isPrepared() && (i != 9))
- {
- constructHandlers(i);
- mValidateHandlerCreation = false;
- }
- else
- {
- mValidateHandlerCreation = true;
- }
- }
+ mUiLoader->ContentInfoList().at(j)->setSearchProgress(false);
}
-
for (int i = 0; i < mSearchHandlerList.count(); i++)
{
mSearchHandlerList.at(i)->cancelLastSearch();
@@ -706,106 +715,47 @@
}
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::setSettings
+// SearchProgressiveState::slotsetSettings
// ---------------------------------------------------------------------------
-void SearchProgressiveState::setSettings()
+void SearchProgressiveState::slotsetSettings()
{
- mTempSelectedCategory = mSelectedCategory;
+ for (int j = 0; j < mUiLoader->ContentInfoList().count(); j++)
+ {
+ mSelectedCategory.insert(j,
+ mUiLoader->ContentInfoList().at(j)->getSelected());
+ }
if (mOriginalString.length())
emit inDeviceSearchQuery(mOriginalString);
emit switchProToSettingsState();
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::settingsaction
+// SearchProgressiveState::slotsettingsaction
// ---------------------------------------------------------------------------
-void SearchProgressiveState::settingsaction(bool avalue)
+void SearchProgressiveState::slotsettingsaction(bool avalue)
{
if (avalue && mStateStatus)
{
- QMapIterator<int, bool> i(mTempSelectedCategory);
- QMapIterator<int, bool> j(mSelectedCategory);
- while (i.hasNext())
+ QMap<int, bool> mTempSelectedCategory;
+ for (int i = 0; i < mUiLoader->ContentInfoList().count(); i++)
{
- i.next();
+ mTempSelectedCategory.insert(i,
+ mUiLoader->ContentInfoList().at(i)->getSelected());
+ }
+ QMapIterator<int, bool> j(mTempSelectedCategory);
+ QMapIterator<int, bool> k(mSelectedCategory);
+ while (j.hasNext())
+ {
j.next();
- if (i.value() != j.value())
+ k.next();
+ if (j.value() != k.value())
{
- startNewSearch(mOriginalString);
+ slotstartNewSearch(mOriginalString);
break;
}
}
}
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::setSelectedCategories
-// ---------------------------------------------------------------------------
-void SearchProgressiveState::setSelectedCategories()
- {
- mTemplist.clear();
- QMapIterator<int, bool> i(mSelectedCategory);
- bool isrootsearch = false;
- while (i.hasNext())
- {
- i.next();
- if (i.value())
- {
- switch (i.key())
- {
- case 0:
- {
- isrootsearch = true;
- // mTemplist.append("selectall");
- break;
- }
- case 1: //Contacts
- {
- mTemplist.append("contact");
- break;
- }
- case 2://Media
- {
- mTemplist.append("media");
- break;
- }
- case 3://Messages& emails
- {
- mTemplist.append("msg");
- mTemplist.append("email");
- break;
- }
- case 4://Calender& notes
- {
- mTemplist.append("calendar");
- mTemplist.append("notes");
- break;
- }
- case 5://Applications
- {
- mTemplist.append("applications");
- break;
- }
- case 6://Bookmarks
- {
- mTemplist.append("bookmark");
- break;
- }
- case 7://All other files
- {
- mTemplist.append("file");
- break;
- }
- }
- }
- }
- if (mTemplist.count() == 9)
- isrootsearch = true;
- if (isrootsearch)
- {
- mTemplist.clear();
- mTemplist.append("selectall");
- }
- }
-// ---------------------------------------------------------------------------
// SearchProgressiveState::getAppIconFromAppId
// ---------------------------------------------------------------------------
HbIcon SearchProgressiveState::getAppIconFromAppIdL(TUid auid)
@@ -986,8 +936,7 @@
pixmap.setAlphaChannel(mask);
}
else
- { // we need special handling for icons in 9.2 (NGA)
- // let's hope that in future it will be in QT code
+ {
CFbsBitmap *temp(NULL);
temp = copyBitmapLC(fbsBitmap);
pixmap = fromSymbianCFbsBitmap(temp);
@@ -1117,34 +1066,45 @@
PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG("")
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::_viewingCompleted
+// SearchProgressiveState::slotviewingCompleted
// ---------------------------------------------------------------------------
-void SearchProgressiveState::_viewingCompleted()
+void SearchProgressiveState::slotviewingCompleted()
{
if (calAgandaViewerPluginInstance)
calAgandaViewerPluginInstance->deleteLater();
PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG ("")
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::viewReady
+// SearchProgressiveState::slotviewReady
// ---------------------------------------------------------------------------
-void SearchProgressiveState::viewReady()
+void SearchProgressiveState::slotviewReady()
{
if (hbApp)
{
if (hbApp->activateReason() == Hb::ActivationReasonActivity)
{
QVariantHash params = hbApp->activateParams();
- QString searchKey = params.value("query").toString();
- params.remove("query");
- params.remove("activityname");
+ QString searchKey = params.value(SEARCHAIWQUERY).toString();
+ params.remove(SEARCHAIWQUERY);
+ params.remove(XQURI_KEY_ACTIVITY_NAME);
QList<QVariant> list = params.values();
- mTemplist.clear();
+ for (int i = 0; i < mUiLoader->ContentInfoList().count(); i++)
+ {
+ mUiLoader->ContentInfoList().at(i)->setSelected(false);
+ }
for (int i = 0; i < list.count(); i++)
{
QString str = list.at(i).toString();
if (!str.isNull())
- mTemplist.append(str);
+ {
+ for (int j = 0; j < mUiLoader->ContentInfoList().count(); j++)
+ {
+ if (mUiLoader->ContentInfoList().at(i)->getBaseApp().contains(
+ str))
+ mUiLoader->ContentInfoList().at(i)->setSelected(
+ true);
+ }
+ }
}
if (searchKey.length() > 0)
mSearchPanel->setCriteria(searchKey);
@@ -1172,59 +1132,34 @@
mISprovidersIcon.insert(id, icon);
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::slotPrepareResultIcons
+// SearchProgressiveState::slotactivityRequested
// ---------------------------------------------------------------------------
-void SearchProgressiveState::slotPrepareResultIcons()
+void SearchProgressiveState::slotactivityRequested(const QString &name)
{
- //Icon creation in array
- QStringList icons;
- icons << "qtg_large_phonebook" << "qtg_large_tone" << "qtg_large_video"
- << "qtg_large_photos" << "qtg_large_message" << "qtg_large_email"
- << "qtg_large_calendar" << "qtg_large_notes"
- << "qtg_large_web_link" << "qtg_large_text" << "qtg_large_sisx"
- << "qtg_large_java" << "qtg_large_flash" << "qtg_large_query";
- mIconArray.clear();
- for (int i = 0; i < icons.count(); i++)
- {
- HbIcon icon(icons.at(i));
- if (icon.isNull() || !(icon.size().isValid()))
- icon = HbIcon("qtg_large_application");
- mIconArray.append(icon);
- }
- }
-// ---------------------------------------------------------------------------
-// SearchProgressiveState::activityRequested
-// ---------------------------------------------------------------------------
-void SearchProgressiveState::activityRequested(const QString &name)
- {
- /* when search application is launched in normal and then supporting for activity uri
- * for normal search launching "media" is used instead of "media image","media audio","media video"
- */
- if (mSearchHandlerList.count() != totalcategories_activityreasonreason)
- {
- InDeviceHandler* handler = NULL;
- handler->setCategory("media image");
- mSearchHandlerList.append(handler);
- handler->setCategory("media audio");
- mSearchHandlerList.append(handler);
- handler->setCategory("media video");
- mSearchHandlerList.append(handler);
- }
- if (name == "SearchDeviceQueryView")
+ if (name == SEARCHAIWDECLINDEVICE)
{
QVariantHash params = hbApp->activateParams();
- QString searchKey = params.value("query").toString();
+ QString searchKey = params.value(SEARCHAIWQUERY).toString();
int i = params.count();
- params.remove("query");
- params.remove("activityname");
+ params.remove(SEARCHAIWQUERY);
+ params.remove(XQURI_KEY_ACTIVITY_NAME);
QList<QVariant> list = params.values();
- int j = list.count();
- mTemplist.clear();
+ for (int i = 0; i < mUiLoader->ContentInfoList().count(); i++)
+ {
+ mUiLoader->ContentInfoList().at(i)->setSelected(false);
+ }
for (int i = 0; i < list.count(); i++)
{
QString str = list.at(i).toString();
if (!str.isNull())
- mTemplist.append(str);
+ {
+ for (int j = 0; j < mUiLoader->ContentInfoList().count(); j++)
+ {
+ if (mUiLoader->ContentInfoList().at(i)->getBaseApp().contains(
+ str))
+ mUiLoader->ContentInfoList().at(i)->setSelected(true);
+ }
+ }
}
if (searchKey.length() > 0)
mSearchPanel->setCriteria(searchKey);
@@ -1243,140 +1178,11 @@
HbListWidgetItem* listitem = new HbListWidgetItem();
bool addtoList = true;
- if (aDoc->baseAppClass().contains("contact"))
- {
- QStringList docsList = filterDoc(aDoc, "GivenName", "FamilyName");
- if (docsList.value(0, "").length())
- {
- firstrow.append(docsList.at(0));
- }
- if (docsList.value(1, "").length())
- {
- if (firstrow.length())
- firstrow.append(" ");
- firstrow.append(docsList.at(1));
- }
- if (firstrow.length() == 0)
- {
- firstrow = hbTrId("txt_phob_dblist_unnamed");
- }
- listitem->setData(mIconArray.at(0), Qt::DecorationRole);
- }
- else if (aDoc->baseAppClass().contains("audio"))
- {
- QStringList audioList = filterDoc(aDoc, "Title", "MediaId");
- if (audioList.value(0, "").length())
- {
- firstrow.append(audioList.at(0));
- }
- else
- {
- firstrow = hbTrId("txt_mus_dblist_val_unknown4");
- }
- listitem->setData(mIconArray.at(1), Qt::DecorationRole);
- if (audioList.value(1, "").length())
- {
- listitem->setData(audioList.at(1), Qt::UserRole + 2);
- }
- }
- else if (aDoc->baseAppClass().contains("video"))
- {
- QStringList videoList = filterDoc(aDoc, "Title", "MediaId", "Name");
- if (videoList.value(0, "").length())
- {
- firstrow.append(videoList.at(0));
- }
- else
- {
- firstrow.append(videoList.at(2));
- }
- listitem->setData(mIconArray.at(2), Qt::DecorationRole);
- if (videoList.value(1, "").length())
- {
- listitem->setData(videoList.at(1), Qt::UserRole + 2);
- }
- }
- else if (aDoc->baseAppClass().contains("image"))
- {
- QStringList imageList = filterDoc(aDoc, "Name", "MediaId");
-
- firstrow.append(imageList.at(0));
-
- listitem->setData(mIconArray.at(3), Qt::DecorationRole);
- if (imageList.value(1, "").length())
- {
- listitem->setData(imageList.at(1), Qt::UserRole + 2);
- }
- }
- else if (aDoc->baseAppClass().contains("msg email"))
- {
- QStringList emailList = filterDoc(aDoc, "Sender", "MailBoxId",
- "FolderId");
- firstrow.append(emailList.at(0));
- listitem->setData(emailList.at(1), Qt::UserRole + 2);
- listitem->setData(emailList.at(2), Qt::UserRole + 3);
- listitem->setData(mIconArray.at(5), Qt::DecorationRole);
- }
- else if (aDoc->baseAppClass().contains("msg"))
- {
- QStringList msgList = filterDoc(aDoc, "Folder", "To", "From");
- if (msgList.value(0).contains("Inbox"))
- {
- firstrow.append(msgList.at(2));
- }
- else
- {
- if (msgList.value(1, "").length())
- {
- firstrow.append(msgList.at(1));
- }
- else if (msgList.value(0).contains("Drafts"))
- {
- firstrow = QString("(no recipient)");
- }
- }
- listitem->setData(mIconArray.at(4), Qt::DecorationRole);
- }
- else if (aDoc->baseAppClass().contains("calendar"))
- {
- firstrow.append(filterDoc(aDoc, "Summary"));
- if (firstrow.length() == 0)
- {
- firstrow = hbTrId("txt_calendar_preview_unnamed");
- }
- listitem->setData(mIconArray.at(6), Qt::DecorationRole);
- }
- else if (aDoc->baseAppClass().contains("notes"))
- {
- firstrow.append(filterDoc(aDoc, "Memo"));
- if (firstrow.length() == 0)
- {
- firstrow = hbTrId("txt_notes_dblist_unnamed");
- }
- listitem->setData(mIconArray.at(7), Qt::DecorationRole);
- }
- else if (aDoc->baseAppClass().contains("applications"))
- {
- firstrow.append(filterDoc(aDoc, "Name"));
- bool ok;
- TRAP_IGNORE(listitem->setData(getAppIconFromAppIdL(TUid::Uid(aDoc->docId().toUInt(
- &ok, 16))), Qt::DecorationRole));
- }
- else if (aDoc->baseAppClass().contains("bookmark"))
- {
- firstrow.append(filterDoc(aDoc, "Name"));
- if (firstrow.length() == 0)
- {
- firstrow = "UnKnown";
- }
- listitem->setData(secondrow, Qt::UserRole + 2);
- listitem->setData(mIconArray.at(8), Qt::DecorationRole);
- }
- else if (aDoc->baseAppClass().contains("file folder"))
+ if (aDoc->baseAppClass().contains(FILEFOLDERCATEGORY))
{
bool ok;
- QStringList fileList = filterDoc(aDoc, "Name", "IsFolder",
- "Extension");
+ QStringList fileList = filterDoc(aDoc, NAMEFIELD, ISFOLDERFIELD,
+ EXTENSIONFIELD);
firstrow = fileList.at(0);
if (fileList.at(1).toInt(&ok) == 1) // not to show folder results
{
@@ -1387,37 +1193,78 @@
if (fileList.at(2).contains("sis", Qt::CaseInsensitive)
|| fileList.at(1).contains("sisx", Qt::CaseInsensitive))
{
- listitem->setData(mIconArray.at(10), Qt::DecorationRole);
+ listitem->setData(HbIcon("qtg_large_sisx"), Qt::DecorationRole);
}
else if (fileList.at(2).contains("java", Qt::CaseInsensitive)
|| fileList.at(2).contains("jar", Qt::CaseInsensitive)
|| fileList.at(2).contains("jad", Qt::CaseInsensitive))
{
- listitem->setData(mIconArray.at(11), Qt::DecorationRole);
+ listitem->setData(HbIcon("qtg_large_java"), Qt::DecorationRole);
}
else if (fileList.at(2).contains("swf", Qt::CaseInsensitive))
{
- listitem->setData(mIconArray.at(12), Qt::DecorationRole);
+ listitem->setData(HbIcon("qtg_large_flash"), Qt::DecorationRole);
}
else
{
- listitem->setData(mIconArray.at(13), Qt::DecorationRole);
+ listitem->setData(HbIcon("qtg_large_query"), Qt::DecorationRole);
}
}
}
- else if (aDoc->baseAppClass().contains("file"))
+ else if (aDoc->baseAppClass().contains(FILECATEGORY))
{
- QStringList fileList = filterDoc(aDoc, "Name", "Extension");
+ QStringList fileList = filterDoc(aDoc, NAMEFIELD, EXTENSIONFIELD);
firstrow = fileList.at(0);
if (firstrow.length() == 0)
firstrow = aDoc->baseAppClass();
if (fileList.at(1).contains("txt", Qt::CaseInsensitive))
{
- listitem->setData(mIconArray.at(9), Qt::DecorationRole);
+ listitem->setData(HbIcon("qtg_large_text"), Qt::DecorationRole);
}
else
{
- listitem->setData(mIconArray.at(13), Qt::DecorationRole);
+ listitem->setData(HbIcon("qtg_large_query"), Qt::DecorationRole);
+ }
+ }
+ else
+ {
+ if (aDoc->baseAppClass().contains(MEDIACATEGORY))
+ {
+ QStringList medialist = filterDoc(aDoc, FIRSTLINEFIELD, MEDIAIDFIELD);
+ firstrow = medialist.at(0);
+ listitem->setData(medialist.at(1), Qt::UserRole + 2);
+ }
+ else if (aDoc->baseAppClass().contains(EMAILCATEGORY))
+ {
+ QStringList emaillist = filterDoc(aDoc, FIRSTLINEFIELD,
+ MAILBOXFIELD, FOLDERFIELD);
+ firstrow = emaillist.at(0);
+ listitem->setData(emaillist.at(1), Qt::UserRole + 2);
+ listitem->setData(emaillist.at(2), Qt::UserRole + 3);
+ }
+ else
+ {
+ firstrow = filterDoc(aDoc, FIRSTLINEFIELD);
+ }
+ for (int i = 0; i < mUiLoader->ContentInfoList().count(); i++)
+ {
+ if (aDoc->baseAppClass()
+ == mUiLoader->ContentInfoList().at(i)->getBaseApp())
+ {
+ if (!firstrow.length())
+ {
+ firstrow = QString(hbTrId(mUiLoader->ContentInfoList().at(i)->getExceptionString().toAscii()));
+ }
+ if(mUiLoader->ContentInfoList().at(i)->getDisplayIcon().length())
+ {
+ listitem->setData(HbIcon(mUiLoader->ContentInfoList().at(i)->getDisplayIcon()), Qt::DecorationRole);
+ }
+ else
+ {
+ bool ok;
+ TRAP_IGNORE(listitem->setData(getAppIconFromAppIdL(TUid::Uid(aDoc->docId().toUInt(&ok, 16))), Qt::DecorationRole));
+ }
+ }
}
}
listitem->setText(firstrow);
@@ -1432,79 +1279,26 @@
delete aDoc;
}
// ---------------------------------------------------------------------------
-// SearchProgressiveState::constructHandlers overloaded
+// SearchProgressiveState::slotdbChanged
// ---------------------------------------------------------------------------
-InDeviceHandler* SearchProgressiveState::constructHandlers(int mDatabase)
+void SearchProgressiveState::slotdbChanged()
{
- InDeviceHandler* handler = NULL;
- handler = new InDeviceHandler();
- switch (mDatabase)
- {
- case 0:
- {
- handler->setCategory("");
- break;
- }
- case 1:
- {
- handler->setCategory("contact");
- break;
- }
- case 2:
- {
- handler->setCategory("media");
- break;
- }
- case 3:
- {
- handler->setCategory("msg");
- break;
- }
- case 4:
- {
- handler->setCategory("msg email");
- break;
- }
- case 5:
- {
- handler->setCategory("calendar");
- break;
- }
- case 6:
- {
- handler->setCategory("notes");
- break;
- }
- case 7:
- {
- handler->setCategory("applications");
- break;
- }
- case 8:
- {
- handler->setCategory("file");
- break;
- }
- case 9:
- {
- // handler->setCategory("bookmark");
- break;
- }
- case 10:
- {
- handler->setCategory("media image");
- break;
- }
- case 11:
- {
- handler->setCategory("media audio");
- break;
- }
- case 12:
- {
- handler->setCategory("media video");
- break;
- }
- }
- return handler;
+ constructHandlers();
}
+// ---------------------------------------------------------------------------
+// SearchProgressiveState::loadTranslator
+// ---------------------------------------------------------------------------
+void SearchProgressiveState::loadTranslator(QString localizationpath)
+ {
+ QTranslator* translator = new QTranslator();
+ QString lang = QLocale::system().name();
+
+ int pos = localizationpath.lastIndexOf("/");
+
+ QString path = localizationpath.left(pos);
+ QString filename = localizationpath.right(pos);
+
+ translator->load(filename + lang, path);
+
+ QCoreApplication::installTranslator(translator);
+ }
--- a/searchui/stateproviders/searchstateprovider/src/searchsettingsstate.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/src/searchsettingsstate.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -26,7 +26,6 @@
#include <hbaction.h>
#include <hbgridview.h>
#include <qstandarditemmodel.h>
-#include <qdebug.h>
#include <qgraphicswidget.h>
#include <qdir.h>
// ---------------------------------------------------------------------------
@@ -41,10 +40,7 @@
connect(mWidget, SIGNAL(settingsEvent(bool)), this,
SLOT(handleBackEvent(bool)));
-
- connect(mWidget, SIGNAL(selectedItemCategory(int, bool)), this,
- SLOT(getItemCategory(int, bool)));
-
+
connect(mWidget, SIGNAL(ISProvidersIcon(HbIcon, int)), this,
SLOT(slotISProvidersIcon(HbIcon, int)));
}
@@ -66,14 +62,6 @@
emit publishISProviderIcon(id, icon);
}
// ---------------------------------------------------------------------------
-// SearchSettingsState::getItemCategory
-// ---------------------------------------------------------------------------
-//
-void SearchSettingsState::getItemCategory(int str, bool avalue)
- {
- emit publishSelectedCategory(str, avalue);
- }
-// ---------------------------------------------------------------------------
// SearchSettingsState::onEntry
// ---------------------------------------------------------------------------
//
@@ -88,8 +76,6 @@
mWidget->loadIS();
isInternetOn();
minitialCount = false;
- // isInternetOn();
- //emit backEventTriggered();
}
else
{
--- a/searchui/stateproviders/searchstateprovider/src/searchstateprovider.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/src/searchstateprovider.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -22,8 +22,6 @@
#include "searchonlinestate.h"
#include <qstate.h>
-#include <qdebug.h>
-
// states
const char initStateFileUri[] = "search.nokia.com/state/initstate";
--- a/searchui/stateproviders/searchstateprovider/src/searchuiloader.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/src/searchuiloader.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -29,6 +29,8 @@
#include <tstasksettings.h>
#include <hbshrinkingvkbhost.h>
#include <qinputcontext.h>
+#include <cpixcontentinfodbread.h>
+#include <cpixcontentinfodbdef.h>
const char *SEARCHSTATEPROVIDER_DOCML = ":/xml/searchstateprovider.docml";
const char *TOC_VIEW = "tocView";
@@ -43,7 +45,7 @@
// ---------------------------------------------------------------------------
SearchUiLoader::SearchUiLoader() :
mDocumentLoader(NULL), mView(NULL), mListWidget(NULL),
- mSearchPanel(NULL), mClient(NULL), mMainWindow(NULL)
+ mSearchPanel(NULL), mClient(NULL), mMainWindow(NULL), mDb(NULL)
{
bool ok = false;
@@ -110,14 +112,18 @@
mBringtoForground = true;
+ readDB();
}
// ---------------------------------------------------------------------------
// SearchUiLoader::~SearchUiLoader
// ---------------------------------------------------------------------------
SearchUiLoader::~SearchUiLoader()
{
- delete mMainWindow;
delete mDocumentLoader;
+ qDeleteAll(mContentInfoList.begin(), mContentInfoList.end());
+ mContentInfoList.clear();
+ delete mDb;
+ delete mMainWindow;
delete mClient;
}
// ---------------------------------------------------------------------------
@@ -154,7 +160,78 @@
}
}
}
+void SearchUiLoader::readDB()
+ {
+ if (!mDb)
+ {
+ mDb = new ContentInfoDbRead();
+
+ connect(mDb,SIGNAL(dataChanged()),this,SLOT(slotdataChanged));
+ }
+
+ qDeleteAll(mContentInfoList.begin(), mContentInfoList.end());
+
+ mContentInfoList.clear();
+
+ QStringList primarykeys = mDb->getPrimaryKeys();
+
+ if(primarykeys.count())
+ {
+ SearchContentInfoDbData* ptr = new SearchContentInfoDbData();
+
+ ptr->setBaseApp("root");
+ ptr->setDisplayIcon(QString());
+
+ ptr->setDisplayName("txt_search_list_select_all");
+
+ ptr->setExceptionString(QString());
+
+ ptr->setDisplayOrder(0);
+
+ ptr->setTranslationPath(QString());
+
+ ptr->setActivityUri(QString());
+
+ mContentInfoList.append(ptr);
+ }
+ for (int i = 0; i < primarykeys.count(); i++)
+ {
+ if (!(mDb->getValues(primarykeys.at(i), BLACKLISTSTATUS).toInt()))
+ {
+ SearchContentInfoDbData* ptr = new SearchContentInfoDbData();
+
+ ptr->setCategoryName(primarykeys.at(i));
+
+ ptr->setBaseApp(mDb->getValues(primarykeys.at(i), BASEAPP));
+
+ ptr->setDisplayIcon(
+ mDb->getValues(primarykeys.at(i), DISPLAYICON));
+
+ ptr->setDisplayName(
+ mDb->getValues(primarykeys.at(i), DISPLAYNAME));
+
+ ptr->setExceptionString(mDb->getValues(primarykeys.at(i),
+ EXPECTIONID));
+
+ ptr->setDisplayOrder(mDb->getValues(primarykeys.at(i),
+ DISPLAYORDER).toInt());
+
+ ptr->setTranslationPath(mDb->getValues(primarykeys.at(i),
+ TRANSLATION));
+
+ ptr->setActivityUri(mDb->getValues(primarykeys.at(i), ACTIONURI));
+
+ mContentInfoList.append(ptr);
+ }
+ }
+ emit dbChanged();
+ }
+void SearchUiLoader::slotdataChanged()
+ {
+ //refresh the data base info
+ readDB();
+ }
// ---------------------------------------------------------------------------
// SearchMainWindow::slotViewReady
// ---------------------------------------------------------------------------
--- a/searchui/stateproviders/searchstateprovider/src/settingswidget.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/src/settingswidget.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -16,13 +16,13 @@
*/
#include "settingswidget.h"
#include "onlinehandler.h"
+#include "searchuiloader.h"
#include <hbdialog.h>
#include <hbcheckbox.h>
#include <qgraphicslinearlayout.h>
#include <hbaction.h>
#include <hblabel.h>
#include <qsignalmapper.h>
-#include <hbtooltip.h>
#include <qsettings.h>
#include <hbinputdialog.h>
#include <hbscrollarea.h>
@@ -35,10 +35,6 @@
#include <hbdataformviewitem.h>
#include <hbradiobuttonlist.h>
#include <qdir.h>
-#include <qsql.h>
-#include <qsqldatabase.h>
-#include <qsqlquery.h>
-#include <cpixcontentinfocommon.h>
const char *DELIMETER_DOCML = ":/xml/delimeterscreen.docml";
const char *DIALOG = "dialog";
@@ -51,19 +47,15 @@
SettingsWidget::SettingsWidget() :
signalMapper(NULL), popup(NULL), mDocumentLoader(NULL), dataform(NULL),
mModel(NULL), mSelectedScope(0), mSelectedProvider(0), comboBox(
- NULL), mInternetHandler(NULL)
+ NULL), mInternetHandler(NULL),mUiLoader(NULL)
{
- for (int i = 0; i < 8; i++)
- {
- mDeviceMapping.append(false);
- }
- mDeviceCategoryRefList = (QStringList() << "first" << "second" << "third"
- << "fourth" << "fifth" << "sixth" << "seventh" << "eigth");
+ mUiLoader = SearchUiLoader::instance();
+
+ connect(mUiLoader, SIGNAL(dbChanged), this, SLOT(slotdbChanged()));
mchangestate = true;
mInstialize = true;
isInternetSelected = false;
- storeDefaultSettings();
}
//----------------------------------------------------------------------------------------------------------------------------
//SettingsWidget::intialize()
@@ -109,15 +101,15 @@
popup->setDismissPolicy(HbDialog::NoDismiss);
popup->setTimeout(HbDialog::NoTimeout);
- HbAction * action = new HbAction(hbTrId("txt_common_button_ok"), popup);
- connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent()));
- mActions.append(action);
-
- action = new HbAction(hbTrId("txt_common_button_cancel"), popup);
- connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent()));
- mActions.append(action);
-
- popup->addActions(mActions);
+ primaryAction = new HbAction(hbTrId("txt_common_button_ok"), popup);
+
+ connect(primaryAction, SIGNAL(triggered()), this, SLOT(slotOkEvent()));
+
+ secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), popup);
+ connect(secondaryAction, SIGNAL(triggered()), this, SLOT(slotCancelEvent()));
+
+ popup->addAction(primaryAction);
+ popup->addAction(secondaryAction);
dataform->setModel(mModel);
@@ -128,9 +120,7 @@
loadBaseSettings();
- HbDataFormModelItem* themeComboGeneral = mModel->appendDataFormItem(
- HbDataFormModelItem::ComboBoxItem, hbTrId(
- "txt_search_info_select_search_scope"));
+ HbDataFormModelItem* themeComboGeneral = mModel->appendDataFormItem(HbDataFormModelItem::ComboBoxItem, hbTrId("txt_search_info_select_search_scope"));
themeComboGeneral->setContentWidgetData("items", mCategoryList);
@@ -138,48 +128,46 @@
QModelIndex index = mModel->indexFromItem(themeComboGeneral);
- HbDataFormViewItem *formItem =
- static_cast<HbDataFormViewItem *> (dataform->itemByIndex(index));
+ HbDataFormViewItem *formItem = static_cast<HbDataFormViewItem *> (dataform->itemByIndex(index));
comboBox = static_cast<HbComboBox*> (formItem->dataItemContentWidget());
- q_currentIndexChanged(mSelectedScope);
+ slotcurrentIndexChanged(mSelectedScope);
- connect(comboBox, SIGNAL(currentIndexChanged(int)), this,
- SLOT(q_currentIndexChanged(int)));
-
+ connect(comboBox, SIGNAL(currentIndexChanged(int)), this,SLOT(slotcurrentIndexChanged(int)));
}
//----------------------------------------------------------------------------------------------------------------------------
-//SettingsWidget::q_currentIndexChanged()
+//SettingsWidget::slotcurrentIndexChanged()
//
//----------------------------------------------------------------------------------------------------------------------------
-void SettingsWidget::q_currentIndexChanged(int avalue)
+void SettingsWidget::slotcurrentIndexChanged(int avalue)
{
for (int i = 0; i < mModelItemList.count(); i++)
{
mModel->removeItem(mModelItemList.at(i));
}
- mModelItemList.clear();
- // int ret = mModel->rowCount();
+ mModelItemList.clear();
if (!avalue) //device category creation
{
isInternetSelected = false;
+
HbCheckBox *checkboxitem = NULL;
+
+ qDeleteAll(mDeviceCheckBoxList.begin(), mDeviceCheckBoxList.end());
+
mDeviceCheckBoxList.clear();
+
for (int i = 0; i < mDeviceListDisplay.count(); i++)
{
-
- HbDataFormModelItem* mModelItem = mModel->appendDataFormItem(
- HbDataFormModelItem::CheckBoxItem);
+ HbDataFormModelItem* mModelItem = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem);
+
mModelItemList.append(mModelItem);
+
QModelIndex index = mModel->indexFromItem(mModelItem);
- HbDataFormViewItem *formItem =
- static_cast<HbDataFormViewItem *> (dataform->itemByIndex(
- index));
+ HbDataFormViewItem *formItem = static_cast<HbDataFormViewItem *> (dataform->itemByIndex(index));
- checkboxitem
- = static_cast<HbCheckBox*> (formItem->dataItemContentWidget());
+ checkboxitem = static_cast<HbCheckBox*> (formItem->dataItemContentWidget());
checkboxitem->setText(mDeviceListDisplay.at(i));
@@ -187,51 +175,53 @@
signalMapper->setMapping(mDeviceCheckBoxList.at(i), i);
- connect(mDeviceCheckBoxList.at(i), SIGNAL(stateChanged(int)),
- signalMapper, SLOT(map()));
+ connect(mDeviceCheckBoxList.at(i), SIGNAL(stateChanged(int)),signalMapper, SLOT(map()));
- connect(signalMapper, SIGNAL(mapped(int)), this,
- SLOT(itemChecked(int)));
+ connect(signalMapper, SIGNAL(mapped(int)), this,SLOT(slotstateChanged(int)));
}
loadDeviceSettings();
}
else
{
isInternetSelected = true;
+
+ qDeleteAll(mDeviceCheckBoxList.begin(), mDeviceCheckBoxList.end());
+
mDeviceCheckBoxList.clear();
- HbDataFormModelItem* mModelItem = mModel->appendDataFormItem(
- HbDataFormModelItem::RadioButtonListItem);
+
+ HbDataFormModelItem* mModelItem = mModel->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem);
+
mModelItemList.append(mModelItem);
+
QStringList internetCategoryList;
+
QMapIterator<int, QString> i(mServiceProviders);
- int selectedindex = 0;
- int Iterator = 0;
+
+ int selectedindex = 0,Iterator = 0;
+
while (i.hasNext())
{
i.next();
if (i.key() == mSelectedProvider)
selectedindex = Iterator;
Iterator++;
- internetCategoryList.append(i.value());
+ internetCategoryList.append(i.value());
}
mModelItem->setContentWidgetData("items", internetCategoryList);
- mModelItem->setContentWidgetData("previewMode",
- HbRadioButtonList::NoPreview);
+ mModelItem->setContentWidgetData("previewMode",HbRadioButtonList::NoPreview);
mModelItem->setContentWidgetData("selected", selectedindex);
QModelIndex index = mModel->indexFromItem(mModelItem);
- HbDataFormViewItem *formItem =
- static_cast<HbDataFormViewItem *> (dataform->itemByIndex(
- index));
- mradiolist
- = static_cast<HbRadioButtonList*> (formItem->dataItemContentWidget());
+ HbDataFormViewItem *formItem = static_cast<HbDataFormViewItem *> (dataform->itemByIndex(index));
+
+ mradiolist = static_cast<HbRadioButtonList*> (formItem->dataItemContentWidget());
- connect(mradiolist, SIGNAL(itemSelected(int)), this,
- SLOT(slotitemSelected(int)));
+ connect(mradiolist, SIGNAL(itemSelected(int)), this,SLOT(slotitemSelected(int)));
}
+
setActionVisibility();
}
//----------------------------------------------------------------------------------------------------------------------------
@@ -241,107 +231,33 @@
void SettingsWidget::preparecategories()
{
// read form database
-
mDeviceListDisplay.clear();
+ mDeviceStoragelist.clear();
mCategoryList.clear();
- mDeviceMapping.clear();
- for (int i = 0; i < 8; i++)
+
+ QString tempstr;
+ for (int i = 0; i < mUiLoader->ContentInfoList().count(); i++)
{
- mDeviceMapping.append(false);
- }
- mCategoryDbMapping.clear();
-
- QString mConnectionName(QString::fromUtf16(KContentInfoFileName().Ptr(),
- KContentInfoFileName().Length()));
- QString mDatabaseName(QString::fromUtf16(KCIDBPath().Ptr(),
- KCIDBPath().Length()) + "\\" + mConnectionName);
+ if (tempstr != hbTrId(mUiLoader->ContentInfoList().at(i)->getDisplayName().toAscii()))
+ {
+ tempstr = hbTrId(mUiLoader->ContentInfoList().at(i)->getDisplayName().toAscii());
- QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", mConnectionName);
- db.setDatabaseName(mDatabaseName);
-
- QSqlQuery query(QSqlDatabase::database(mConnectionName));
- QString statement = QString("SELECT * FROM ") + QString::fromUtf16(
- KContentInfoTableName().Ptr(), KContentInfoTableName().Length());
- query.prepare(statement);
- query.exec();
- while (query.next())
- {
- QString category_name = query.value(0).toString();
- int value = query.value(2).toInt();
- if (value)
- {
- mCategoryDbMapping.insert(category_name, false);
- }
- else
- {
- mCategoryDbMapping.insert(category_name, true);
+ mDeviceListDisplay.insert(mUiLoader->ContentInfoList().at(i)->getDisplayOrder(),
+ hbTrId(mUiLoader->ContentInfoList().at(i)->getDisplayName().toAscii()));
+
+ mDeviceStoragelist.insert(mUiLoader->ContentInfoList().at(i)->getDisplayOrder(),
+ mUiLoader->ContentInfoList().at(i)->getDisplayName());
}
}
- db.close();
-
- /* mCategoryDbMapping.insert("Contacts", true);
- mCategoryDbMapping.insert("Audios", true);
- mCategoryDbMapping.insert("Images", true);
- mCategoryDbMapping.insert("Videos", true);
- mCategoryDbMapping.insert("Messages", true);
- mCategoryDbMapping.insert("email", true);
- mCategoryDbMapping.insert("Calendar", true);
- mCategoryDbMapping.insert("Notes", true);
- mCategoryDbMapping.insert("Applications", true);
- mCategoryDbMapping.insert("Bookmarks", true);
- mCategoryDbMapping.insert("Files", true); */
-
- mDeviceListDisplay.append(hbTrId("txt_search_list_select_all"));
- mDeviceMapping.insert(0, true);
-
- if (mCategoryDbMapping.value("Contacts"))
- {
- mDeviceMapping.insert(1, true);
- mDeviceListDisplay.append(hbTrId("txt_search_list_contatcs"));
- }
- if (mCategoryDbMapping.value("Audios") || mCategoryDbMapping.value(
- "Images") || mCategoryDbMapping.value("Videos"))
- {
- mDeviceListDisplay.append(hbTrId("txt_search_list_media"));
- mDeviceMapping.insert(2, true);
- }
- if (mCategoryDbMapping.value("Messages") || mCategoryDbMapping.value(
- "email"))
- {
- mDeviceListDisplay.append(hbTrId("txt_search_list_messagemail"));
- mDeviceMapping.insert(3, true);
- }
- if (mCategoryDbMapping.value("Calendar") || mCategoryDbMapping.value(
- "Notes"))
- {
- mDeviceListDisplay.append(hbTrId("txt_search_list_calendarnotes"));
- mDeviceMapping.insert(4, true);
- }
- if (mCategoryDbMapping.value("Applications"))
- {
- mDeviceListDisplay.append(hbTrId("txt_search_list_applications"));
- mDeviceMapping.insert(5, true);
- }
- if (mCategoryDbMapping.value("Bookmarks"))
- {
- mDeviceListDisplay.append(hbTrId("txt_search_list_bookmarks"));
- mDeviceMapping.insert(6, true);
- }
- if (mCategoryDbMapping.value("Files"))
- {
- mDeviceListDisplay.append(hbTrId("txt_search_list_all_other_files"));
- mDeviceMapping.insert(7, true);
- }
-
if (mServiceProviders.count())
{
- mCategoryList = (QStringList() << hbTrId("txt_search_list_device")
- << hbTrId("txt_search_list_internet"));
+ mCategoryList = (QStringList() << hbTrId("txt_search_list_device")<< hbTrId("txt_search_list_internet"));
}
else
{
mCategoryList = (QStringList() << hbTrId("txt_search_list_device"));
}
+ storeDefaultSettings();
}
//----------------------------------------------------------------------------------------------------------------------------
//SettingsWidget::~SettingsWidget()
@@ -349,12 +265,12 @@
//----------------------------------------------------------------------------------------------------------------------------
SettingsWidget::~SettingsWidget()
{
+ SearchUiLoader::deleteinstance();
delete signalMapper;
delete mModel;
mDeviceCheckBoxList.clear();
mInternetCheckBoxList.clear();
- mModelItemList.clear();
- mActions.clear();
+ mModelItemList.clear();
delete mDocumentLoader;
delete mInternetHandler;
}
@@ -369,14 +285,6 @@
initialize();
mInstialize = false;
}
- if (mDeviceListDisplay.count() != 7)
- {
- preparecategories();
- q_currentIndexChanged(mSelectedScope);
- QDir dir;
- dir.remove(SETTINGS_INI_PATH);
- storeDefaultSettings();
- }
// refresh the screen to top
QModelIndex index = mModel->index(0, 0);
dataform->scrollTo(index);
@@ -402,29 +310,28 @@
}
if (!isInternetSelected)
{
- mActions.at(0)->setVisible(true);
+ primaryAction->setVisible(true);
if (noItemSelected)
{
- mActions.at(0)->setVisible(false);
+ primaryAction->setVisible(false);
}
}
else
{
- mActions.at(0)->setVisible(true);
+ primaryAction->setVisible(true);
}
}
//----------------------------------------------------------------------------------------------------------------------------
-//SettingsWidget::itemChecked( int selectedIndex)
+//SettingsWidget::slotstateChanged( int selectedIndex)
//
//----------------------------------------------------------------------------------------------------------------------------
-void SettingsWidget::itemChecked(int selectedIndex)
+void SettingsWidget::slotstateChanged(int selectedIndex)
{
if (mDeviceCheckBoxList.count() != 0)
{
if (selectedIndex == 0 && mchangestate) // validating the select all
{
- if ((mDeviceCheckBoxList.at(selectedIndex)->checkState()
- == Qt::Checked))
+ if ((mDeviceCheckBoxList.at(selectedIndex)->checkState() == Qt::Checked))
{
checkSubCategories();
}
@@ -435,8 +342,7 @@
}
else
{
- if ((mDeviceCheckBoxList.at(selectedIndex)->checkState()
- == Qt::Unchecked))
+ if ((mDeviceCheckBoxList.at(selectedIndex)->checkState() == Qt::Unchecked))
{
mchangestate = false;
mDeviceCheckBoxList.at(0)->setCheckState(Qt::Unchecked);
@@ -474,9 +380,8 @@
//SettingsWidget::checkBoxCancelEvent()
//
//----------------------------------------------------------------------------------------------------------------------------
-void SettingsWidget::checkBoxCancelEvent()
- {
- // loadDeviceSettings();//bug fix for cancel event selection should not reflect "go" button
+void SettingsWidget::slotCancelEvent()
+ {
emit settingsEvent(false);
}
//----------------------------------------------------------------------------------------------------------------------------
@@ -484,7 +389,7 @@
//
//----------------------------------------------------------------------------------------------------------------------------
-void SettingsWidget::checkBoxOkEvent()
+void SettingsWidget::slotOkEvent()
{
storeSettingsToiniFile();
emit settingsEvent(true);
@@ -493,36 +398,24 @@
//void SettingsWidget::storeSettingsToiniFile()
//
//----------------------------------------------------------------------------------------------------------------------------
-
void SettingsWidget::storeSettingsToiniFile()
{
QSettings appSettings(SETTINGS_INI_PATH, QSettings::IniFormat);
isInternetSelected ? (mSelectedScope = 1) : (mSelectedScope = 0);
appSettings.setValue("selectedcategory", mSelectedScope);
- appSettings.setValue("devicecount", mDeviceCategoryRefList.count());
if (!isInternetSelected)
{
- int j = 0;
- for (int i = 0; i < mDeviceCategoryRefList.count(); i++)
+ for (int i = 0; i < mDeviceCheckBoxList.count(); i++)
{
- if (mDeviceMapping.at(i))
+ int value;
+ (mDeviceCheckBoxList.at(i)->checkState() == Qt::Checked) ? (value = 1) : (value = 0);
+
+ appSettings.setValue(mDeviceStoragelist.at(i), value);
+
+ for (int j = 0; j < mUiLoader->ContentInfoList().count(); j++)
{
- if (mDeviceCheckBoxList.at(j)->checkState() == Qt::Checked)
- {
- appSettings.setValue(mDeviceCategoryRefList.at(i), 1);
- emit selectedItemCategory(i, true);
- }
- else
- {
- appSettings.setValue(mDeviceCategoryRefList.at(i), 0);
- emit selectedItemCategory(i, false);
- }
- j++;
- }
- else
- {
- appSettings.setValue(mDeviceCategoryRefList.at(i), 0);
- emit selectedItemCategory(i, false);
+ if (mUiLoader->ContentInfoList().at(j)->getDisplayName() == mDeviceStoragelist.at(i))
+ value ? (mUiLoader->ContentInfoList().at(j)->setSelected(true)) : (mUiLoader->ContentInfoList().at(j)->setSelected(false));
}
}
}
@@ -535,8 +428,7 @@
{
QSettings appSettings(SETTINGS_INI_PATH, QSettings::IniFormat);
mSelectedScope = appSettings.value("selectedcategory", 0).toInt();
- mSelectedScope ? (isInternetSelected = true) : (isInternetSelected
- = false);
+ mSelectedScope ? (isInternetSelected = true) : (isInternetSelected = false);
}
//----------------------------------------------------------------------------------------------------------------------------
@@ -548,28 +440,30 @@
QSettings appSettings(SETTINGS_INI_PATH, QSettings::IniFormat);
int value;
if (!isInternetSelected)
- {
- int j = 0;
- for (int i = 0; i < mDeviceCategoryRefList.count(); i++)
+ {
+ for (int i = 0; i < mDeviceStoragelist.count(); i++)
{
- value
- = appSettings.value(mDeviceCategoryRefList.at(i), 1).toInt();
- if (mDeviceMapping.count() && mDeviceCheckBoxList.count()
- && mDeviceMapping.at(i))
+ value = appSettings.value(mDeviceStoragelist.at(i), 1).toInt();
+ if (value && mDeviceCheckBoxList.at(i))
+ {
+ mDeviceCheckBoxList.at(i)->setCheckState(Qt::Checked);
+ }
+ else
{
- if (value)
+ mDeviceCheckBoxList.at(i)->setCheckState(Qt::Unchecked);
+ }
+ }
+ QStringList allKeys = appSettings.allKeys();
+ for (int k = 0; k < allKeys.count(); k++)
+ {
+ value = appSettings.value(allKeys.at(k), 1).toInt();
+ for (int j = 0; j < mUiLoader->ContentInfoList().count(); j++)
+ {
+ if (mUiLoader->ContentInfoList().at(j)->getDisplayName() == allKeys.at(k))
{
- mDeviceCheckBoxList.at(j)->setCheckState(Qt::Checked);
- }
- else
- {
- mDeviceCheckBoxList.at(j)->setCheckState(Qt::Unchecked);
+ value ? (mUiLoader->ContentInfoList().at(j)->setSelected(true)) : (mUiLoader->ContentInfoList().at(j)->setSelected(false));
}
- j++;
}
- value
- ? (emit selectedItemCategory(i, true))
- : (emit selectedItemCategory(i, false));
}
}
}
@@ -589,13 +483,15 @@
void SettingsWidget::storeDefaultSettings()
{
QSettings appSettings(SETTINGS_INI_PATH, QSettings::IniFormat);
- if (!appSettings.contains("selectedcategory")) // change the settings for the first time only
+ if (!appSettings.contains("selectedcategory"))
{
mSelectedScope = 0;
appSettings.setValue("selectedcategory", mSelectedScope);
- appSettings.setValue("devicecount", mDeviceCategoryRefList.count());
- for (int i = 0; i < mDeviceCategoryRefList.count(); i++)
- appSettings.setValue(mDeviceCategoryRefList.at(i), 1);
+ }
+ for (int i = 0; i < mDeviceStoragelist.count(); i++)
+ {
+ if (!appSettings.contains(mDeviceStoragelist.at(i)))
+ appSettings.setValue(mDeviceStoragelist.at(i), 1);
}
}
//----------------------------------------------------------------------------------------------------------------------------
@@ -643,12 +539,21 @@
if (!mInternetHandler)
{
mInternetHandler = new OnlineHandler();
- connect(mInternetHandler,
- SIGNAL(providerDetails(QString, HbIcon, int)), this,
- SLOT(slotproviderDetails(QString, HbIcon, int)));
+
+ connect(mInternetHandler,SIGNAL(providerDetails(QString, HbIcon, int)), this,SLOT(slotproviderDetails(QString, HbIcon, int)));
- connect(mInternetHandler, SIGNAL(defaultProvider(const int)), this,
- SLOT(slotdefaultProvider(const int)));
+ connect(mInternetHandler, SIGNAL(defaultProvider(const int)), this,SLOT(slotdefaultProvider(const int)));
+
mInternetHandler->readSettings();
}
}
+//----------------------------------------------------------------------------------------------------------------------------
+//void SettingsWidget::slotdbChanged()
+//
+//----------------------------------------------------------------------------------------------------------------------------
+void SettingsWidget::slotdbChanged()
+ {
+ preparecategories();
+
+ slotcurrentIndexChanged(mSelectedScope);
+ }
--- a/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/inc/t_searchstateprovider.h Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/inc/t_searchstateprovider.h Tue Oct 05 13:32:14 2010 +0530
@@ -50,12 +50,10 @@
void testProgressiveStateConstruction();
void testProgressiveStateOnEntryAndExitSignalled();
- void testgetAppIconFromAppId();
- void testsetSelectedCategories();
+ void testgetAppIconFromAppId();
void testonAsyncSearchComplete();
void testonGetDocumentComplete();
void testopenResultitem();
- void testgetSettingCategory();
void testsetSettings();
void teststartNewSearch();
void testsettingsaction();
@@ -75,7 +73,6 @@
void testsettingsStateConstruction();
void testsettingsStateOnEntryAndExitSignalled();
void testhandleBackEvent();
- void testgetItemCategory();
void testisInternetOn();
/**
* t_searchinitstate.cpp
@@ -103,7 +100,7 @@
void testcreateGui();
void testpreparecategories();
void testq_currentIndexChanged();
- void selectedItemCategory();
+
--- a/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/src/t_searchprogressivestate.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/src/t_searchprogressivestate.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -1,5 +1,6 @@
#include "t_searchstateprovider.h"
#include "searchprogressivestate.h"
+#include "searchuiloader.h"
#include <qsignalspy.h>
#include "indevicehandler.h"
#include <hblistwidget.h>
@@ -42,8 +43,6 @@
void SearchStateProviderTest::testProgressiveStateOnEntryAndExitSignalled()
{
- // HbMainWindow* wind = mainWindow();
-
SearchProgressiveState* progressiveState = new SearchProgressiveState();
QEvent *event = new QEvent(QEvent::None);
@@ -52,25 +51,6 @@
progressiveState->onExit(event);
delete progressiveState;
-
- // delete wind;
- }
-void SearchStateProviderTest::testsetSelectedCategories()
- {
- SearchProgressiveState* progressiveState = new SearchProgressiveState();
- QEvent *event = new QEvent(QEvent::None);
- progressiveState->onEntry(event);
- progressiveState->getSettingCategory(0, true);
- progressiveState->getSettingCategory(1, true);
- progressiveState->getSettingCategory(2, true);
- progressiveState->getSettingCategory(3, true);
- progressiveState->getSettingCategory(4, true);
- progressiveState->getSettingCategory(5, true);
- progressiveState->getSettingCategory(6, true);
- progressiveState->getSettingCategory(7, true);
- progressiveState->setSelectedCategories();
- QVERIFY(progressiveState->mTemplist.count());
- delete progressiveState;
}
void SearchStateProviderTest::testgetAppIconFromAppId()
{
@@ -78,91 +58,59 @@
SearchProgressiveState* progressiveState = new SearchProgressiveState();
QEvent *event = new QEvent(QEvent::None);
progressiveState->onEntry(event);
- for (int i = 0; i < progressiveState->mIconArray.count(); i++)
- {
- QVERIFY(!(progressiveState->mIconArray.at(i).isNull()));
- }
- progressiveState->mIconArray.clear();
+ TRAP_IGNORE(progressiveState->getAppIconFromAppIdL(TUid::Uid(0x2002C377)));
delete progressiveState;
}
-
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
-
-
void SearchStateProviderTest::testonAsyncSearchComplete()
{
- // HbMainWindow* wind = mainWindow();
SearchProgressiveState* progressiveState = new SearchProgressiveState();
QEvent *event = new QEvent(QEvent::None);
- progressiveState->onEntry(event);
- progressiveState->getSettingCategory(0, true);
- progressiveState->getSettingCategory(1, true);
- progressiveState->getSettingCategory(2, true);
- progressiveState->getSettingCategory(3, true);
- progressiveState->getSettingCategory(4, true);
- progressiveState->getSettingCategory(5, true);
- progressiveState->getSettingCategory(6, true);
- progressiveState->getSettingCategory(7, true);
-
- progressiveState->mSearchHandler
- = progressiveState->mSearchHandlerList.at(2);
-
- //progressiveState->mSearchHandler->searchAsync("$prefix(\\jpg\\", "_aggregate");
- //progressiveState->mSearchHandler->searchAsync("$prefix(\"jpg\")", "_aggregate");
- progressiveState->onAsyncSearchComplete(-1,0);
- progressiveState->onAsyncSearchComplete(0,0);
- progressiveState->onAsyncSearchComplete(0,10);
+ progressiveState->onEntry(event);
+ progressiveState->slotonAsyncSearchComplete(-1,0);
+ progressiveState->slotonAsyncSearchComplete(0,0);
+ progressiveState->slotonAsyncSearchComplete(0,10);
QVERIFY(progressiveState->mResultcount);
-
delete progressiveState;
- // delete wind;
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
void SearchStateProviderTest::testonGetDocumentComplete()
{
- // HbMainWindow* wind = mainWindow();
SearchProgressiveState* progressiveState = new SearchProgressiveState();
QEvent *event = new QEvent(QEvent::None);
-
- progressiveState->mSelectedCategory.insert(5, true);
+ for(int i = 0;i<progressiveState->mUiLoader->ContentInfoList().count();i++)
+ {
+ if(progressiveState->mUiLoader->ContentInfoList().at(i)->getBaseApp().contains("root applications"))
+ progressiveState->mUiLoader->ContentInfoList().at(i)->setSelected(true);
+ }
+
progressiveState->onEntry(event);
- // progressiveState->mSearchHandler = progressiveState->mSearchHandlerList.at(1);
- progressiveState->onGetDocumentComplete(0, NULL);
+
+ progressiveState->slotonGetDocumentComplete(0, NULL);
QCOMPARE(progressiveState->mListView->count(),0);
- progressiveState->onGetDocumentComplete(-1, NULL);
+ progressiveState->slotonGetDocumentComplete(-1, NULL);
QCOMPARE(progressiveState->mListView->count(),0);
- progressiveState->startNewSearch("contact");
+ progressiveState->slotstartNewSearch("contact");
QTest::qWait(2000);
int i = progressiveState->mListView->count();
QVERIFY(progressiveState->mListView->count());
delete progressiveState;
- // delete wind;
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
void SearchStateProviderTest::testopenResultitem()
- {
- // HbMainWindow* wind = mainWindow();
+ {
SearchProgressiveState* progressiveState = new SearchProgressiveState();
QEvent *event = new QEvent(QEvent::None);
- progressiveState->getSettingCategory(0, true);
- progressiveState->getSettingCategory(1, true);
- progressiveState->getSettingCategory(2, true);
- progressiveState->getSettingCategory(3, true);
- progressiveState->getSettingCategory(4, true);
- progressiveState->getSettingCategory(5, true);
- progressiveState->getSettingCategory(6, true);
- progressiveState->getSettingCategory(7, true);
-
progressiveState->onEntry(event);
- progressiveState->startNewSearch("Creat");
+ progressiveState->slotstartNewSearch("Creat");
QTest::qWait(2000);
//code for getting the model index from model
@@ -183,33 +131,8 @@
//code for getting the model index from model
index = progressiveState->mModel->index(3, 0);
progressiveState->openResultitem(index);*/
- delete progressiveState;
- // delete wind;
+ delete progressiveState;
}
-
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-//
-void SearchStateProviderTest::testgetSettingCategory()
- {
- // HbMainWindow* wind = mainWindow();
- SearchProgressiveState* progressiveState = new SearchProgressiveState();
- QEvent *event = new QEvent(QEvent::None);
- progressiveState->onEntry(event);
-
- progressiveState->getSettingCategory(0, false);
- progressiveState->getSettingCategory(1, false);
- progressiveState->getSettingCategory(2, false);
- progressiveState->getSettingCategory(4, false);
- progressiveState->getSettingCategory(5, false);
- progressiveState->getSettingCategory(6, false);
- progressiveState->getSettingCategory(7, false);
- progressiveState->getSettingCategory(3, true);
- QCOMPARE(progressiveState->mSelectedCategory.count(),8);
- delete progressiveState;
- // delete wind;
- }
-
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
@@ -219,7 +142,7 @@
QEvent *event = new QEvent(QEvent::None);
progressiveState->onEntry(event);
QSignalSpy spy(progressiveState, SIGNAL(switchProToSettingsState()));
- progressiveState->setSettings();
+ progressiveState->slotsetSettings();
QCOMPARE(spy.count(), 1);
delete progressiveState;
}
@@ -228,16 +151,13 @@
SearchProgressiveState* progressiveState = new SearchProgressiveState();
QEvent *event = new QEvent(QEvent::None);
progressiveState->onEntry(event);
- progressiveState->getSettingCategory(0, true);
- progressiveState->getSettingCategory(1, true);
- progressiveState->getSettingCategory(2, true);
- progressiveState->getSettingCategory(3, true);
- progressiveState->getSettingCategory(4, true);
- progressiveState->getSettingCategory(5, true);
- progressiveState->getSettingCategory(6, true);
- progressiveState->getSettingCategory(7, true);
-
- progressiveState->startNewSearch("jpg");
+ for(int i = 0;i<progressiveState->mUiLoader->ContentInfoList().count();i++)
+ {
+ if(progressiveState->mUiLoader->ContentInfoList().at(i)->getBaseApp().contains("root applications"))
+ progressiveState->mUiLoader->ContentInfoList().at(i)->setSelected(true);
+ }
+
+ progressiveState->slotstartNewSearch("contact");
QTest::qWait(2000);
QVERIFY(progressiveState->mListView->count());
delete progressiveState;
@@ -250,11 +170,16 @@
SearchProgressiveState* progressiveState = new SearchProgressiveState();
QEvent *event = new QEvent(QEvent::None);
progressiveState->onEntry(event);
- progressiveState->getSettingCategory(5, true);
- progressiveState->mOriginalString = "a";
- progressiveState->settingsaction(false);
+ for(int i = 0;i<progressiveState->mUiLoader->ContentInfoList().count();i++)
+ {
+ if(progressiveState->mUiLoader->ContentInfoList().at(i)->getBaseApp().contains("root applications"))
+ progressiveState->mUiLoader->ContentInfoList().at(i)->setSelected(true);
+ }
+
+ progressiveState->mOriginalString = "contact";
+ progressiveState->slotsettingsaction(false);
QCOMPARE(progressiveState->mResultcount, 0);
- progressiveState->settingsaction(true);
+ progressiveState->slotsettingsaction(true);
QTest::qWait(50);
QCOMPARE(progressiveState->mResultcount, 0);
delete progressiveState;
@@ -268,8 +193,13 @@
SearchProgressiveState* progressiveState = new SearchProgressiveState();
QEvent *event = new QEvent(QEvent::None);
progressiveState->onEntry(event);
- progressiveState->getSettingCategory(5, true);
- progressiveState->startNewSearch("d");
+ for(int i = 0;i<progressiveState->mUiLoader->ContentInfoList().count();i++)
+ {
+ if(progressiveState->mUiLoader->ContentInfoList().at(i)->getBaseApp().contains("root applications"))
+ progressiveState->mUiLoader->ContentInfoList().at(i)->setSelected(true);
+ }
+
+ progressiveState->slotstartNewSearch("contact");
delete progressiveState;
}
@@ -280,9 +210,9 @@
QEvent *event = new QEvent(QEvent::None);
progressiveState->onEntry(event);
QVariant var;
- progressiveState->handleOk(var);
+ progressiveState->slothandleOk(var);
int ret = 0;
- progressiveState->handleError(ret, QString());
+ progressiveState->slothandleError(ret, QString());
delete progressiveState;
}
@@ -329,10 +259,7 @@
SearchProgressiveState* progressiveState = new SearchProgressiveState();
QEvent *event = new QEvent(QEvent::None);
progressiveState->onEntry(event);
-
-
- //progressiveState->mISprovidersIcon.insert(1,icon1);
- progressiveState->mISprovidersIcon.insert(1, progressiveState->mIconArray.at(1));
+ TRAP_IGNORE(progressiveState->mISprovidersIcon.insert(1, progressiveState->getAppIconFromAppIdL(TUid::Uid(0x2002C377))));
progressiveState->createSuggestionLink();
QCOMPARE(progressiveState->mListView->count(), 1);
delete progressiveState;
@@ -382,7 +309,7 @@
progressiveState->mSelectedCategory.insert(2, true);
progressiveState->onEntry(event);
- progressiveState->startNewSearch("3gpp");
+ progressiveState->slotstartNewSearch("3gpp");
QTest::qWait(200);
HbListWidgetItem* item = progressiveState->mListView->item(0);
@@ -409,7 +336,7 @@
QEvent *event = new QEvent(QEvent::None);
progressiveState->mSelectedCategory.insert(5, true);
progressiveState->onEntry(event);
- progressiveState->startNewSearch("d");
+ progressiveState->slotstartNewSearch("d");
QTest::qWait(200);
delete progressiveState;
}
--- a/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/src/t_searchsettingsstate.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/src/t_searchsettingsstate.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -7,14 +7,11 @@
//
void SearchStateProviderTest::testsettingsStateConstruction()
{
- // HbMainWindow* wind = mainWindow();
SearchSettingsState* settingsState = new SearchSettingsState();
QVERIFY(settingsState != NULL);
QVERIFY(settingsState->mWidget);
-
delete settingsState;
-
}
// ---------------------------------------------------------------------------
//SearchStateProviderTest::testsettingsStateOnEntryAndExitSignalled()
@@ -22,8 +19,6 @@
//
void SearchStateProviderTest::testsettingsStateOnEntryAndExitSignalled()
{
- // HbMainWindow* wind = mainWindow();
-
SearchSettingsState* settingsState = new SearchSettingsState();
QEvent *event = new QEvent(QEvent::None);
@@ -49,24 +44,6 @@
delete settingsState;
}
// ---------------------------------------------------------------------------
-//SearchStateProviderTest::test_selectedcategory()
-// ---------------------------------------------------------------------------
-//
-void SearchStateProviderTest::testgetItemCategory()
- {
- SearchSettingsState* settingsState = new SearchSettingsState();
-
- QSignalSpy spy(settingsState,
- SIGNAL(publishSelectedCategory(int, bool)));
- settingsState->getItemCategory(1, true);
- settingsState->getItemCategory(1, false);
- settingsState->getItemCategory(6, true);
- settingsState->getItemCategory(6, true);
- QCOMPARE(spy.count(), 4);
- delete settingsState;
- }
-
-// ---------------------------------------------------------------------------
//SearchStateProviderTest::testisInternetOn()
// ---------------------------------------------------------------------------
//
--- a/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/src/t_settingswidget.cpp Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/src/t_settingswidget.cpp Tue Oct 05 13:32:14 2010 +0530
@@ -15,7 +15,6 @@
//
void SearchStateProviderTest::testsettingswizardConstruction()
{
- // HbMainWindow* wind = mainWindow();
SettingsWidget* settingswizard = new SettingsWidget();
QVERIFY(settingswizard != NULL);
@@ -29,18 +28,8 @@
void SearchStateProviderTest::teststoreSettingsToiniFile()
{
SettingsWidget* settingswizard = new SettingsWidget();
-
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
- HbAction * action = new HbAction();
- //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent()));
- settingswizard->mActions.append(action);
-
- action = new HbAction();
- //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent()));
- settingswizard->mActions.append(action);
-
- settingswizard->q_currentIndexChanged(0);
+
+ settingswizard->initialize();
for (int i = 0; i < settingswizard->mDeviceCheckBoxList.count(); i++)
(settingswizard->mDeviceCheckBoxList.at(i))->setCheckState(
@@ -49,6 +38,7 @@
settingswizard->storeSettingsToiniFile();
settingswizard->loadDeviceSettings();
+
for (int i = 0; i < settingswizard->mDeviceCheckBoxList.count(); i++)
QCOMPARE(settingswizard->mDeviceCheckBoxList.at(i)->checkState(),Qt::Unchecked);
@@ -59,17 +49,13 @@
//
void SearchStateProviderTest::testloadDeviceSettings()
{
- SettingsWidget* settingswizard = new SettingsWidget();
-
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
+ SettingsWidget* settingswizard = new SettingsWidget();
settingswizard->initialize();
-
- settingswizard->q_currentIndexChanged(0);
-
+
for (int i = 0; i < settingswizard->mDeviceCheckBoxList.count(); i++)
(settingswizard->mDeviceCheckBoxList.at(i))->setCheckState(
Qt::Checked);
+
settingswizard->storeSettingsToiniFile();
settingswizard->loadDeviceSettings();
@@ -82,9 +68,6 @@
void SearchStateProviderTest::testloadBaseSettings()
{
SettingsWidget* settingswizard = new SettingsWidget();
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
-
QCOMPARE(settingswizard->mSelectedScope,0);
delete settingswizard;
}
@@ -94,19 +77,8 @@
void SearchStateProviderTest::testlaunchSettingWidget()
{
SettingsWidget* settingswizard = new SettingsWidget();
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
- HbAction * action = new HbAction();
- // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent()));
- settingswizard->mActions.append(action);
-
- action = new HbAction();
- //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent()));
- settingswizard->mActions.append(action);
-
- settingswizard->q_currentIndexChanged(0);
+ settingswizard->initialize();
settingswizard->launchSettingWidget();
-
delete settingswizard;
}
@@ -116,7 +88,6 @@
settingswizard->initialize();
settingswizard->isInternetSelected = false;
QCOMPARE(settingswizard->isInternetSearchOptionSelected(),false);
-
delete settingswizard;
}
@@ -124,10 +95,7 @@
{
SettingsWidget* settingswizard = new SettingsWidget();
settingswizard->initialize();
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
- settingswizard->q_currentIndexChanged(0);
settingswizard->mDeviceCheckBoxList.at(0)->setCheckState(Qt::Unchecked);
for (int i = 0; i < settingswizard->mDeviceCheckBoxList.count(); i++)
@@ -141,10 +109,6 @@
SettingsWidget* settingswizard = new SettingsWidget();
settingswizard->initialize();
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
-
- settingswizard->q_currentIndexChanged(0);
settingswizard->mDeviceCheckBoxList.at(0)->setCheckState(Qt::Checked);
for (int i = 0; i < settingswizard->mDeviceCheckBoxList.count(); i++)
@@ -161,10 +125,6 @@
SettingsWidget* settingswizard = new SettingsWidget();
settingswizard->initialize();
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
-
- settingswizard->q_currentIndexChanged(0);
for (int i = 0; i < settingswizard->mDeviceCheckBoxList.count(); i++)
QCOMPARE(settingswizard->mDeviceCheckBoxList.at(i)->checkState(),Qt::Checked);
@@ -173,21 +133,9 @@
void SearchStateProviderTest::testcheckBoxOkEvent()
{
SettingsWidget* settingswizard = new SettingsWidget();
-
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
- HbAction * action = new HbAction();
- // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent()));
- settingswizard->mActions.append(action);
-
- action = new HbAction();
- //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent()));
- settingswizard->mActions.append(action);
-
- settingswizard->q_currentIndexChanged(0);
-
+ settingswizard->initialize();
QSignalSpy spy(settingswizard, SIGNAL(settingsEvent(bool)));
- settingswizard->checkBoxOkEvent();
+ settingswizard->slotOkEvent();
QCOMPARE(spy.count(), 1);
delete settingswizard;
@@ -195,21 +143,9 @@
void SearchStateProviderTest::testcheckBoxCancelEvent()
{
SettingsWidget* settingswizard = new SettingsWidget();
-
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
-
- HbAction * action = new HbAction();
- // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent()));
- settingswizard->mActions.append(action);
-
- action = new HbAction();
- //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent()));
- settingswizard->mActions.append(action);
-
- settingswizard->q_currentIndexChanged(0);
+ settingswizard->initialize();
QSignalSpy spy(settingswizard, SIGNAL(settingsEvent(bool)));
- settingswizard->checkBoxCancelEvent();
+ settingswizard->slotCancelEvent();
QCOMPARE(spy.count(), 1);
delete settingswizard;
@@ -218,17 +154,6 @@
{
SettingsWidget* settingswizard = new SettingsWidget();
settingswizard->initialize();
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
- HbAction * action = new HbAction();
- // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent()));
- settingswizard->mActions.append(action);
-
- action = new HbAction();
- //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent()));
- settingswizard->mActions.append(action);
-
- settingswizard->q_currentIndexChanged(0);
settingswizard->mDeviceCheckBoxList.at(0)->setCheckState(Qt::Unchecked);
@@ -242,9 +167,6 @@
void SearchStateProviderTest::testpreparecategories()
{
SettingsWidget* settingswizard = new SettingsWidget();
-
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
settingswizard->preparecategories();
QVERIFY(settingswizard->mDeviceListDisplay.count());
delete settingswizard;
@@ -253,44 +175,13 @@
void SearchStateProviderTest::testq_currentIndexChanged()
{
SettingsWidget* settingswizard = new SettingsWidget();
-
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
- settingswizard->initialize();
- HbAction * action = new HbAction();
- // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent()));
- settingswizard->mActions.append(action);
-
- action = new HbAction();
- //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent()));
- settingswizard->mActions.append(action);
-
- settingswizard->q_currentIndexChanged(0);
- settingswizard->q_currentIndexChanged(1);
- delete settingswizard;
- }
-void SearchStateProviderTest::selectedItemCategory()
- {
- SettingsWidget* settingswizard = new SettingsWidget();
-
- settingswizard->mCategoryDbMapping.insert("Contacts", true);
- settingswizard->mCategoryDbMapping.insert("Messages", true);
- HbAction * action = new HbAction();
- // connect(action, SIGNAL(triggered()), this, SLOT(checkBoxOkEvent()));
- settingswizard->mActions.append(action);
-
- action = new HbAction();
- //connect(action, SIGNAL(triggered()), this, SLOT(checkBoxCancelEvent()));
- settingswizard->mActions.append(action);
- settingswizard->q_currentIndexChanged(0);
- QSignalSpy spy(settingswizard, SIGNAL(selectedItemCategory(int,bool)));
- settingswizard->loadDeviceSettings();
- QVERIFY(spy.count());
+ settingswizard->initialize();
delete settingswizard;
}
void SearchStateProviderTest::testcreateGui()
{
- SettingsWidget* settingswizard = new SettingsWidget();
+ SettingsWidget* settingswizard = new SettingsWidget();
+ settingswizard->initialize();
delete settingswizard;
}
--- a/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/t_searchstateprovider.pro Tue Sep 28 11:50:55 2010 +0530
+++ b/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/t_searchstateprovider.pro Tue Oct 05 13:32:14 2010 +0530
@@ -35,8 +35,9 @@
LIBS += -lefsrv
LIBS += -lapgrfx
LIBS += -lws32
-LIBS += -lavkon
-LIBS += -ltstaskmonitorclient.dll
+LIBS += -ltstaskmonitorclient
+LIBS += -lcpixcontentinfodb
+LIBS += -lxqserviceutil
CONFIG += qtestlib
CONFIG += hb
@@ -61,7 +62,7 @@
CONFIG += symbian_test
TARGET.UID2 = 0x100039CE
TARGET.UID3 = 0x20026F9A
-TARGET.CAPABILITY = ALL -TCB -DRM
+TARGET.CAPABILITY = CAP_GENERAL_DLL
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
}