# HG changeset patch # User hgs # Date 1287123338 -19800 # Node ID 7a8855317cbd4106fecddf11e5c9c74e9b42ef4e # Parent 367228f82b66a21fa8e07d4dfc432b1763b2c2a4 201041 diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/applications/inc/applicationsplugin.h --- a/harvesterplugins/applications/inc/applicationsplugin.h Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/applications/inc/applicationsplugin.h Fri Oct 15 11:45:38 2010 +0530 @@ -60,6 +60,7 @@ virtual void StartHarvestingL(const TDesC& aQualifiedBaseAppClass); void PausePluginL(); void ResumePluginL(); + void SaveL(); public: // From MDelayedCallbackObserver void DelayedCallbackL(TInt aCode); diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/applications/src/applicationsplugin.cpp --- a/harvesterplugins/applications/src/applicationsplugin.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/applications/src/applicationsplugin.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -371,6 +371,11 @@ OstTraceFunctionExit0( CAPPLICATIONSPLUGIN_RESUMEPLUGINL_EXIT ); } +void CApplicationsPlugin::SaveL() + { + + } + #ifdef __PERFORMANCE_DATA void CApplicationsPlugin::UpdatePerformaceDataL() { diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/calendar/group/calendarplugin.mmp --- a/harvesterplugins/calendar/group/calendarplugin.mmp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/calendar/group/calendarplugin.mmp Fri Oct 15 11:45:38 2010 +0530 @@ -43,6 +43,8 @@ LIBRARY euser.lib LIBRARY ecom.lib LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY bafl.lib LIBRARY calinterimapi.lib LIBRARY cpixharvesterplugininterface.lib LIBRARY cpixsearchclient.lib diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/calendar/inc/ccalendarplugin.h --- a/harvesterplugins/calendar/inc/ccalendarplugin.h Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/calendar/inc/ccalendarplugin.h Fri Oct 15 11:45:38 2010 +0530 @@ -71,6 +71,7 @@ void StartHarvestingL(const TDesC& aQualifiedBaseAppClass); void PausePluginL(); void ResumePluginL(); + void SaveL(); public: // From MCalProgressCallBack @@ -151,9 +152,16 @@ * Symbian 2nd phase constructor. */ void ConstructL(); + + void LoadL(); private: + /* File server connection */ + RFs iFs; + /* Path to the queued records file */ + TFileName iFilePath; + /** The asynchronizer */ CDelayedCallback* iAsynchronizer; diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/calendar/src/ccalendarplugin.cpp --- a/harvesterplugins/calendar/src/ccalendarplugin.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/calendar/src/ccalendarplugin.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -21,7 +21,8 @@ #include #include -#include +#include +#include #include #include #include @@ -40,6 +41,7 @@ /** The delay between harvesting chunks. */ const TInt KHarvestingDelay = 2000; +_LIT(KManagerFileName, "CalendarStore.temp"); _LIT(KCalendarTimeFormat,"%04d %02d %02d %02d %02d"); _LIT(KExcerptTimeFormat,"%04d/%02d/%02d %02d:%02d"); @@ -99,6 +101,8 @@ iSession->StopChangeNotification(); } delete iSession; + + iFs.Close(); } // --------------------------------------------------------------------------- @@ -118,6 +122,15 @@ } iCalIterator = CCalIter::NewL( *iSession ); iEntryView = CCalEntryView::NewL( *iSession, *this ); + + User::LeaveIfError(iFs.Connect()); + TFileName pathWithoutDrive; + iFs.CreatePrivatePath(EDriveC); + iFilePath = _L("C:"); + iFs.PrivatePath( pathWithoutDrive ); + iFilePath.Append(pathWithoutDrive); + iFilePath.Append(KManagerFileName); + } // --------------------------------------------------------------------------- @@ -145,7 +158,10 @@ endTimeCal.SetTimeUtcL( endTime ); CCalChangeNotificationFilter* filter = CCalChangeNotificationFilter::NewL( MCalChangeCallBack2::EChangeEntryAll, ETrue, CalCommon::TCalTimeRange( startTimeCal, endTimeCal ) ); iSession->StartChangeNotification( *this, *filter ); - delete filter; + delete filter; + + if( BaflUtils::FileExists(iFs,iFilePath) ) + LoadL(); } // --------------------------------------------------------------------------- @@ -594,8 +610,7 @@ void CCalendarPlugin::ResumePluginL() { OstTraceFunctionEntry0( CCALENDARPLUGIN_RESUMEPLUGINL_ENTRY ); - iIndexState = ETrue; - + iIndexState = ETrue; if( iHarvestState == EHarvesterStartHarvest ) { if(iAsynchronizer->CallbackPending()) @@ -640,7 +655,7 @@ void CCalendarPlugin::IndexQueuedItems() { OstTraceFunctionEntry0( CCALENDARPLUGIN_INDEXQUEUEDITEMS_ENTRY ); - while (iJobQueue.Count()>0) + while (iJobQueue.Count()>0 && iIndexState ) { TRecord entry = iJobQueue[0]; //Let the indexer handle this object TRAP it as it can leave @@ -650,8 +665,68 @@ iJobQueue.Remove(0); } } + + if(iJobQueue.Count() <= 0) + { + //Check for temp file, it exists delete + if( BaflUtils::FileExists( iFs, iFilePath )) + BaflUtils::DeleteFile( iFs, iFilePath ); + + } OstTraceFunctionExit0( CCALENDARPLUGIN_INDEXQUEUEDITEMS_EXIT ); } + +void CCalendarPlugin::LoadL() + { + // Open the stream + RFile file; + User::LeaveIfError(file.Open(iFs, iFilePath, EFileRead)); + CleanupClosePushL(file); + RFileReadStream rd(file); + rd.PushL(); + + // Read harvester count + TInt count = rd.ReadInt32L(); + // Read the harvesters + for (TInt i=0; i ( rd.ReadInt16L()); + OverWriteOrAddToQueueL(record.iLocalUid, record.iActionType); + } + + if( count > 0) + IndexQueuedItems(); + // Cleanup + CleanupStack::PopAndDestroy(2, &file); + } + +void CCalendarPlugin::SaveL() + { + if(iJobQueue.Count() <= 0) + return; + + // Open the stream + RFile file; + User::LeaveIfError(file.Replace(iFs, iFilePath, EFileWrite)); + CleanupClosePushL(file); + + RFileWriteStream wr(file); + wr.PushL(); + + // Write harvester count + wr.WriteInt32L(iJobQueue.Count()); + + for (TInt i=0; i #include +#include +#include #include "OstTraceDefinitions.h" #ifdef OST_TRACE_COMPILER_IN_USE #include "ccontactspluginTraces.h" @@ -40,7 +42,7 @@ _LIT(KExcerptDelimiter, " "); _LIT(KTimeFormat, "%D%N%Y%1 %2 %3"); //Date, Month name and Year format - +_LIT(KManagerFileName, "ContactStore.temp"); // ----------------------------------------------------------------------------- // CContactsPlugin::NewL() // ----------------------------------------------------------------------------- @@ -95,7 +97,8 @@ delete iHLDisplayExcerpt; iHLDisplayExcerpt = NULL; } -//#endif +//#endif + iFs.Close(); } // ----------------------------------------------------------------------------- @@ -103,7 +106,8 @@ // ----------------------------------------------------------------------------- // void CContactsPlugin::ConstructL() - { + { + iDatabase = CContactDatabase::OpenL(); iIndexState = ETrue; // This pointer is valid until a change is made to the database or until @@ -112,7 +116,17 @@ // array must first be made. iContacts = iDatabase->SortedItemsL(); - iAsynchronizer = CDelayedCallback::NewL( CActive::EPriorityIdle ); + iAsynchronizer = CDelayedCallback::NewL( CActive::EPriorityIdle );// connect to file system + + User::LeaveIfError(iFs.Connect()); + // Load the configuration + TFileName pathWithoutDrive; + iFs.CreatePrivatePath(EDriveC); + iFilePath = _L("C:"); + iFs.PrivatePath( pathWithoutDrive ); + iFilePath.Append(pathWithoutDrive); + iFilePath.Append(KManagerFileName); + } // ----------------------------------------------------------------------------- @@ -133,6 +147,9 @@ // Start monitoring when plugin is started iChangeNotifier = CContactChangeNotifier::NewL(*iDatabase, this); + + if( BaflUtils::FileExists(iFs,iFilePath) ) + LoadL(); } // ----------------------------------------------------------------------------- @@ -640,7 +657,8 @@ if (iJobQueue[i].iContactId == aEntry.iContactId) { // Older version found - iJobQueue[i] = aEntry; + iJobQueue[i].iContactId = aEntry.iContactId; + iJobQueue[i].iActionType = aEntry.iActionType; OstTraceFunctionExit0( CCONTACTSPLUGIN_OVERWRITEORADDTOQUEUEL_EXIT ); return; } @@ -653,7 +671,7 @@ void CContactsPlugin::IndexQueuedItems() { OstTraceFunctionEntry0( CCONTACTSPLUGIN_INDEXQUEUEDITEMS_ENTRY ); - while (iJobQueue.Count()>0) + while (iJobQueue.Count()>0 && iIndexState ) { TRecord entry = iJobQueue[0]; //Let the indexer handle this object TRAP it as it can leave @@ -663,8 +681,67 @@ iJobQueue.Remove(0); } } + + if( iJobQueue.Count() == 0 ) + { + //Check for temp file, it exists delete + if( BaflUtils::FileExists( iFs, iFilePath )) + BaflUtils::DeleteFile( iFs, iFilePath ); + } OstTraceFunctionExit0( CCONTACTSPLUGIN_INDEXQUEUEDITEMS_EXIT ); } + +void CContactsPlugin::LoadL() + { + // Open the stream + RFile file; + User::LeaveIfError(file.Open(iFs, iFilePath, EFileRead)); + CleanupClosePushL(file); + RFileReadStream rd(file); + rd.PushL(); + + // Read harvester count + TInt count = rd.ReadInt32L(); + // Read the harvesters + for (TInt i=0; i ( rd.ReadInt16L()); + OverWriteOrAddToQueueL(record); + } + + if( count > 0) + IndexQueuedItems(); + // Cleanup + CleanupStack::PopAndDestroy(2, &file); + } + +void CContactsPlugin::SaveL() + { + if (iJobQueue.Count() <= 0) + return; + + // Open the stream + RFile file; + User::LeaveIfError(file.Replace(iFs, iFilePath, EFileWrite)); + CleanupClosePushL(file); + + RFileWriteStream wr(file); + wr.PushL(); + + // Write harvester count + wr.WriteInt32L(iJobQueue.Count()); + + for (TInt i=0; i // TDriveNumber - +#include +#include #include #include #include @@ -64,6 +65,7 @@ void StartHarvestingL(const TDesC& aQualifiedBaseAppClass); void PausePluginL(); void ResumePluginL(); + void SaveL(); /** * CreateContentIndexItemL sends a file for indexing contents * @aFilename full path and filename of the file to be indexed @@ -158,6 +160,8 @@ void AddToQueueL(const TDesC& aFilename, TCPixActionType aActionType, TBool aIsFolder); void IndexQueuedItems(); + + void LoadL(); protected: CFilePlugin(); @@ -174,7 +178,10 @@ RArray iJobQueue; // File system session - RFs iFs; + RFs iFs; + + /* Path to the queued records file */ + TFileName iFilePath; // Harvester CFileHarvester* iHarvester; diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/file/src/cfileplugin.cpp --- a/harvesterplugins/file/src/cfileplugin.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/file/src/cfileplugin.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -56,6 +56,7 @@ _LIT(KMimeTypeFile, FILE_MIMETYPE); _LIT(KMimeTypeFolder , FOLDER_MIMETYPE); _LIT(KMimeTypeField , CPIX_MIMETYPE_FIELD); +_LIT(KManagerFileName, "FilesStore.temp"); #define CONSTANT_TO_PTR16(ptr, c) TPtrC16 ptr; ptr.Set((const TUint16*)c,User::StringLength(c) ); @@ -221,7 +222,18 @@ iHarvester = CFileHarvester::NewL(*this, iFs); iMonitor = CFileMonitor::NewL(*this, &iFs); - iMmcMonitor = CMMCMonitor::NewL(*this, &iFs); + iMmcMonitor = CMMCMonitor::NewL(*this, &iFs); + + // connect to file system + User::LeaveIfError(iFs.Connect()); + // Load the configuration + TFileName pathWithoutDrive; + iFs.CreatePrivatePath(EDriveC); + iFilePath = _L("C:"); + iFs.PrivatePath( pathWithoutDrive ); + iFilePath.Append(pathWithoutDrive); + iFilePath.Append(KManagerFileName); + } void CFilePlugin::StartPluginL() @@ -266,6 +278,9 @@ } } } + + if( BaflUtils::FileExists(iFs,iFilePath) ) + LoadL(); } void CFilePlugin::MountL(TDriveNumber aMedia, TBool aForceReharvest) @@ -687,11 +702,9 @@ } void CFilePlugin::RemoveFileDatabaseL(TDriveNumber aDrive) - { - RFs aFs; - User::LeaveIfError( aFs.Connect() ); + { TChar drive; - TInt err = aFs.DriveToChar((TDriveNumber)aDrive,drive); + TInt err = iFs.DriveToChar((TDriveNumber)aDrive,drive); if ( err == KErrNone ) { TBuf folderpath; @@ -700,12 +713,11 @@ folderpath.Append(KCPixSearchServerPrivateDirectory); folderpath.Append(KIndexingDBPath); folderpath.Append(KfileDBPath); - CFileMan* FileMan = CFileMan::NewL(aFs); + CFileMan* FileMan = CFileMan::NewL(iFs); if ( FileMan ) FileMan->Delete( folderpath ); delete FileMan; } - aFs.Close(); } void CFilePlugin::PausePluginL() @@ -771,9 +783,73 @@ } iJobQueue.Remove(0); } + + if(iJobQueue.Count() <= 0) + { + //Check for temp file, it exists delete + if( BaflUtils::FileExists( iFs, iFilePath )) + BaflUtils::DeleteFile( iFs, iFilePath ); + } + OstTraceFunctionExit0( CFILEPLUGIN_INDEXQUEUEDITEMS_EXIT ); } +void CFilePlugin::LoadL() + { + // Open the stream + RFile file; + User::LeaveIfError(file.Open(iFs, iFilePath, EFileRead)); + CleanupClosePushL(file); + RFileReadStream rd(file); + rd.PushL(); + + // Read harvester count + TInt count = rd.ReadInt32L(); + // Read the harvesters + for (TInt i=0; i ( rd.ReadInt16L()); + record.isFolder = rd.ReadInt8L(); + AddToQueueL(record.iUri, record.iActionType, record.isFolder); + } + + if( count > 0) + IndexQueuedItems(); + // Cleanup + CleanupStack::PopAndDestroy(2, &file); + } + +void CFilePlugin::SaveL() + { + if (iJobQueue.Count() <= 0) + return; + + // Open the stream + RFile file; + User::LeaveIfError(file.Replace(iFs, iFilePath, EFileWrite)); + CleanupClosePushL(file); + + RFileWriteStream wr(file); + wr.PushL(); + + // Write harvester count + wr.WriteInt32L(iJobQueue.Count()); + + for (TInt i=0; i - +#include +#include #include "harvesterserverlogger.h" #include "common.h" #include "csearchdocument.h" @@ -41,6 +42,7 @@ //Constants _LIT(KPathTrailer, "\\root\\media\\audio"); +_LIT(KManagerFileName, "AudioStore.temp"); //***** MEDAI AUDIO***** #define MEDIA_QBASEAPPCLASS "@0:root media audio" @@ -53,6 +55,7 @@ #define DATABASEPATH "\\root\\media\\audio" #define LDATABASEPATH "\\root\\media\\audio" + // ----------------------------------------------------------------------------- CAudioPlugin* CAudioPlugin::NewL() { @@ -94,12 +97,23 @@ delete iMMcMonitor; delete iDBManager; delete iMdsItem; + iFs.Close(); } // ----------------------------------------------------------------------------- void CAudioPlugin::ConstructL() { iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this); + // connect to file system + User::LeaveIfError(iFs.Connect()); + // Load the configuration + TFileName pathWithoutDrive; + iFs.CreatePrivatePath(EDriveC); + iFilePath = _L("C:"); + iFs.PrivatePath( pathWithoutDrive ); + iFilePath.Append(pathWithoutDrive); + iFilePath.Append(KManagerFileName); + iObjectJobQueueManager->SetFilePath(iFilePath); } // ----------------------------------------------------------------------------- @@ -130,6 +144,8 @@ TUid uidOfPlugin = {0x20029AB9}; iDBManager = CCPIXMDEDbManager::NewL(uidOfPlugin); iMdsItem = CMDSEntity::NewL(); + if( BaflUtils::FileExists(iFs,iFilePath) ) + LoadL(); OstTraceFunctionExit0( CAUDIOPLUGIN_STARTPLUGINL_EXIT ); } @@ -334,18 +350,28 @@ void CAudioPlugin::PausePluginL() { - OstTraceFunctionEntry0( CAUDIOPLUGIN_PAUSEPLUGINL_ENTRY ); - iObjectJobQueueManager->PauseL(); + OstTraceFunctionEntry0( CAUDIOPLUGIN_PAUSEPLUGINL_ENTRY ); + iObjectJobQueueManager->PauseL(); OstTraceFunctionExit0( CAUDIOPLUGIN_PAUSEPLUGINL_EXIT ); } void CAudioPlugin::ResumePluginL() { - OstTraceFunctionEntry0( CAUDIOPLUGIN_RESUMEPLUGINL_ENTRY ); + OstTraceFunctionEntry0( CAUDIOPLUGIN_RESUMEPLUGINL_ENTRY ); iObjectJobQueueManager->ResumeL(); OstTraceFunctionExit0( CAUDIOPLUGIN_RESUMEPLUGINL_EXIT ); } +void CAudioPlugin::LoadL() + { + iObjectJobQueueManager->LoadQueuedItems(); + } + +void CAudioPlugin::SaveL() + { + iObjectJobQueueManager->SaveQueuedItems(); + } + #ifdef __PERFORMANCE_DATA void CAudioPlugin::UpdateLogL() { diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/media/image/group/bld.inf --- a/harvesterplugins/media/image/group/bld.inf Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/media/image/group/bld.inf Fri Oct 15 11:45:38 2010 +0530 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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" diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/media/image/inc/imageplugin.h --- a/harvesterplugins/media/image/inc/imageplugin.h Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/media/image/inc/imageplugin.h Fri Oct 15 11:45:38 2010 +0530 @@ -82,6 +82,7 @@ void StartHarvestingL(const TDesC & aQualifiedBaseAppClass); void PausePluginL(); void ResumePluginL(); + void SaveL(); /* * HandleMdeItemL callback from MMediaObjectHandler * @param TItemId aObjId object Id @@ -113,7 +114,13 @@ */ void ConstructL(); + void LoadL(); + private: + /* File server connection */ + RFs iFs; + /* Path to the queued records file */ + TFileName iFilePath; CCPixIndexer *iIndexer; //Indexer CMdeHarvester* iMdeHarvester; //Mde harvester owned CMdeObjectQueueManager* iObjectJobQueueManager; //Objectqueue manager owned diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/media/image/src/imageplugin.cpp --- a/harvesterplugins/media/image/src/imageplugin.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/media/image/src/imageplugin.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -17,7 +17,9 @@ #include "imageplugin.h" -#include +#include +#include +#include #include "harvesterserverlogger.h" #include "common.h" #include "csearchdocument.h" @@ -39,6 +41,7 @@ //Constants _LIT(KPathTrailer, "\\root\\media\\image"); +_LIT(KManagerFileName, "ImageStore.temp"); //***** MEDAI AUDIO***** #define MEDIA_QBASEAPPCLASS "@0:root media image" @@ -92,12 +95,23 @@ delete iMMcMonitor; delete iDBManager; delete iMdsItem; + iFs.Close(); } // ----------------------------------------------------------------------------- void CImagePlugin::ConstructL() { - iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this); + iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this); + // connect to file system + User::LeaveIfError(iFs.Connect()); + // Load the configuration + TFileName pathWithoutDrive; + iFs.CreatePrivatePath(EDriveC); + iFilePath = _L("C:"); + iFs.PrivatePath( pathWithoutDrive ); + iFilePath.Append(pathWithoutDrive); + iFilePath.Append(KManagerFileName); + iObjectJobQueueManager->SetFilePath(iFilePath); } // ----------------------------------------------------------------------------- @@ -128,6 +142,8 @@ TUid uidOfPlugin = {0x20029ABB}; iDBManager = CCPIXMDEDbManager::NewL(uidOfPlugin); iMdsItem = CMDSEntity::NewL(); + if( BaflUtils::FileExists(iFs,iFilePath) ) + LoadL(); OstTraceFunctionExit0( CIMAGEPLUGIN_STARTPLUGINL_EXIT ); } @@ -339,11 +355,21 @@ void CImagePlugin::ResumePluginL() { - OstTraceFunctionEntry0( CIMAGEPLUGIN_RESUMEPLUGINL_ENTRY ); + OstTraceFunctionEntry0( CIMAGEPLUGIN_RESUMEPLUGINL_ENTRY ); iObjectJobQueueManager->ResumeL(); OstTraceFunctionExit0( CIMAGEPLUGIN_RESUMEPLUGINL_EXIT ); } +void CImagePlugin::SaveL() + { + iObjectJobQueueManager->LoadQueuedItems(); + } + +void CImagePlugin::LoadL() + { + iObjectJobQueueManager->SaveQueuedItems(); + } + #ifdef __PERFORMANCE_DATA void CImagePlugin::UpdateLogL() { diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/media/mediautils/inc/mdeobjectqueuemanager.h --- a/harvesterplugins/media/mediautils/inc/mdeobjectqueuemanager.h Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/media/mediautils/inc/mdeobjectqueuemanager.h Fri Oct 15 11:45:38 2010 +0530 @@ -18,7 +18,11 @@ #ifndef MDEOBJECTQUEUEMANAGER_H_ #define MDEOBJECTQUEUEMANAGER_H_ + #include +#include +#include +#include #include #include "mediaobjecthandler.h" @@ -54,6 +58,12 @@ TInt RunError(); void PauseL(); void ResumeL(); + + void SetFilePath( const TDesC& aFilePath ); + + void SaveQueuedItems(); + + void LoadQueuedItems(); private: /* * OverWriteOrAddToQueueL add or update item to queue @@ -97,7 +107,11 @@ }; private: // Queue of documents to be indexed - RArray iJobQueue; + RArray iJobQueue; + //File server connection + RFs iFs; + // Path to the queued records + TFileName iFilePath; // State machine's state TState iState; THarvestingState iHState; diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/media/mediautils/src/mdeobjectqueuemanager.cpp --- a/harvesterplugins/media/mediautils/src/mdeobjectqueuemanager.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/media/mediautils/src/mdeobjectqueuemanager.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -54,6 +54,7 @@ { Cancel(); iTimer.Close(); + iFs.Close(); } // ----------------------------------------------------------------------------- @@ -74,6 +75,7 @@ void CMdeObjectQueueManager::ConstructL() { CActiveScheduler::Add(this); + User::LeaveIfError(iFs.Connect()); User::LeaveIfError(iTimer.CreateLocal()); iHState = EStateResume; } @@ -125,13 +127,17 @@ // Maximum is exceeded, force the write immediately if (iState == EStateWaiting) { - iTimer.Cancel(); // RunL will be called with iStatus of KErrCancelled + if(IsActive()) + 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 + if(!IsActive()) + { + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete(status, KErrNone); // RunL will be called with iStatus of KErrNone + } } } else @@ -139,9 +145,12 @@ // 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(); + if(!IsActive()) + { + iState = EStateWaiting; + iTimer.After(iStatus, INDEXING_DELAY); // Wait 5 seconds before putting this to index + SetActive(); + } } } } @@ -160,7 +169,7 @@ CPIXLOGSTRING("END CMdeObjectQueueManager::RunL as Harvester in Pause state"); return; } - while (iJobQueue.Count()>0 ) + while (iJobQueue.Count()>0 && iHState == EStateResume ) { TMdeActionRecord object = iJobQueue[0]; //iJobQueue.Remove(0); @@ -188,7 +197,13 @@ iMdeObjectHandler->UpdateLogL(); #endif // Everything is indexed no need to be waiting anymore - iState = EStateNone; + iState = EStateNone; + + if(iJobQueue.Count() <= 0) + { + if( BaflUtils::FileExists( iFs, iFilePath )) + BaflUtils::DeleteFile( iFs, iFilePath ); + } CPIXLOGSTRING("END CMdeObjectQueueManager::RunL"); } @@ -229,4 +244,55 @@ ActivateAO(); } +void CMdeObjectQueueManager::SetFilePath(const TDesC& aFilePath) + { + iFilePath.Copy(aFilePath); + } + +void CMdeObjectQueueManager::SaveQueuedItems() + { + if( iJobQueue.Count() <= 0) + return; + // Open the stream + RFile file; + User::LeaveIfError(file.Replace(iFs, iFilePath, EFileWrite)); + CleanupClosePushL(file); + + RFileWriteStream wr(file); + wr.PushL(); + + // Write harvester count + wr.WriteInt32L(iJobQueue.Count()); + + for (TInt i=0; i ( rd.ReadInt16L()); + AddMdeItemToQueueL( iObjId, iActionType ); + } + // Cleanup + CleanupStack::PopAndDestroy(2, &file); + } //End of file diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/media/video/inc/videoplugin.h --- a/harvesterplugins/media/video/inc/videoplugin.h Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/media/video/inc/videoplugin.h Fri Oct 15 11:45:38 2010 +0530 @@ -75,7 +75,7 @@ void PausePluginL(); void ResumePluginL(); - + void SaveL(); /* * HandleMdeItemL callback from MMediaObjectHandler * @param TItemId aObjId object Id @@ -106,11 +106,16 @@ * Second phase constructor */ void ConstructL(); - + + void LoadL(); + private: - // data - CCPixIndexer* iIndexer; //Indexer - CMdeHarvester* iMdeHarvester; //Mde harvester owned + /* File server connection */ + RFs iFs; + /* Path to the queued records file */ + TFileName iFilePath; + CCPixIndexer *iIndexer; //Indexer + CMdeHarvester* iMdeHarvester; //Mde harvester owned CMdeObjectQueueManager* iObjectJobQueueManager; //Objectqueue manager owned CMdsMediaMonitor* iMdsMonitor;//MDS monitor owned CMdsSessionObjectUtils* iMdsUtils;//Mds utils owned diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/media/video/src/videoplugin.cpp --- a/harvesterplugins/media/video/src/videoplugin.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/media/video/src/videoplugin.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -18,6 +18,8 @@ // Include Files #include "videoplugin.h" //CVideoPlugin #include +#include +#include #include "harvesterserverlogger.h" #include "common.h" #include "csearchdocument.h" @@ -39,6 +41,7 @@ //Constants _LIT(KPathTrailer, "\\root\\media\\video"); +_LIT(KManagerFileName, "VideoStore.temp"); #define MEDIA_QBASEAPPCLASS "@0:root media video" #define LMEDIA_QBASEAPPCLASS L"@0:root media video" #define MEDIAAPPCLASS "root media video" @@ -87,12 +90,23 @@ delete iMMcMonitor; delete iDBManager; delete iMdsItem; + iFs.Close(); } void CVideoPlugin::ConstructL() { iObjectJobQueueManager = CMdeObjectQueueManager::NewL(this); - } + // connect to file system + User::LeaveIfError(iFs.Connect()); + // Load the configuration + TFileName pathWithoutDrive; + iFs.CreatePrivatePath(EDriveC); + iFilePath = _L("C:"); + iFs.PrivatePath( pathWithoutDrive ); + iFilePath.Append(pathWithoutDrive); + iFilePath.Append(KManagerFileName); + iObjectJobQueueManager->SetFilePath(iFilePath); + } void CVideoPlugin::StartPluginL() { @@ -120,6 +134,8 @@ TUid uidOfPlugin = {0x20029ABA}; iDBManager = CCPIXMDEDbManager::NewL(uidOfPlugin); iMdsItem = CMDSEntity::NewL(); + if( BaflUtils::FileExists(iFs,iFilePath) ) + LoadL(); OstTraceFunctionExit0( CVIDEOPLUGIN_STARTPLUGINL_EXIT ); } @@ -331,10 +347,22 @@ void CVideoPlugin::ResumePluginL() { OstTraceFunctionEntry0( CVIDEOPLUGIN_RESUMEPLUGINL_ENTRY ); + if( BaflUtils::FileExists( iFs, iFilePath )) + BaflUtils::DeleteFile( iFs, iFilePath ); iObjectJobQueueManager->ResumeL(); OstTraceFunctionExit0( CVIDEOPLUGIN_RESUMEPLUGINL_EXIT ); } +void CVideoPlugin::LoadL() + { + iObjectJobQueueManager->LoadQueuedItems(); + } + +void CVideoPlugin::SaveL() + { + iObjectJobQueueManager->SaveQueuedItems(); + } + #ifdef __PERFORMANCE_DATA void CVideoPlugin::UpdateLogL() { diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/messaging/email/inc/cemailplugin.h --- a/harvesterplugins/messaging/email/inc/cemailplugin.h Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/messaging/email/inc/cemailplugin.h Fri Oct 15 11:45:38 2010 +0530 @@ -54,6 +54,8 @@ void PausePluginL(); void ResumePluginL(); + + void SaveL(); /** * Gets the database observer class diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/messaging/email/src/cemailplugin.cpp --- a/harvesterplugins/messaging/email/src/cemailplugin.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/messaging/email/src/cemailplugin.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -393,6 +393,11 @@ } +void CEmailPlugin::SaveL() + { + + } + // --------------------------------------------------------------------------- // CEmailPlugin::UpdatePerformaceDataL // --------------------------------------------------------------------------- diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/messaging/smsmms/group/messageplugin.mmp --- a/harvesterplugins/messaging/smsmms/group/messageplugin.mmp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/messaging/smsmms/group/messageplugin.mmp Fri Oct 15 11:45:38 2010 +0530 @@ -45,6 +45,8 @@ LIBRARY euser.lib LIBRARY ecom.lib LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY bafl.lib LIBRARY msgs.lib LIBRARY gsmu.lib LIBRARY cpixharvesterplugininterface.lib diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/messaging/smsmms/inc/cmessagedatahandler.h --- a/harvesterplugins/messaging/smsmms/inc/cmessagedatahandler.h Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/messaging/smsmms/inc/cmessagedatahandler.h Fri Oct 15 11:45:38 2010 +0530 @@ -57,6 +57,12 @@ void GatherDataL(TMsvId& aMessageId, TCPixActionType aActionType, TMsvId& aFolderId); void ResumeL(); + + void SetFilePath( const TDesC& aFilePath ); + + void SaveRecordsL(); + + void LoadRecordsL(); private: //From CActive @@ -165,6 +171,7 @@ CPop3ClientMtm* iPop3Mtm; // client for opening pop3 CImap4ClientMtm* iImap4Mtm; // client for opening imap4 RFs iFs; + TFileName iFilePath; #ifdef HARVESTERPLUGINTESTER_FRIEND friend class CHarvesterPluginTester; #endif diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/messaging/smsmms/inc/cmessageplugin.h --- a/harvesterplugins/messaging/smsmms/inc/cmessageplugin.h Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/messaging/smsmms/inc/cmessageplugin.h Fri Oct 15 11:45:38 2010 +0530 @@ -54,6 +54,7 @@ void StartHarvestingL(const TDesC& aQualifiedBaseAppClass); void PausePluginL(); void ResumePluginL(); + void SaveL(); /** * callback from MMsvSessionObserver @@ -133,6 +134,7 @@ protected: CMessagePlugin(); void ConstructL(); + void LoadL(); private: // Session to Messge server session @@ -150,7 +152,10 @@ TBool iIndexState; - RArray iMountDrives; + RArray iMountDrives; + + /* Path to the queued records file */ + TFileName iFilePath; #ifdef HARVESTERPLUGINTESTER_FRIEND friend class CHarvesterPluginTester; diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/messaging/smsmms/src/cmessagedatahandler.cpp --- a/harvesterplugins/messaging/smsmms/src/cmessagedatahandler.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/messaging/smsmms/src/cmessagedatahandler.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -19,7 +19,7 @@ // INCLUDES #include - +#include #include #include // SMS Headers #include // MMS Headers @@ -879,8 +879,72 @@ // Remove item that is handled iMessageArray.Remove(0); } + + if( iMessageArray.Count() <= 0 ) + { + if( BaflUtils::FileExists( iFs, iFilePath )) + BaflUtils::DeleteFile( iFs, iFilePath ); + } + OstTraceFunctionExit0( CMESSAGEDATAHANDLER_RESUMEL_EXIT ); } +void CMessageDataHandler::SetFilePath(const TDesC& aFilePath) + { + iFilePath.Copy(aFilePath); + } + +void CMessageDataHandler::SaveRecordsL() + { + if(iMessageArray.Count() <= 0) + return; + + // Open the stream + RFile file; + User::LeaveIfError(file.Replace(iFs, iFilePath, EFileWrite)); + CleanupClosePushL(file); + + RFileWriteStream wr(file); + wr.PushL(); + + // Write harvester count + wr.WriteInt32L(iMessageArray.Count()); + + for (TInt i=0; i ( rd.ReadInt16L()); + TMsvId FolderId = rd.ReadInt32L(); + TMessageItem record( MessageId, ActionType, FolderId ); + iMessageArray.AppendL( record ); + } + HandleNextRequest(); + // Cleanup + CleanupStack::PopAndDestroy(2, &file); + } + // End of File diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/messaging/smsmms/src/cmessageplugin.cpp --- a/harvesterplugins/messaging/smsmms/src/cmessageplugin.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/messaging/smsmms/src/cmessageplugin.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -16,7 +16,8 @@ */ -#include +#include +#include #include #include #include @@ -46,7 +47,7 @@ // maximum length that the fully qualified msg Plugin base app class descriptor can be // e.g. "@c:root msg" const TInt KMsgPluginBaseAppClassMaxLen = 64; - +_LIT(KManagerFileName, "MessageStore.temp"); // local declarations and functions namespace { @@ -158,7 +159,15 @@ for (TInt i=EDriveA; i<=EDriveZ; i++) { iIndexer[i] = NULL; //Initialize to NULL - } + } + // Load the configuration + TFileName pathWithoutDrive; + iFs.CreatePrivatePath(EDriveC); + iFilePath = _L("C:"); + iFs.PrivatePath( pathWithoutDrive ); + iFilePath.Append(pathWithoutDrive); + iFilePath.Append(KManagerFileName); + iMessageDataHandler->SetFilePath( iFilePath ); } // --------------------------------------------------------------------------- @@ -173,6 +182,8 @@ CPIXLOGSTRING2("currentDrive from messaging app : %d", iCurrentDrive ); MountL(TDriveNumber(iCurrentDrive)); //Mount current drive // Define this base application class, use default location + if( BaflUtils::FileExists(iFs,iFilePath) ) + LoadL(); } // --------------------------------------------------------------------------- @@ -555,7 +566,7 @@ void CMessagePlugin::ResumePluginL() { OstTraceFunctionEntry0( CMESSAGEPLUGIN_RESUMEPLUGINL_ENTRY ); - iIndexState = ETrue; + iIndexState = ETrue; //IndexQueuedItems(); iMessageDataHandler->ResumeL(); iMessageMonitor->ResumeL(); @@ -581,6 +592,16 @@ return iIndexState; } +void CMessagePlugin::SaveL() + { + iMessageDataHandler->SaveRecordsL(); + } + +void CMessagePlugin::LoadL() + { + iMessageDataHandler->LoadRecordsL(); + } + // --------------------------------------------------------------------------- // CMessagePlugin::UpdatePerformaceDataL // --------------------------------------------------------------------------- diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/notes/group/notesplugin.mmp --- a/harvesterplugins/notes/group/notesplugin.mmp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/notes/group/notesplugin.mmp Fri Oct 15 11:45:38 2010 +0530 @@ -43,6 +43,8 @@ LIBRARY euser.lib LIBRARY ecom.lib LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY bafl.lib LIBRARY calinterimapi.lib LIBRARY cpixharvesterplugininterface.lib LIBRARY cpixsearchclient.lib diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/notes/inc/notesplugin.h --- a/harvesterplugins/notes/inc/notesplugin.h Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/notes/inc/notesplugin.h Fri Oct 15 11:45:38 2010 +0530 @@ -70,6 +70,7 @@ void StartHarvestingL(const TDesC& aQualifiedBaseAppClass); void PausePluginL(); void ResumePluginL(); + void SaveL(); public: // From MCalChangeCallBack2 @@ -119,9 +120,17 @@ * Symbian 2nd phase constructor. */ void ConstructL(); + + void LoadL(); private: + /* File server connection */ + RFs iFs; + + /* Path to the queued records file */ + TFileName iFilePath; + // The asynchronizer .owned CDelayedCallback* iAsynchronizer; diff -r 367228f82b66 -r 7a8855317cbd harvesterplugins/notes/src/notesplugin.cpp --- a/harvesterplugins/notes/src/notesplugin.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/harvesterplugins/notes/src/notesplugin.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -21,7 +21,9 @@ #include #include #include -#include +#include +#include +#include #include #include #include @@ -51,7 +53,7 @@ _LIT(KNpdMemo , "Memo"); //date Field name in CPIX indexer for notepad record _LIT(KNpdUpdateTime , "Date"); - +_LIT(KManagerFileName, "NotesStore.temp"); //Reference from CPix calender harvester plugin. _LIT(KNotesTimeFormat,"%04d %02d %02d %02d %02d"); @@ -107,6 +109,7 @@ iSession->StopChangeNotification(); } delete iSession; + iFs.Close(); } // --------------------------------------------------------------------------- @@ -125,7 +128,16 @@ iSession->OpenL( iSession->DefaultFileNameL() ); } iNotesInstanceView = CCalInstanceView::NewL( *iSession ); - iEntryView = CCalEntryView::NewL( *iSession ); + iEntryView = CCalEntryView::NewL( *iSession ); + + //Load the temp stored items if any + User::LeaveIfError(iFs.Connect()); + TFileName pathWithoutDrive; + iFs.CreatePrivatePath(EDriveC); + iFilePath = _L("C:"); + iFs.PrivatePath( pathWithoutDrive ); + iFilePath.Append(pathWithoutDrive); + iFilePath.Append(KManagerFileName); } // --------------------------------------------------------------------------- @@ -161,6 +173,9 @@ //Start the Monitoring iSession->StartChangeNotification( *this, *filter ); delete filter; + + if( BaflUtils::FileExists(iFs,iFilePath) ) + LoadL(); CPIXLOGSTRING("CNotesPlugin::StartPluginL: Exit"); OstTraceFunctionExit0( CNOTESPLUGIN_STARTPLUGINL_EXIT ); } @@ -483,7 +498,11 @@ { OstTraceFunctionEntry0( CNOTESPLUGIN_RESUMEPLUGINL_ENTRY ); iIndexState = ETrue; - + + //Check for temp file, it exists delete + if( BaflUtils::FileExists( iFs, iFilePath )) + BaflUtils::DeleteFile( iFs, iFilePath ); + if(iHarvestState == EHarvesterStartHarvest) { if(iAsynchronizer->CallbackPending()) @@ -528,7 +547,7 @@ void CNotesPlugin::IndexQueuedItems() { OstTraceFunctionEntry0( CNOTESPLUGIN_INDEXQUEUEDITEMS_ENTRY ); - while (iJobQueue.Count()>0) + while ( iJobQueue.Count()>0 && iIndexState ) { TRecord entry = iJobQueue[0]; //Let the indexer handle this object TRAP it as it can leave @@ -538,9 +557,65 @@ iJobQueue.Remove(0); } } + if(iJobQueue.Count() <= 0) + { + if( BaflUtils::FileExists( iFs, iFilePath )) + BaflUtils::DeleteFile( iFs, iFilePath ); + } OstTraceFunctionExit0( CNOTESPLUGIN_INDEXQUEUEDITEMS_EXIT ); } +void CNotesPlugin::LoadL() + { + // Open the stream + RFile file; + User::LeaveIfError(file.Open(iFs, iFilePath, EFileRead)); + CleanupClosePushL(file); + RFileReadStream rd(file); + rd.PushL(); + + // Read harvester count + TInt count = rd.ReadInt32L(); + // Read the harvesters + for (TInt i=0; i ( rd.ReadInt16L()); + OverWriteOrAddToQueueL(record.iLocalUid, record.iActionType); + } + + if( count > 0) + IndexQueuedItems(); + // Cleanup + CleanupStack::PopAndDestroy(2, &file); + } + +void CNotesPlugin::SaveL() + { + if( iJobQueue.Count() <= 0) + return; + // Open the stream + RFile file; + User::LeaveIfError(file.Replace(iFs, iFilePath, EFileWrite)); + CleanupClosePushL(file); + + RFileWriteStream wr(file); + wr.PushL(); + + // Write harvester count + wr.WriteInt32L(iJobQueue.Count()); + + for (TInt i=0; i #include #include +#include -#define hbApp qobject_cast(qApp) + // states const char wizardProgressiveStateUri[] = @@ -138,12 +139,14 @@ connect(wizardOnlineState, SIGNAL(onlineSearchQuery(QString)), wizardProgressiveState, SLOT(slotOnlineQuery(QString))); + + AfActivation *activation = new AfActivation(this); // set initial state for statemachine - if (hbApp->activateReason() == Hb::ActivationReasonActivity) + if (activation->reason() == Af::ActivationReasonActivity) { - QVariantHash params = hbApp->activateParams(); + QVariantHash params =activation->parameters(); QString var = params.value(XQURI_KEY_ACTIVITY_NAME).toString(); if (var == SEARCHAIWDECLMAINVIEW) @@ -160,7 +163,7 @@ searchRootState->setInitialState(wizardOnlineState); } } - else if (hbApp->activateReason() == Hb::ActivationReasonNormal) + else if (activation->reason() == Af::ActivationReasonNormal) { searchRootState->setInitialState(wizardProgressiveState); diff -r 367228f82b66 -r 7a8855317cbd searchui/searchapplication/inc/searchapplication.h --- a/searchui/searchapplication/inc/searchapplication.h Tue Oct 05 13:32:14 2010 +0530 +++ b/searchui/searchapplication/inc/searchapplication.h Fri Oct 15 11:45:38 2010 +0530 @@ -46,7 +46,7 @@ * @since S60 ?S60_version. * @param aParent Parent object. */ - SearchApplication(int argc, char *argv[]); + SearchApplication(int &argc, char *argv[] ); /** * Destructor. diff -r 367228f82b66 -r 7a8855317cbd searchui/searchapplication/src/searchapplication.cpp --- a/searchui/searchapplication/src/searchapplication.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/searchui/searchapplication/src/searchapplication.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -25,8 +25,8 @@ // SearchApplication::SearchApplication // --------------------------------------------------------------------------- // -SearchApplication::SearchApplication(int argc, char *argv[]) : - HbApplication(argc, argv), mRuntime(NULL) +SearchApplication::SearchApplication(int &argc, char *argv[] ) : + HbApplication(argc, argv ), mRuntime(NULL) { SEARCH_FUNC_ENTRY("SEARCH::SearchApplication::SearchApplication"); SEARCH_FUNC_EXIT("SEARCH::SearchApplication::SearchApplication"); } diff -r 367228f82b66 -r 7a8855317cbd searchui/stateproviders/searchstateprovider/inc/searchprogressivestate.h --- a/searchui/stateproviders/searchstateprovider/inc/searchprogressivestate.h Tue Oct 05 13:32:14 2010 +0530 +++ b/searchui/stateproviders/searchstateprovider/inc/searchprogressivestate.h Fri Oct 15 11:45:38 2010 +0530 @@ -28,6 +28,7 @@ #include #include "search_global.h" #include +#include #ifdef OST_TRACE_COMPILER_IN_USE //defined in Search_global.h #define PERF_CAT_API_TIME_RESTART m_categorySearchApiTime.restart(); @@ -248,7 +249,7 @@ * Slot to launch the search result screen with the activity URI * @since S60 ?S60_version. */ - void slotactivityRequested(const QString &name); + void slotactivityRequested(Af::ActivationReason reason, const QString &name, QVariantHash parameter ); /** * Slot to notify when theme is changed @@ -479,6 +480,7 @@ QSize mListViewIconSize; SearchUiLoader* mUiLoader; + AfActivation *activation ; bool mStateStatus; diff -r 367228f82b66 -r 7a8855317cbd searchui/stateproviders/searchstateprovider/searchstateprovider.pro --- a/searchui/stateproviders/searchstateprovider/searchstateprovider.pro Tue Oct 05 13:32:14 2010 +0530 +++ b/searchui/stateproviders/searchstateprovider/searchstateprovider.pro Fri Oct 15 11:45:38 2010 +0530 @@ -60,6 +60,7 @@ LIBS += -ltstaskmonitorclient LIBS += -lcpixcontentinfodb LIBS += -lxqserviceutil +LIBS += -lafservice coverage:DEFINES += COVERAGE_MEASUREMENT diff -r 367228f82b66 -r 7a8855317cbd searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp --- a/searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -60,7 +60,7 @@ #include #include QTM_USE_NAMESPACE -#define hbApp qobject_cast(qApp) + const int intial_iteration = 3; const int batch_iteration = 20; @@ -95,6 +95,9 @@ mSearchPanel->setPlaceholderText(hbTrId( "txt_search_dialog_search_device")); } + + activation = new AfActivation(this); + connect( activation, SIGNAL( activated( Af::ActivationReason, QString, QVariantHash ) ), this, SLOT( slotactivityRequested( Af::ActivationReason, QString, QVariantHash ) ) ); constructHandlers(); if (mView && mMainWindow) @@ -108,11 +111,7 @@ mResultparser = 0; loadSettings = true; - if (hbApp) - { - connect(hbApp->activityManager(), SIGNAL(activityRequested(QString)), - this, SLOT(slotactivityRequested(QString))); - } + #ifdef OST_TRACE_COMPILER_IN_USE //start() the timers to avoid worrying abt having to start()/restart() later @@ -1079,11 +1078,10 @@ // --------------------------------------------------------------------------- void SearchProgressiveState::slotviewReady() { - if (hbApp) - { - if (hbApp->activateReason() == Hb::ActivationReasonActivity) + + if (activation->reason() == Af::ActivationReasonActivity) { - QVariantHash params = hbApp->activateParams(); + QVariantHash params = activation->parameters(); QString searchKey = params.value(SEARCHAIWQUERY).toString(); params.remove(SEARCHAIWQUERY); params.remove(XQURI_KEY_ACTIVITY_NAME); @@ -1109,7 +1107,7 @@ if (searchKey.length() > 0) mSearchPanel->setCriteria(searchKey); } - } + PERF_APP_LAUNCH_END("SearchAppplication View is ready"); emit applicationReady(); } @@ -1134,11 +1132,11 @@ // --------------------------------------------------------------------------- // SearchProgressiveState::slotactivityRequested // --------------------------------------------------------------------------- -void SearchProgressiveState::slotactivityRequested(const QString &name) +void SearchProgressiveState::slotactivityRequested(Af::ActivationReason reason, const QString &name, QVariantHash parameter ) { - if (name == SEARCHAIWDECLINDEVICE) + if ((reason == Af::ActivationReasonActivity)&&(name == SEARCHAIWDECLINDEVICE)) { - QVariantHash params = hbApp->activateParams(); + QVariantHash params =parameter; QString searchKey = params.value(SEARCHAIWQUERY).toString(); int i = params.count(); params.remove(SEARCHAIWQUERY); @@ -1248,8 +1246,7 @@ } for (int i = 0; i < mUiLoader->ContentInfoList().count(); i++) { - if (aDoc->baseAppClass() - == mUiLoader->ContentInfoList().at(i)->getBaseApp()) + if (!(aDoc->baseAppClass().compare (mUiLoader->ContentInfoList().at(i)->getBaseApp()))) { if (!firstrow.length()) { @@ -1296,9 +1293,10 @@ int pos = localizationpath.lastIndexOf("/"); QString path = localizationpath.left(pos); - QString filename = localizationpath.right(pos); + QString filename = localizationpath.right((localizationpath.length() - 1) - pos); - translator->load(filename + lang, path); - - QCoreApplication::installTranslator(translator); + if(translator->load(filename + lang, path)) + QCoreApplication::installTranslator(translator); + else + delete translator; } diff -r 367228f82b66 -r 7a8855317cbd searchui/stateproviders/searchstateprovider/src/settingswidget.cpp --- a/searchui/stateproviders/searchstateprovider/src/settingswidget.cpp Tue Oct 05 13:32:14 2010 +0530 +++ b/searchui/stateproviders/searchstateprovider/src/settingswidget.cpp Fri Oct 15 11:45:38 2010 +0530 @@ -153,8 +153,6 @@ HbCheckBox *checkboxitem = NULL; - qDeleteAll(mDeviceCheckBoxList.begin(), mDeviceCheckBoxList.end()); - mDeviceCheckBoxList.clear(); for (int i = 0; i < mDeviceListDisplay.count(); i++) @@ -408,14 +406,15 @@ for (int i = 0; i < mDeviceCheckBoxList.count(); i++) { int value; - (mDeviceCheckBoxList.at(i)->checkState() == Qt::Checked) ? (value = 1) : (value = 0); - + (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 (mUiLoader->ContentInfoList().at(j)->getDisplayName() == mDeviceStoragelist.at(i)) + { value ? (mUiLoader->ContentInfoList().at(j)->setSelected(true)) : (mUiLoader->ContentInfoList().at(j)->setSelected(false)); + } } } } diff -r 367228f82b66 -r 7a8855317cbd searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/t_searchstateprovider.pro --- a/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/t_searchstateprovider.pro Tue Oct 05 13:32:14 2010 +0530 +++ b/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/t_searchstateprovider.pro Fri Oct 15 11:45:38 2010 +0530 @@ -38,6 +38,7 @@ LIBS += -ltstaskmonitorclient LIBS += -lcpixcontentinfodb LIBS += -lxqserviceutil +LIBS += -lafservice CONFIG += qtestlib CONFIG += hb @@ -61,7 +62,6 @@ symbian { CONFIG += symbian_test TARGET.UID2 = 0x100039CE -TARGET.UID3 = 0x20026F9A TARGET.CAPABILITY = CAP_GENERAL_DLL INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE