# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1283448466 -10800 # Node ID 68cdadcf169e86e82b1ddb4dd60c568e08b98acc # Parent 7d8c8d8f5eab00d13d3a2a229e08086dc2b5c391 Revision: 201033 Kit: 201035 diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/applications/group/applicationsplugin.mmp --- a/harvesterplugins/applications/group/applicationsplugin.mmp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/applications/group/applicationsplugin.mmp Thu Sep 02 20:27:46 2010 +0300 @@ -52,7 +52,4 @@ // For logging LIBRARY flogger.lib -// For enabling Highlighter -//MACRO USE_HIGHLIGHTER - EXPORTUNFROZEN \ No newline at end of file diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/applications/src/applicationsplugin.cpp --- a/harvesterplugins/applications/src/applicationsplugin.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/applications/src/applicationsplugin.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -159,6 +159,9 @@ if( aAppInfo.iShortCaption.Compare(KNullDesC) ) { aDocument->AddFieldL(KApplicationFieldCaption, aAppInfo.iShortCaption, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); +#ifdef USE_HIGHLIGHTER + aDocument->AddHLDisplayFieldL(aAppInfo.iShortCaption); +#endif } else { @@ -169,6 +172,9 @@ 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 } } //For applications, no content to go into exceprt field, for more info, check the appclass-hierarchy.txt diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/calendar/group/calendarplugin.mmp --- a/harvesterplugins/calendar/group/calendarplugin.mmp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/calendar/group/calendarplugin.mmp Thu Sep 02 20:27:46 2010 +0300 @@ -47,9 +47,6 @@ LIBRARY cpixharvesterplugininterface.lib LIBRARY cpixsearchclient.lib -// For Enabling highlighter -//MACRO USE_HIGHLIGHTER - // For logging LIBRARY flogger.lib diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/calendar/inc/ccalendarplugin.h --- a/harvesterplugins/calendar/inc/ccalendarplugin.h Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/calendar/inc/ccalendarplugin.h Thu Sep 02 20:27:46 2010 +0300 @@ -83,7 +83,32 @@ void DelayedCallbackL(TInt aCode); void DelayedError(TInt aError); +#ifdef USE_HIGHLIGHTER +public: // AddExcerpt function + /* + * Add the value to excerpt field + * @param TDesC& aExcerptValue excerpt value + */ + void AddToFieldExcerptL(const TDesC& aExcerptValue); + + +private: + + /* + * reset the excerpt + */ + void ResetExcerpt(); + +#endif + /* + * For date and time get discriptor value in the passed format + * @param TDateTime& datetime: date time to be formatted + * @param const TDesC& aFormat: to this format + * @param TDes& dateString: formated date + */ + + void GetDateTimeDescriptorL(TDateTime& datetime, const TDesC& aFormat, TDes& dateString); private: // New functions void HandleChangedEntryL(const TCalChangeEntry& changedEntry); @@ -124,7 +149,10 @@ // Start harvesting TBool iStartHarvesting; - +#ifdef USE_HIGHLIGHTER + // Excerpt field + HBufC* iExcerpt; +#endif //for unit testing. #ifdef HARVESTERPLUGINTESTER_FRIEND friend class CHarvesterPluginTester; diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/calendar/src/ccalendarplugin.cpp --- a/harvesterplugins/calendar/src/ccalendarplugin.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/calendar/src/ccalendarplugin.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -41,6 +41,8 @@ /** The delay between harvesting chunks. */ const TInt KHarvestingDelay = 2000; _LIT(KCalendarTimeFormat,"%04d %02d %02d %02d %02d"); + +_LIT(KExcerptTimeFormat,"%04d/%02d/%02d %02d:%02d"); // --------------------------------------------------------------------------- // CMessagePlugin::NewL // --------------------------------------------------------------------------- @@ -85,6 +87,11 @@ delete iEntryView; delete iCalIterator; +#ifdef USE_HIGHLIGHTER + if(iExcerpt) + delete iExcerpt; + iExcerpt = NULL; +#endif if( iSession ) { iSession->StopChangeNotification(); @@ -350,6 +357,10 @@ { if (!iIndexer) return; +#ifdef USE_HIGHLIGHTER + //Reset Excerpt + ResetExcerpt(); +#endif OstTrace1( TRACE_NORMAL, CCALENDARPLUGIN_CREATEENTRYL, "CCalendarPlugin::CreateEntryL();Uid=%d", aLocalUid ); @@ -385,25 +396,39 @@ // Add fields index_item->AddFieldL(KCalendarSummaryField, entry->SummaryL()); index_item->AddFieldL(KCalendarDescriptionField, entry->DescriptionL()); - index_item->AddFieldL(KCalendarLocationField, entry->LocationL()); + index_item->AddFieldL(KCalendarLocationField, entry->LocationL()); +#ifdef USE_HIGHLIGHTER + index_item->AddHLDisplayFieldL(entry->SummaryL()); + AddToFieldExcerptL(entry->DescriptionL()); + AddToFieldExcerptL(entry->LocationL()); +#endif TBuf<30> dateString; - TDateTime datetime = entry->StartTimeL().TimeLocalL().DateTime(); - dateString.Format( KCalendarTimeFormat, datetime.Year(), + 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()); + datetime.Minute());*/ index_item->AddFieldL(KCalendarStartTimeField, dateString, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); - - TDateTime endTime = entry->EndTimeL().TimeLocalL().DateTime(); - dateString.Format( KCalendarTimeFormat, endTime.Year(), +#ifdef USE_HIGHLIGHTER + GetDateTimeDescriptorL(datetime, KExcerptTimeFormat, dateString); + AddToFieldExcerptL(dateString); +#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()); + endTime.Minute());*/ index_item->AddFieldL(KCalendarEndTimeField, dateString, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); - +#ifdef USE_HIGHLIGHTER + GetDateTimeDescriptorL(endTime, KExcerptTimeFormat, dateString); + AddToFieldExcerptL(dateString); +#endif if( CCalEntry::ETodo == entry->EntryTypeL()) { @@ -427,31 +452,38 @@ if( completedTime != Time::NullTTime()) { TDateTime compTime = completedTime.DateTime(); - dateString.Format( KCalendarTimeFormat, compTime.Year(), + GetDateTimeDescriptorL(compTime, KCalendarTimeFormat, dateString); + /*dateString.Format( KCalendarTimeFormat, compTime.Year(), TInt(compTime.Month()+ 1), compTime.Day() + 1, compTime.Hour(), - compTime.Minute()); + compTime.Minute());*/ index_item->AddFieldL(KCalenderCompletedField, dateString, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); +#ifdef USE_HIGHLIGHTER + GetDateTimeDescriptorL(compTime, KExcerptTimeFormat, dateString); + AddToFieldExcerptL(dateString); +#endif } } index_item->AddFieldL(KMimeTypeField, KMimeTypeCalendar, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); -#ifdef USE_HIGHLIGHTER - TInt excerptLength = 1 /*single 1-character delimiters*/ + entry->DescriptionL().Length() + entry->LocationL().Length() + 1 + entry->SummaryL().Length(); -#else + +#ifdef USE_HIGHLIGHTER + if(iExcerpt) + index_item->AddExcerptL(*iExcerpt); +#else + TInt excerptLength = 1 /*single 1-character delimiters*/ + entry->DescriptionL().Length() + entry->LocationL().Length(); -#endif + HBufC* excerpt = HBufC::NewLC(excerptLength); TPtr excerptDes = excerpt->Des(); excerptDes.Append(entry->DescriptionL()); excerptDes.Append(KExcerptDelimiter); excerptDes.Append(entry->LocationL()); -#ifdef USE_HIGHLIGHTER - excerptDes.Append(KExcerptDelimiter); - excerptDes.Append(entry->SummaryL()); -#endif + index_item->AddExcerptL(*excerpt); CleanupStack::PopAndDestroy(excerpt); + +#endif CleanupStack::PopAndDestroy(entry); /* @@ -485,6 +517,57 @@ } } +#ifdef USE_HIGHLIGHTER +// --------------------------------------------------------------------------- +// CCalendarPlugin::AddToFieldExcerptL +// --------------------------------------------------------------------------- +// +void CCalendarPlugin::AddToFieldExcerptL(const TDesC& aExcerptValue) +{ +if(!iExcerpt) + { + iExcerpt = HBufC::NewL(5); + } +if(aExcerptValue.Compare(KNullDesC) != 0)//value is not Null + { + TInt currentSize = iExcerpt->Size(); + TInt newSize = currentSize + aExcerptValue.Size() + 1; + if(newSize > currentSize) //New size is bigger so we have to reallocate + { + iExcerpt = iExcerpt->ReAllocL(newSize); + } + TPtr ptr = iExcerpt->Des(); + ptr.Append(aExcerptValue); + ptr.Append(KExcerptDelimiter); + } +} + +// ----------------------------------------------------------------------------- +// CCalendarPlugin::ResetExcerpt() +// ----------------------------------------------------------------------------- +// +void CCalendarPlugin::ResetExcerpt() + { + if(iExcerpt) + { + delete iExcerpt; + iExcerpt = NULL; + } + } +#endif +// ----------------------------------------------------------------------------- +// CCalendarPlugin::GetDateTimeDescriptorL() +// ----------------------------------------------------------------------------- +// +void CCalendarPlugin::GetDateTimeDescriptorL(TDateTime& datetime, const TDesC& aFormat, TDes& dateString) + { + dateString.Format( aFormat, datetime.Year(), + TInt(datetime.Month()+ 1), + datetime.Day() + 1, + datetime.Hour(), + datetime.Minute()); + } + // --------------------------------------------------------------------------- // CCalendarPlugin::UpdatePerformaceDataL diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/contacts/group/contactsplugin.mmp --- a/harvesterplugins/contacts/group/contactsplugin.mmp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/contacts/group/contactsplugin.mmp Thu Sep 02 20:27:46 2010 +0300 @@ -46,9 +46,6 @@ LIBRARY cpixharvesterplugininterface.lib LIBRARY cpixsearchclient.lib -// For Enabling Highlighter -//MACRO USE_HIGHLIGHTER - // For logging LIBRARY flogger.lib diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/contacts/inc/ccontactsplugin.h --- a/harvesterplugins/contacts/inc/ccontactsplugin.h Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/contacts/inc/ccontactsplugin.h Thu Sep 02 20:27:46 2010 +0300 @@ -64,6 +64,7 @@ _LIT(KContactAssistant, "Assistant"); _LIT(KContactAnniversary, "Anniversary"); _LIT(KContactBirthday, "Birthday"); +_LIT(KContactIsGroup, "IsGroup"); _LIT(KDateSeparator, "-"); const TInt KDateFieldLength = 10; const TInt KDayPosition = 8; @@ -118,7 +119,9 @@ * 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 + void AddFieldToHLExcerptL( CContactItemFieldSet& aFieldSet, TUid aFieldId); +#endif /** * Creates the actual contact book index item */ @@ -138,7 +141,9 @@ TInt iCurrentIndex; /** placeholder for Excerpt text dynamic creation */ HBufC* iExcerpt; - +#ifdef USE_HIGHLIGHTER + HBufC* iHLDisplayExcerpt; +#endif // CPix database CCPixIndexer* iIndexer; diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/contacts/src/ccontactsplugin.cpp --- a/harvesterplugins/contacts/src/ccontactsplugin.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/contacts/src/ccontactsplugin.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -87,6 +87,13 @@ //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 + if(iHLDisplayExcerpt) + { + delete iHLDisplayExcerpt; + iHLDisplayExcerpt = NULL; + } +#endif } // ----------------------------------------------------------------------------- @@ -373,6 +380,7 @@ // creating CSearchDocument object with unique ID for this application TBuf<20> docid_str; + TBuf<2> isGroup; docid_str.AppendNum(aContentId); if (aActionType == ECPixAddAction || aActionType == ECPixUpdateAction ) @@ -384,10 +392,17 @@ CleanupStack::PushL( contact ); if( contact->Type() == KUidContactGroup ) { - index_item->AddFieldL(KContactsGivenNameField, static_cast( contact )->GetGroupLabelL(), CDocumentField::EStoreYes | CDocumentField::EIndexTokenized); + // Added IsGroup field to differenciate Group with contacts, its value made true in case of groups + isGroup.AppendNum(ETrue); + index_item->AddFieldL( KContactIsGroup, isGroup, CDocumentField::EStoreYes | CDocumentField::EIndexNo ); + index_item->AddFieldL( KContactsGivenNameField, static_cast( contact )->GetGroupLabelL(), CDocumentField::EStoreYes | CDocumentField::EIndexTokenized ); OstTraceExt1( TRACE_NORMAL, DUP1_CCONTACTSPLUGIN_CREATECONTACTINDEXITEML, ";Adding Contact Group=%S", ( static_cast( contact )->GetGroupLabelL() ) ); CPIXLOGSTRING2("Adding Contact Group %S", &( static_cast( contact )->GetGroupLabelL() ) ); +#ifdef USE_HIGHLIGHTER + index_item->AddHLDisplayFieldL(static_cast( contact )->GetGroupLabelL()); +#else index_item->AddExcerptL( static_cast( contact )->GetGroupLabelL() ); +#endif } else//If the contact item is a regular contact. { @@ -399,19 +414,28 @@ iExcerpt = HBufC::NewL(2); CContactItemFieldSet& fieldSet = contact->CardFields(); - + //IsGroup value made false in case of contact + isGroup.AppendNum(EFalse); + index_item->AddFieldL( KContactIsGroup, isGroup,CDocumentField::EStoreYes | CDocumentField::EIndexNo); //For contacts, all fields __except__ GivenName and FamilyName should be added to excerpt. //See appclass-hierarchy.txt for details. /* The order of fields in excerpt is as below. The order in this case * is the order of fields shown when you 'Edit' the contact. */ -#ifdef USE_HIGHLIGHTER - AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldGivenName, KContactsGivenNameField, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText ); - AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldFamilyName, KContactsFamilyNameField, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField:: EIndexFreeText ); -#else + AddFieldL( *index_item, fieldSet, KUidContactFieldGivenName, KContactsGivenNameField, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText ); AddFieldL( *index_item, fieldSet, KUidContactFieldFamilyName, KContactsFamilyNameField, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField:: EIndexFreeText ); -#endif +#ifdef USE_HIGHLIGHTER + if(iHLDisplayExcerpt) + { + delete iHLDisplayExcerpt; + iHLDisplayExcerpt = NULL; + } + AddFieldToHLExcerptL( fieldSet, KUidContactFieldGivenName); + AddFieldToHLExcerptL( fieldSet, KUidContactFieldFamilyName); + if(iHLDisplayExcerpt) + index_item->AddHLDisplayFieldL(*iHLDisplayExcerpt); +#endif AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldPhoneNumber, KContactsPhoneNumberField ); AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldEMail, KContactsEMailField, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText ); AddFieldToDocumentAndExcerptL( *index_item, fieldSet, KUidContactFieldSIPID, KContactsSIPIDField ); @@ -508,6 +532,39 @@ } } +#ifdef USE_HIGHLIGHTER +void CContactsPlugin::AddFieldToHLExcerptL( CContactItemFieldSet& aFieldSet, TUid aFieldId) + { + if(!iHLDisplayExcerpt) + { + iHLDisplayExcerpt = HBufC::NewL(2); + } + // Find field + TInt findpos = aFieldSet.Find(aFieldId); + + if (! (findpos < 0) || (findpos >= aFieldSet.Count() ) ) + { + CContactItemField& additionalField = aFieldSet[findpos]; + CContactTextField* fieldText = additionalField.TextStorage(); + + + if (fieldText && fieldText->Text() != KNullDesC)//value is not Null + { + TInt currentSize = iHLDisplayExcerpt->Size(); + TInt newSize = currentSize + fieldText->Text().Length() + 1; + if(newSize > currentSize) //New size is bigger so we have to reallocate + { + iHLDisplayExcerpt = iHLDisplayExcerpt->ReAllocL(newSize); + } + TPtr ptr = iHLDisplayExcerpt->Des(); + ptr.Append(fieldText->Text()); + ptr.Append(KExcerptDelimiter); + } + } + } + +#endif + // --------------------------------------------------------------------------- // CContactsPlugin::GetDateL // --------------------------------------------------------------------------- diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/file/inc/cfileharvester.h --- a/harvesterplugins/file/inc/cfileharvester.h Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/file/inc/cfileharvester.h Thu Sep 02 20:27:46 2010 +0300 @@ -138,6 +138,10 @@ TInt iCurrentIndex; TInt iStepNumber; RPointerArray iIgnorePaths; + + #ifdef HARVESTERPLUGINTESTER_FRIEND + friend class CHarvesterPluginTester; + #endif }; #endif // CFILEHARVESTER_H diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/file/inc/cfilemonitor.h --- a/harvesterplugins/file/inc/cfilemonitor.h Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/file/inc/cfilemonitor.h Thu Sep 02 20:27:46 2010 +0300 @@ -126,6 +126,9 @@ TFastFindFSPStatusPckg iPckg; // If a folder name is changed then files in that folder need to be indexed again as path changed. CFolderRenamedHarvester* iFolderRenamedHarvester; + #ifdef HARVESTERPLUGINTESTER_FRIEND + friend class CHarvesterPluginTester; + #endif }; #endif // CFILEMONITOR_H diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/file/inc/cfileplugin.h --- a/harvesterplugins/file/inc/cfileplugin.h Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/file/inc/cfileplugin.h Thu Sep 02 20:27:46 2010 +0300 @@ -79,12 +79,6 @@ * @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: // @@ -156,12 +150,16 @@ CFileHarvester* iHarvester; // Monitor - TBool iIsMonitorInit; + //TBool iIsMonitorInit; unused variable CFileMonitor* iMonitor; // MMC monitor CMMCMonitor* iMmcMonitor; - + + //for unit testing. + #ifdef HARVESTERPLUGINTESTER_FRIEND + friend class CHarvesterPluginTester; + #endif #ifdef __PERFORMANCE_DATA TTime iStartTime[26];// for the all drives TTime iCompleteTime; diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/file/inc/cfolderrenamedharvester.h --- a/harvesterplugins/file/inc/cfolderrenamedharvester.h Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/file/inc/cfolderrenamedharvester.h Thu Sep 02 20:27:46 2010 +0300 @@ -137,6 +137,10 @@ TFileName iOldFolderName; TFileName iNewFolderName; RPointerArray iRenamedFolders; + //for unit testing. + #ifdef HARVESTERPLUGINTESTER_FRIEND + friend class CHarvesterPluginTester; + #endif }; #endif // CFOLDERRENAMEDHARVESTER_H diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/file/inc/cmmcmonitor.h --- a/harvesterplugins/file/inc/cmmcmonitor.h Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/file/inc/cmmcmonitor.h Thu Sep 02 20:27:46 2010 +0300 @@ -109,6 +109,10 @@ TBool iMmcStatus; // MMC Inserted/ejected property RProperty iProperty; + //for unit testing. + #ifdef HARVESTERPLUGINTESTER_FRIEND + friend class CHarvesterPluginTester; + #endif }; #endif // CMMCMONITOR_H diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/file/src/cfileplugin.cpp --- a/harvesterplugins/file/src/cfileplugin.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/file/src/cfileplugin.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -41,9 +41,7 @@ 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"); @@ -221,18 +219,13 @@ void CFilePlugin::StartPluginL() { - TInt error = KErrNone; - - if (!iIsMonitorInit) - { - error = iMonitor->Initialize(); - OstTrace1( TRACE_NORMAL, CFILEPLUGIN_STARTPLUGINL, "CFilePlugin::StartPluginL;Monitor Error=%d", error ); - CPIXLOGSTRING2("CFilePlugin::StartMonitoring, error: %i", error ); - iIsMonitorInit = ETrue; - } + TInt error = KErrNone; + error = iMonitor->Initialize(); + OstTrace1( TRACE_NORMAL, CFILEPLUGIN_STARTPLUGINL, "CFilePlugin::StartPluginL;Monitor Error=%d", error ); + CPIXLOGSTRING2("CFilePlugin::StartMonitoring, error: %i", error ); // Start the monitoring - if (error == KErrNone && iIsMonitorInit) + if (error == KErrNone ) { iMonitor->StartMonitoring(); OstTrace0( TRACE_NORMAL, DUP1_CFILEPLUGIN_STARTPLUGINL, "CFilePlugin::StartMonitoring - iFileMonitor->StartMonitoring " ); @@ -275,11 +268,6 @@ // 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); @@ -662,34 +650,12 @@ index_item->AddFieldL(KIsFolderField, Isfolder, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized); //Only content to be added to exceprt field. See appclass-hierarchy.txt //Add excerpt field - //index_item->AddExcerptL(aFilePath); + index_item->AddExcerptL(aFilePath); CleanupStack::Pop(index_item); 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 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(); - } - #ifdef __PERFORMANCE_DATA void CFilePlugin::UpdatePerformaceDataL(TDriveNumber aDriveNumber) { diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/file/src/cmmcmonitor.cpp --- a/harvesterplugins/file/src/cmmcmonitor.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/file/src/cmmcmonitor.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -133,34 +133,7 @@ { OstTraceFunctionEntry0( CMMCMONITOR_STARTMONITORING_ENTRY ); CPIXLOGSTRING("ENTER CMMCMonitor::StartMonitoring"); - 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); - } - } + TRAP_IGNORE( RunL() );//Need to TRAP this rather than use RunError CPIXLOGSTRING("END CMMCMonitor::StartMonitoring"); OstTraceFunctionExit0( CMMCMONITOR_STARTMONITORING_EXIT ); return ETrue; @@ -269,7 +242,7 @@ OstTrace0( TRACE_NORMAL, DUP2_CMMCMONITOR_RUNL, "CMMCMonitor::RunL insert event" ); CPIXLOGSTRING("CMMCMonitor::RunL insert event"); // Mount MMC and force reharvest - iFilePlugin.MountL(drv, ETrue); + iFilePlugin.MountL(drv, EFalse);//dont force reharvest } else { diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/inc/s60performance.h --- a/harvesterplugins/inc/s60performance.h Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/inc/s60performance.h Thu Sep 02 20:27:46 2010 +0300 @@ -15,3 +15,6 @@ // Uncomment to get harvester plugin performance logs //MACRO __PERFORMANCE_DATA + +// For enabling Highlighter +//MACRO USE_HIGHLIGHTER diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/media/audio/group/audioplugin.mmp --- a/harvesterplugins/media/audio/group/audioplugin.mmp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/media/audio/group/audioplugin.mmp Thu Sep 02 20:27:46 2010 +0300 @@ -57,9 +57,6 @@ // For logging LIBRARY flogger.lib -// For enabling Highlighter -//MACRO USE_HIGHLIGHTER - //Enable this macro to get harvester performance data //MACRO __PERFORMANCE_DATA EXPORTUNFROZEN diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/media/audio/src/cpixmediaaudiodoc.cpp --- a/harvesterplugins/media/audio/src/cpixmediaaudiodoc.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/media/audio/src/cpixmediaaudiodoc.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -113,10 +113,21 @@ AddToFieldExcerptL(textProperty->Value());//Add artist to excerpt } #ifdef USE_HIGHLIGHTER - //Get the media file extension and store + /*//Get the media file extension and store TBuf extension; GetExtension(aObject.Uri(),extension); - AddToFieldExcerptL(extension); + AddToFieldExcerptL(extension);*/ + //Adding title to first line of highlighter + CMdEPropertyDef& titlePropDef = aObjectDef.GetPropertyDefL(MdeConstants::Object::KTitleProperty ); + if(aObject.Property( titlePropDef, property ) != KErrNotFound) + { + //Add field to document + CMdETextProperty* textProperty = static_cast< CMdETextProperty* > (property ); + if(textProperty->Value() != KNullDesC) + { + index_item->AddHLDisplayFieldL(textProperty->Value()); + } + } #endif CMdEPropertyDef& albumPropDef = aObjectDef.GetPropertyDefL(MdeConstants::Audio::KAlbumProperty ); if(aObject.Property( albumPropDef, property )!= KErrNotFound) diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/media/audio/src/mediaplugin.cpp --- a/harvesterplugins/media/audio/src/mediaplugin.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/media/audio/src/mediaplugin.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -88,7 +88,8 @@ delete iObjectJobQueueManager; delete iMdsUtils; delete iAudioDocument; - iIndexerUtil->UnMountAllDrivesL(_L(MEDIAGENERICAPPCLASS)); + if (iIndexerUtil) + TRAP_IGNORE(iIndexerUtil->UnMountAllDrivesL(_L(MEDIAGENERICAPPCLASS))); delete iIndexerUtil; delete iMMcMonitor; delete iDBManager; diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/media/image/group/imageplugin.mmp --- a/harvesterplugins/media/image/group/imageplugin.mmp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/media/image/group/imageplugin.mmp Thu Sep 02 20:27:46 2010 +0300 @@ -57,9 +57,6 @@ // For logging LIBRARY flogger.lib -// For enabling Highlighter -//MACRO USE_HIGHLIGHTER - //Enable this macro to get harvester performance data //MACRO __PERFORMANCE_DATA EXPORTUNFROZEN diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/media/image/src/cpixmediaimagedoc.cpp --- a/harvesterplugins/media/image/src/cpixmediaimagedoc.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/media/image/src/cpixmediaimagedoc.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -108,10 +108,9 @@ } #ifdef USE_HIGHLIGHTER - //Get the media file extension and store - TBuf extension; - GetExtension(aObject.Uri(),extension); - AddToFieldExcerptL(extension); + TInt slashpos = GetUri().LocateReverse('\\'); + TPtrC name = GetUri().Mid( (slashpos+1) ); + index_item->AddHLDisplayFieldL(name); #endif //Get user comment field CMdEPropertyDef& commentPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KCommentProperty ); diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/media/image/src/imageplugin.cpp --- a/harvesterplugins/media/image/src/imageplugin.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/media/image/src/imageplugin.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -86,7 +86,8 @@ delete iObjectJobQueueManager; delete iMdsUtils; delete iImageDocument; - iIndexerUtil->UnMountAllDrivesL(_L(MEDIAGENERICAPPCLASS)); + if ( iIndexerUtil ) + TRAP_IGNORE(iIndexerUtil->UnMountAllDrivesL(_L(MEDIAGENERICAPPCLASS))); delete iIndexerUtil; delete iMMcMonitor; delete iDBManager; diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/media/mediautils/inc/cpixindexerutils.h --- a/harvesterplugins/media/mediautils/inc/cpixindexerutils.h Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/media/mediautils/inc/cpixindexerutils.h Thu Sep 02 20:27:46 2010 +0300 @@ -144,13 +144,6 @@ * @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 iMountedDrives; //Array of mounted drives diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/media/mediautils/src/cpixindexerutils.cpp --- a/harvesterplugins/media/mediautils/src/cpixindexerutils.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/media/mediautils/src/cpixindexerutils.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -28,7 +28,6 @@ // local declarations and functions namespace { _LIT(KCPixSearchServerPrivateDirectory, "\\Private\\2001f6f7\\"); -_LIT(KIndexingDBPath,"indexing\\indexdb"); _LIT(KPathIndexDbPath, CPIX_INDEVICE_INDEXDB); _LIT(KAtSign, "@"); @@ -277,8 +276,6 @@ } if(IsDriveCanbeMountedL(aMedia)) { - //clean the existing database if any - RemoveUnmountedDatabaseL(aMedia,aPath); // Form the baseappclass for this media TBuf baseAppClass; FormBaseAppClass(TDriveNumber(aMedia), aBaseAppClassGeneric,baseAppClass); @@ -470,30 +467,4 @@ 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 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 diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/media/video/group/videoplugin.mmp --- a/harvesterplugins/media/video/group/videoplugin.mmp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/media/video/group/videoplugin.mmp Thu Sep 02 20:27:46 2010 +0300 @@ -57,9 +57,6 @@ // For logging LIBRARY flogger.lib -// For enabling Highlighter -//MACRO USE_HIGHLIGHTER - //Enable this macro to get harvester performance data //MACRO __PERFORMANCE_DATA EXPORTUNFROZEN diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/media/video/src/cpixmediavideodoc.cpp --- a/harvesterplugins/media/video/src/cpixmediavideodoc.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/media/video/src/cpixmediavideodoc.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -104,15 +104,22 @@ if(aObject.Property( titlePropDef, property ) != KErrNotFound) { CMdETextProperty* textProperty = ( CMdETextProperty* ) property; - if( textProperty->Value().Compare(KNullDesC) > 0 )AddToFieldExcerptL(name); //Add name to excerpt field + if( textProperty->Value().Compare(KNullDesC) > 0 ) + { +#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 + { +#ifdef USE_HIGHLIGHTER + index_item->AddHLDisplayFieldL(name); +#endif + } } -#ifdef USE_HIGHLIGHTER - //Get the media file extension and store - TBuf extension; - GetExtension(aObject.Uri(),extension); - AddToFieldExcerptL(extension); -#endif - //URI and Excerpt is done add additional properties here CMdEPropertyDef& artistPropDef = aObjectDef.GetPropertyDefL(MdeConstants::MediaObject::KArtistProperty ); diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/media/video/src/videoplugin.cpp --- a/harvesterplugins/media/video/src/videoplugin.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/media/video/src/videoplugin.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -73,7 +73,8 @@ delete iObjectJobQueueManager; delete iMdsUtils; delete iVideoDocument; - iIndexerUtil->UnMountAllDrivesL(_L(MEDIAGENERICAPPCLASS)); + if ( iIndexerUtil ) + TRAP_IGNORE(iIndexerUtil->UnMountAllDrivesL(_L(MEDIAGENERICAPPCLASS))); delete iIndexerUtil; delete iMMcMonitor; delete iDBManager; diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/messaging/email/qtemailfetcher/qtemailfetcher.cpp --- a/harvesterplugins/messaging/email/qtemailfetcher/qtemailfetcher.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/messaging/email/qtemailfetcher/qtemailfetcher.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -234,6 +234,9 @@ excerpt += msgBody ; doc->AddExcerptL( qt_QString2TPtrC(excerpt) ); ); + #ifdef USE_HIGHLIGHTER + doc->AddHLDisplayFieldL(qt_QString2TPtrC( const_cast(aEnvelope).sender() )); + #endif qDebug() << "QEmailFetcher::getSearchDocumentL :END"; return doc; } @@ -297,6 +300,7 @@ //More mailboxes available. delete iMailFolderList; iMailFolderList = NULL; iMailFolderList = new NmApiFolderListing( this, iMailBoxes.at( iCurrentMailboxIndex++ ).id() ); + qDebug() << "\n QEmailFetcher::processing "<< iMailBoxes.at( iCurrentMailboxIndex-1 ).name()<< "Mailbox"; connect( iMailFolderList, SIGNAL(foldersListed( qint32 )), this, SLOT(handleMailFoldersListed( qint32)) ); iMailFolderList->start(); @@ -340,7 +344,7 @@ this, iFolders.at( iCurrentFolderIndex++ ).id(), iMailBoxes.at( iCurrentMailboxIndex-1 ).id() ); //we have already incremented iMailboxIndex. - + qDebug() << "\n QEmailFetcher::collecting mails from the "<< iFolders.at( iCurrentFolderIndex++ ).name() << "Folder \n"; connect(iEnvelopeListing, SIGNAL(envelopesListed(qint32)),this,SLOT(processMessages(qint32))); iEnvelopeListing->start(); qDebug() << "QEmailFetcher::processNextFolder :processNextFolder"; @@ -370,11 +374,14 @@ void QEmailFetcher::handleMessageEvent( EmailClientApi::NmApiMessageEvent aEvent, quint64 aMailboxId, quint64 aFolderId, QList aMessageList){ NmApiMessageEnvelope envelope; qDebug() << "QEmailFetcher::handleMessageEvent :START"; + qDebug() << "\n QEmailFetcher::aEvent="<< aEvent<<" MailboxId =" << aMailboxId << " FolderId = "<< aFolderId; const int messageCount = aMessageList.count(); + qDebug() << "\n QEmailFetcher::message count="<< messageCount; if( messageCount>0 ){ if( aEvent == MessageCreated || aEvent == MessageChanged ){ qDebug() << "QEmailFetcher::handleMessageEvent :MessageCreated || MessageChanged"; for( int i=0; igetEnvelope( aMailboxId, aFolderId, aMessageList.at( i ), envelope ) ){ qDebug() << "QEmailFetcher::handleMessageEvent :HandleDocumentL"; QT_TRAP_THROWING( @@ -387,6 +394,7 @@ else if( aEvent == MessageDeleted ) { qDebug() << "QEmailFetcher::handleMessageEvent :MessageDeleted"; for( int i=0; iAddFieldL(KFromField, *fromNameOrNumberBuf, CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); +#ifdef USE_HIGHLIGHTER + if( aFolderId == KMsvGlobalInBoxIndexEntryIdValue) + { + index_item->AddHLDisplayFieldL(*fromNameOrNumberBuf); + } +#endif // Add the recipients as content items TBuf<64> to_field; + +#ifdef USE_HIGHLIGHTER + HBufC* toList = HBufC::NewL(5); +#endif const CDesCArray & recipientArray = static_cast (iSmsMtm->AddresseeList().RecipientList()); @@ -312,8 +325,32 @@ to_field.AppendNum(i); index_item->AddFieldL(to_field, recipientArray.MdcaPoint(i), CDocumentField::EStoreYes | CDocumentField::EIndexTokenized | CDocumentField::EIndexFreeText); + +#ifdef USE_HIGHLIGHTER + // Folder field + // Iterate through the list of recipients and add them under To field + if( aFolderId != KMsvGlobalInBoxIndexEntryIdValue) + { + TInt currentSize = toList->Size(); + TInt newSize = currentSize + recipientArray.MdcaPoint(i).Size() + 1; + if(newSize > currentSize) //New size is bigger so we have to reallocate + { + toList = toList->ReAllocL(newSize); + } + TPtr ptr = toList->Des(); + ptr.Append(recipientArray.MdcaPoint(i)); + ptr.Append(KExcerptDelimiter); + } +#endif } - +#ifdef USE_HIGHLIGHTER + if( aFolderId != KMsvGlobalInBoxIndexEntryIdValue) + { + index_item->AddHLDisplayFieldL( *toList); + } + delete toList; + toList = NULL; +#endif // Add the body text as a content item TInt msgLength = iSmsMtm->Body().DocumentLength(); HBufC* bodyText = HBufC::NewLC(msgLength); @@ -352,9 +389,18 @@ // Add from field index_item->AddFieldL(KFromField, iMmsMtm->Sender()); +#ifdef USE_HIGHLIGHTER + if( aFolderId == KMsvGlobalInBoxIndexEntryIdValue) + { + index_item->AddHLDisplayFieldL(iMmsMtm->Sender()); + } +#endif // Add the recipients as content items TBuf<64> to_field; +#ifdef USE_HIGHLIGHTER + HBufC* toList = HBufC::NewL(5); +#endif const CDesCArray & recipientArray = static_cast (iMmsMtm->AddresseeList().RecipientList()); @@ -364,8 +410,33 @@ if (i>0) to_field.AppendNum(i); index_item->AddFieldL(to_field, recipientArray.MdcaPoint(i)); + +#ifdef USE_HIGHLIGHTER + // Folder field + // Iterate through the list of recipients and add them under To field + if( aFolderId != KMsvGlobalInBoxIndexEntryIdValue) + { + TInt currentSize = toList->Size(); + TInt newSize = currentSize + recipientArray.MdcaPoint(i).Size() + 1; + if(newSize > currentSize) //New size is bigger so we have to reallocate + { + toList = toList->ReAllocL(newSize); + } + TPtr ptr = toList->Des(); + ptr.Append(recipientArray.MdcaPoint(i)); + ptr.Append(KExcerptDelimiter); + } +#endif } +#ifdef USE_HIGHLIGHTER + if( aFolderId != KMsvGlobalInBoxIndexEntryIdValue) + { + index_item->AddHLDisplayFieldL( *toList); + } + delete toList; + toList = NULL; +#endif // Add subject TPtrC subject(iMmsMtm->SubjectL()); index_item->AddFieldL(KSubjectField, subject); @@ -515,8 +586,12 @@ } else if( aFolderId != KMsvGlobalInBoxIndexEntryIdValue && aRecipientArray.MdcaCount() > 0 ) { - excerptLength += aRecipientArray.MdcaPoint(0).Length(); - excerptLength += KSpace().Length(); + //Multiple recepent added to excerpt + for(TInt i = 0; i< aRecipientArray.MdcaCount(); i++) + { + excerptLength += aRecipientArray.MdcaPoint(i).Length(); + excerptLength += KSpace().Length(); + } } HBufC* excerpt = HBufC::NewL(excerptLength); @@ -534,8 +609,11 @@ } else if ((aRecipientArray.MdcaCount() > 0) && (aFolderId != KMsvGlobalInBoxIndexEntryIdValue)) { - excerptPtr.Append(aRecipientArray.MdcaPoint(0)); - excerptPtr.Append(KSpace); + for(TInt i = 0; i< aRecipientArray.MdcaCount(); i++) + { + excerptPtr.Append(aRecipientArray.MdcaPoint(i)); + excerptPtr.Append(KSpace); + } } //Not deleting this code as it might have to be brought back into use diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/notes/group/notesplugin.mmp --- a/harvesterplugins/notes/group/notesplugin.mmp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/notes/group/notesplugin.mmp Thu Sep 02 20:27:46 2010 +0300 @@ -48,9 +48,6 @@ LIBRARY cpixsearchclient.lib LIBRARY centralrepository.lib -// For Enabling Highlighter -//MACRO USE_HIGHLIGHTER - // For logging LIBRARY flogger.lib diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/notes/src/notesplugin.cpp --- a/harvesterplugins/notes/src/notesplugin.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/notes/src/notesplugin.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -360,15 +360,17 @@ //For notes, no content is expected in excerpt for now. //See appclass-hierarchy.txt for details. -#ifdef USE_HIGHLIGHTER - TInt excerptLength = entry->DescriptionL().Length() + 1 + dateString.Length(); - HBufC* excerpt = HBufC::NewLC(excerptLength); - TPtr excerptDes = excerpt->Des(); - excerptDes.Append(entry->DescriptionL()); - excerptDes.Append(KExcerptDelimiter); - excerptDes.Append(dateString); - index_item->AddExcerptL(*excerpt); - CleanupStack::PopAndDestroy(excerpt); +#ifdef USE_HIGHLIGHTER + _LIT(KExcerptTimeFormat,"%04d/%02d/%02d %02d:%02d"); + index_item->AddHLDisplayFieldL(entry->DescriptionL()); + + dateString.Format( KExcerptTimeFormat, datetime.Year(), + TInt(datetime.Month()+ 1), + datetime.Day() + 1, + datetime.Hour(), + datetime.Minute()); + index_item->AddExcerptL(dateString); + #endif // Send for indexing diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/tsrc/harvesterplugintester/conf/harvesterplugintester.cfg --- a/harvesterplugins/tsrc/harvesterplugintester/conf/harvesterplugintester.cfg Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/tsrc/harvesterplugintester/conf/harvesterplugintester.cfg Thu Sep 02 20:27:46 2010 +0300 @@ -63,6 +63,49 @@ [Endtest] [Test] +title TestFileRunError +create HarvesterPluginTester foobar +foobar TestFileRunError +delete foobar +[Endtest] + +[Test] +title TestFileDoCancel +create HarvesterPluginTester foobar +foobar TestFileDoCancel +delete foobar +[Endtest] + +[Test] +title TestHandleFileEngine +create HarvesterPluginTester foobar +foobar TestHandleFileEngine +delete foobar +[Endtest] + +[Test] +title TestFileMonitorRunL +create HarvesterPluginTester foobar +foobar TestFileMonitorRunL +delete foobar +[Endtest] + +[Test] +title TestFileMmcMonitorRunL +create HarvesterPluginTester foobar +foobar TestFileMmcMonitorRunL +delete foobar +[Endtest] + +[Test] +title TestFileBaseAppNegative +create HarvesterPluginTester foobar +foobar TestFileBaseAppNegative +delete foobar +[Endtest] + + +[Test] title TestMessaging create HarvesterPluginTester foobar foobar TestMessaging diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/tsrc/harvesterplugintester/inc/harvesterplugintester.h --- a/harvesterplugins/tsrc/harvesterplugintester/inc/harvesterplugintester.h Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/tsrc/harvesterplugintester/inc/harvesterplugintester.h Thu Sep 02 20:27:46 2010 +0300 @@ -162,6 +162,17 @@ virtual TInt TestFolderRenameL( CStifItemParser& aItem ); + virtual TInt TestFileRunErrorL( CStifItemParser& aItem ); + + virtual TInt TestFileDoCancelL( CStifItemParser& aItem ); + + virtual TInt TestHandleFileEngineL( CStifItemParser& aItem ); + + virtual TInt TestFileMonitorRunL ( CStifItemParser& aItem ); + + virtual TInt TestFileMmcMonitorRunL ( CStifItemParser& aItem ); + + virtual TInt TestFileBaseAppNegativeL (CStifItemParser& aItem ); /** * Message harvester test method. * @since ?Series60_version diff -r 7d8c8d8f5eab -r 68cdadcf169e harvesterplugins/tsrc/harvesterplugintester/src/harvesterplugintesterblocks.cpp --- a/harvesterplugins/tsrc/harvesterplugintester/src/harvesterplugintesterblocks.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/harvesterplugins/tsrc/harvesterplugintester/src/harvesterplugintesterblocks.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -47,6 +47,9 @@ #include "cpixmdedbmanager.h" #include "cpixindexerutils.h" #include "cfolderrenamedharvester.h" +#include "cfilemonitor.h" +#include "cfileharvester.h" +#include "cmmcmonitor.h" #include "videoplugin.h" #include "imageplugin.h" #include "cemailplugin.h" @@ -102,6 +105,12 @@ ENTRY( "TestCreateIndexItemL_Delete", CHarvesterPluginTester::TestCreateIndexItemL ), ENTRY( "TestFolderCreate", CHarvesterPluginTester::TestFolderCreateL ), ENTRY( "TestFolderRename", CHarvesterPluginTester::TestFolderRenameL ), + ENTRY( "TestFileRunError", CHarvesterPluginTester::TestFileRunErrorL ), + ENTRY( "TestFileDoCancel", CHarvesterPluginTester::TestFileDoCancelL ), + ENTRY( "TestHandleFileEngine", CHarvesterPluginTester::TestHandleFileEngineL ), + ENTRY( "TestFileMonitorRunL", CHarvesterPluginTester::TestFileMonitorRunL ), + ENTRY( "TestFileMmcMonitorRunL", CHarvesterPluginTester::TestFileMmcMonitorRunL ), + ENTRY( "TestFileBaseAppNegative", CHarvesterPluginTester::TestFileBaseAppNegativeL ), ENTRY( "TestMessaging", CHarvesterPluginTester::TestMessageHarvesterL ), ENTRY( "TestMessageHarvesting", CHarvesterPluginTester::TestMessageHarvesterWithMessageL ), ENTRY( "TestMessageDriveChange", CHarvesterPluginTester::TestMessageHarvesterChangeDriveL ), @@ -410,6 +419,7 @@ TInt error = KErrNone; CFilePlugin* filePlugin = CFilePlugin::NewL(); CHarvesterObserver* iPluginTester = CHarvesterObserver::NewL( filePlugin ); + iPluginTester->SetWaitTime(2000000); filePlugin->StartPluginL(); filePlugin->StartHarvestingL( KAppBasePath ); @@ -421,8 +431,18 @@ { error = fs.MkDir(KDirectoryToCreate); } - iPluginTester->iWaitForHarvester->Start();//Wait here till Harvesting is complete. + //iPluginTester->iWaitForHarvester->Start();//Wait here till Harvesting is complete. + TFastFindFSPStatus& status = filePlugin->iMonitor->iPckg(); + status.iFileEventType = EFastFindDirCreated; + status.iFileName.Copy(KDirectoryToCreate); + //Folder created event + filePlugin->iMonitor->RunL(); + //Folder delete event + status = filePlugin->iMonitor->iPckg(); + status.iFileName.Copy(KDirectoryToCreate); + status.iFileEventType = EFastFindDirDeleted; + filePlugin->iMonitor->RunL(); if(error == KErrNone) { error = doSearchL( _L("TestFolder"), KAppBaseFolderFilePath, ESearchTypeResultsExpected ); @@ -443,9 +463,9 @@ RFs fs; User::LeaveIfError( fs.Connect() ); - CFilePlugin* filePlugin = CFilePlugin::NewL(); - CFolderRenamedHarvester* iFolderRenameHarvester = CFolderRenamedHarvester::NewL( *filePlugin, fs); + CFilePlugin* filePlugin = CFilePlugin::NewL(); CHarvesterObserver* iPluginTester = CHarvesterObserver::NewL( filePlugin ); + filePlugin->StartPluginL(); filePlugin->StartHarvestingL( KAppBasePath ); @@ -463,26 +483,22 @@ { User::LeaveIfError(fs.RmDir(KDirectoryRenamed)); } - iPluginTester->iWaitForHarvester->Start();//Wait here till Harvesting is complete. + filePlugin->CreateFolderFileIndexItemL( KDirectoryToCreate, ECPixAddAction ); - error = doSearchL( _L("TestRenameFolder"), KAppBaseFolderFilePath, ESearchTypeResultsExpected ); - - if(error == KErrNone) - { - fs.Rename(KDirectoryToCreate, KDirectoryRenamed); - iFolderRenameHarvester->StartL( oldFolderName, newFolderName ); - } - - User::After( (TTimeIntervalMicroSeconds32)35000000 ); - + fs.Rename(KDirectoryToCreate, KDirectoryRenamed); + filePlugin->iMonitor->iFolderRenamedHarvester->StartL( oldFolderName, newFolderName ); + //for code coverage + filePlugin->iMonitor->iFolderRenamedHarvester->RunL(); + // To cover default case + filePlugin->iMonitor->iFolderRenamedHarvester->iHarvestState = (CFolderRenamedHarvester::TFileHarvesterState)5; + filePlugin->iMonitor->iFolderRenamedHarvester->RunL(); //Search for the renamed directory error = doSearchL( _L("TestFolderRenamed"), KAppBaseFolderFilePath, ESearchTypeNoResultsExpected ); fs.RmDir(KDirectoryRenamed); - + filePlugin->CreateFolderFileIndexItemL( KDirectoryRenamed, ECPixRemoveAction ); delete filePlugin; - delete iFolderRenameHarvester; - iFolderRenameHarvester = NULL; + delete iPluginTester; iPluginTester = NULL; fs.Close(); @@ -490,6 +506,137 @@ return error; } + +TInt CHarvesterPluginTester::TestFileRunErrorL( CStifItemParser& /*aItem */) + { + CFilePlugin* filePlugin = CFilePlugin::NewL(); + CHarvesterObserver* iPluginTester = CHarvesterObserver::NewL( filePlugin ); + iPluginTester->SetWaitTime(2000000); + filePlugin->StartPluginL(); + filePlugin->StartHarvestingL( KAppBasePath ); + filePlugin->iMonitor->iFolderRenamedHarvester->RunError(KErrNone); + filePlugin->iMonitor->RunError( KErrNone ); + filePlugin->iMmcMonitor->RunError( KErrNone ); + filePlugin->iHarvester->RunError( KErrNone ); + + delete filePlugin; + delete iPluginTester; + iPluginTester = NULL; + return KErrNone; + } + +TInt CHarvesterPluginTester::TestFileDoCancelL( CStifItemParser& /*aItem */) + { + CFilePlugin* filePlugin = CFilePlugin::NewL(); + CHarvesterObserver* iPluginTester = CHarvesterObserver::NewL( filePlugin ); + filePlugin->StartPluginL(); + filePlugin->iHarvester->DoCancel(); + delete filePlugin; + delete iPluginTester; + iPluginTester = NULL; + return KErrNone; + } + +TInt CHarvesterPluginTester::TestHandleFileEngineL( CStifItemParser& /*aItem */) + { + CFilePlugin* filePlugin = CFilePlugin::NewL(); + CHarvesterObserver* iPluginTester = CHarvesterObserver::NewL( filePlugin ); + filePlugin->StartPluginL(); + filePlugin->iMonitor->Disable(); + filePlugin->iMonitor->Enable(); + //filePlugin->iMonitor->Release(); + delete filePlugin; + delete iPluginTester; + iPluginTester = NULL; + return KErrNone; + } + +TInt CHarvesterPluginTester::TestFileMonitorRunL( CStifItemParser& /*aItem */) + { + _LIT( KOldFileName, "C:\\data\\testfiles.txt" ); + _LIT( KNewFileName, "C:\\data\\testfile.txt" ); + CFilePlugin* filePlugin = CFilePlugin::NewL(); + CHarvesterObserver* iPluginTester = CHarvesterObserver::NewL( filePlugin ); + filePlugin->StartPluginL(); + + TFastFindFSPStatus& status = filePlugin->iMonitor->iPckg(); + status.iFileEventType = EFastFindFileCreated; + status.iFileName.Copy(KOldFileName); + status.iNewFileName.Copy(KNewFileName); + //File created event + filePlugin->iMonitor->RunL(); + status = filePlugin->iMonitor->iPckg(); + status.iFileName.Copy(KOldFileName); + status.iNewFileName.Copy(KNewFileName); + status.iFileEventType = EFastFindFileModified; + //File Modified event + filePlugin->iMonitor->RunL(); + + status = filePlugin->iMonitor->iPckg(); + status.iFileName.Copy(KOldFileName); + status.iNewFileName.Copy(KNewFileName); + status.iFileEventType = EFastFindFileRenamed; + //Rename file event + filePlugin->iMonitor->RunL(); + + status = filePlugin->iMonitor->iPckg(); + status.iFileName.Copy(KOldFileName); + status.iNewFileName.Copy(KNewFileName); + status.iFileEventType = EFastFindFileReplaced; + //Replace file event + filePlugin->iMonitor->RunL(); + + status = filePlugin->iMonitor->iPckg(); + status.iFileName.Copy(KOldFileName); + status.iNewFileName.Copy(KNewFileName); + status.iFileEventType = EFastFindFileDeleted; + //Delete file event + filePlugin->iMonitor->RunL(); + + status = filePlugin->iMonitor->iPckg(); + status.iFileName.Copy(KOldFileName); + status.iNewFileName.Copy(KNewFileName); + status.iFileEventType = EFastFindFileUnknown; + //For default test + filePlugin->iMonitor->RunL(); + + delete filePlugin; + delete iPluginTester; + iPluginTester = NULL; + return KErrNone; + } + +TInt CHarvesterPluginTester::TestFileMmcMonitorRunL( CStifItemParser& /*aItem */) + { + CFilePlugin* filePlugin = CFilePlugin::NewL(); + CHarvesterObserver* iPluginTester = CHarvesterObserver::NewL( filePlugin ); + iPluginTester->SetWaitTime(2000000); + filePlugin->StartPluginL(); + filePlugin->StartHarvestingL( KAppBasePath ); + // cancel the subcribed request first + filePlugin->iMmcMonitor->Cancel(); + filePlugin->iMmcMonitor->iProperty.Cancel(); + + filePlugin->iMmcMonitor->RunL(); + + delete filePlugin; + delete iPluginTester; + iPluginTester = NULL; + return KErrNone; + } + +TInt CHarvesterPluginTester::TestFileBaseAppNegativeL( CStifItemParser& /*aItem */) + { + _LIT(KIncorrectBaseApp,"c:root file content"); + CFilePlugin* filePlugin = CFilePlugin::NewL(); + CHarvesterObserver* iPluginTester = CHarvesterObserver::NewL( filePlugin ); + filePlugin->StartPluginL(); + TRAPD(err,filePlugin->StartHarvestingL( KIncorrectBaseApp )); + delete filePlugin; + delete iPluginTester; + iPluginTester = NULL; + return KErrNone; + } /** * Message harvester test method. * @since ?Series60_version diff -r 7d8c8d8f5eab -r 68cdadcf169e searchui/indevicehandler/tsrc/t_indevicehandler/src/t_indevicehandler.cpp --- a/searchui/indevicehandler/tsrc/t_indevicehandler/src/t_indevicehandler.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/searchui/indevicehandler/tsrc/t_indevicehandler/src/t_indevicehandler.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -136,14 +136,23 @@ //Will be corrected in later (estimate 4.6.0) Qt release for Symbian. int main(int argc, char *argv[]) { - QApplication app(argc, argv); - int error = 0; - TRAPD(err, - QTEST_DISABLE_KEYPAD_NAVIGATION - SearchInDeviceHandlerTest tc; - error = QTest::qExec(&tc, argc, argv);); - Q_UNUSED(err); - return error; + QCoreApplication app(argc, argv); +#ifdef __WINSCW__ + char *new_argv[3]; + QString str = "C:\\data\\" + QFileInfo( + QCoreApplication::applicationFilePath()).baseName() + ".log"; + QByteArray bytes = str.toAscii(); + char arg1[] = "-o"; + new_argv[0] = argv[0]; + new_argv[1] = arg1; + new_argv[2] = bytes.data(); + SearchInDeviceHandlerTest tc; + return QTest::qExec(&tc, 3, new_argv); +#else + SearchInDeviceHandlerTest tc; + return QTest::qExec(&tc, argc, argv); +#endif + } #else //Q_OS_SYMBIAN QTEST_MAIN(SearchInDeviceHandlerTest) diff -r 7d8c8d8f5eab -r 68cdadcf169e searchui/onlinehandler/tsrc/t_onlinehandler/src/t_onlinehandler.cpp --- a/searchui/onlinehandler/tsrc/t_onlinehandler/src/t_onlinehandler.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/searchui/onlinehandler/tsrc/t_onlinehandler/src/t_onlinehandler.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -160,14 +160,23 @@ //Will be corrected in later (estimate 4.6.0) Qt release for Symbian. int main(int argc, char *argv[]) { - QApplication app(argc, argv); - int error = 0; - TRAPD(err, - QTEST_DISABLE_KEYPAD_NAVIGATION - SearchOnlineHandlerTest tc; - error = QTest::qExec(&tc, argc, argv);); - Q_UNUSED(err); - return error; + QCoreApplication app(argc, argv); +#ifdef __WINSCW__ + char *new_argv[3]; + QString str = "C:\\data\\" + QFileInfo( + QCoreApplication::applicationFilePath()).baseName() + ".log"; + QByteArray bytes = str.toAscii(); + char arg1[] = "-o"; + new_argv[0] = argv[0]; + new_argv[1] = arg1; + new_argv[2] = bytes.data(); + SearchOnlineHandlerTest tc; + return QTest::qExec(&tc, 3, new_argv); +#else + SearchOnlineHandlerTest tc; + return QTest::qExec(&tc, argc, argv); +#endif + } #else //Q_OS_SYMBIAN QTEST_MAIN(SearchOnlineHandlerTest) diff -r 7d8c8d8f5eab -r 68cdadcf169e searchui/stateproviders/searchstateprovider/inc/searchprogressivestate.h --- a/searchui/stateproviders/searchstateprovider/inc/searchprogressivestate.h Wed Aug 18 09:49:49 2010 +0300 +++ b/searchui/stateproviders/searchstateprovider/inc/searchprogressivestate.h Thu Sep 02 20:27:46 2010 +0300 @@ -320,7 +320,7 @@ * Function to launch the result item for application category * @param aUid Unique app Id. */ - void LaunchApplicationL(const TUid aUid); + void LaunchApplicationL(const QString aUid); /** * Function to parse the CpixDocument with the given filter diff -r 7d8c8d8f5eab -r 68cdadcf169e searchui/stateproviders/searchstateprovider/searchstateprovider.pro --- a/searchui/stateproviders/searchstateprovider/searchstateprovider.pro Wed Aug 18 09:49:49 2010 +0300 +++ b/searchui/stateproviders/searchstateprovider/searchstateprovider.pro Thu Sep 02 20:27:46 2010 +0300 @@ -18,6 +18,9 @@ DEFINES += BUILD_SEARCHSTATEPROVIDER +CONFIG += hb console mobility + +MOBILITY = serviceframework symbian { CONFIG(debug, debug|release) { DESTDIR = debug diff -r 7d8c8d8f5eab -r 68cdadcf169e searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp --- a/searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -53,6 +53,10 @@ #include #include #include +#include +#include +#include +QTM_USE_NAMESPACE #define hbApp qobject_cast(qApp) const int totalcategories_normalreason = 10; const int totalcategories_activityreasonreason = 13; @@ -395,8 +399,8 @@ if (item->data(Qt::UserRole + 1).toString().contains("contact")) { PERF_RESULT_ITEM_FOR_LAUNCHING("contact") - mRequest = mAiwMgr->create("com.nokia.services.phonebookservices", - "Fetch", "open(int)", true); + mRequest = mAiwMgr->create("com.nokia.symbian.IContactsView", + "openContactCard(int)", true); int uid = (item->data(Qt::UserRole)).toInt(&t); args << uid; @@ -410,10 +414,9 @@ } else if (item->data(Qt::UserRole + 1).toString().contains("calendar")) { - QDir pluginDir = QDir(QString("z:/resource/qt/plugins/calendar")); + QDir pluginDir = QDir(CALENDAR_EVENTVIEWER_PLUGIN_PATH); QPluginLoader *calAgandaViewerPluginLoader = new QPluginLoader( - pluginDir.absoluteFilePath(QString( - "agendaeventviewerplugin.qtplugin"))); + pluginDir.absoluteFilePath(CALENDAR_EVENTVIEWER_PLUGIN_NAME)); calAgandaViewerPluginInstance = qobject_cast< EventViewerPluginInterface *> ( @@ -429,7 +432,7 @@ else if (item->data(Qt::UserRole + 1).toString().contains("applications")) { PERF_RESULT_ITEM_FOR_LAUNCHING("applications") - TRAP_IGNORE(LaunchApplicationL(TUid::Uid((item->data(Qt::UserRole)).toString().toUInt(&t, 16)))); + TRAP_IGNORE(LaunchApplicationL((item->data(Qt::UserRole)).toString())); PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG("") } else if (item->data(Qt::UserRole + 1).toString().contains("file")) @@ -1093,47 +1096,24 @@ // --------------------------------------------------------------------------- // SearchProgressiveState::LaunchApplicationL // --------------------------------------------------------------------------- -void SearchProgressiveState::LaunchApplicationL(const TUid aUid) +void SearchProgressiveState::LaunchApplicationL(const QString aUid) { - RWsSession wsSession; - User::LeaveIfError(wsSession.Connect()); - CleanupClosePushL (wsSession); - CAknTaskList *taskList = CAknTaskList::NewL(wsSession); - TApaTask task = taskList->FindRootApp(aUid); - delete taskList; - if (task.Exists()) - { - task.BringToForeground(); - } - else + QServiceManager serviceManager; + QObject* mActivityManager = serviceManager.loadInterface( + "com.nokia.qt.activities.ActivityManager"); + if (!mActivityManager) { - TApaAppInfo appInfo; - TApaAppCapabilityBuf capabilityBuf; - RApaLsSession appArcSession; - User::LeaveIfError(appArcSession.Connect()); - CleanupClosePushL (appArcSession); - User::LeaveIfError(appArcSession.GetAppInfo(appInfo, aUid)); - User::LeaveIfError( - appArcSession.GetAppCapability(capabilityBuf, aUid)); - TApaAppCapability &caps = capabilityBuf(); - TFileName appName = appInfo.iFullName; - CApaCommandLine *cmdLine = CApaCommandLine::NewLC(); - cmdLine->SetExecutableNameL(appName); - if (caps.iLaunchInBackground) - { - cmdLine->SetCommandL(EApaCommandBackground); - } - else - { - cmdLine->SetCommandL(EApaCommandRun); - } - //cmdLine->SetTailEndL(aParam); - User::LeaveIfError(appArcSession.StartApp(*cmdLine)); - CleanupStack::PopAndDestroy(cmdLine); - CleanupStack::PopAndDestroy(&appArcSession); + return; } - CleanupStack::PopAndDestroy(&wsSession); - PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG ("") + QUrl url; + url.setScheme(XQURI_SCHEME_ACTIVITY); + QString str("0x"); + str.append(aUid); + url.setHost(str); + QMetaObject::invokeMethod(mActivityManager, "launchActivity", + Q_ARG(QUrl, url)); + delete mActivityManager; + PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG("") } // --------------------------------------------------------------------------- // SearchProgressiveState::_viewingCompleted @@ -1201,8 +1181,7 @@ << "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_folder" - << "qtg_large_query"; + << "qtg_large_java" << "qtg_large_flash" << "qtg_large_query"; mIconArray.clear(); for (int i = 0; i < icons.count(); i++) { @@ -1278,6 +1257,7 @@ QString secondrow = aDoc->excerpt(); QString firstrow; HbListWidgetItem* listitem = new HbListWidgetItem(); + bool addtoList = true; if (aDoc->baseAppClass().contains("contact")) { @@ -1305,7 +1285,7 @@ { firstrow.append(audioList.at(0)); } - if (firstrow.length() == 0) + else { firstrow = hbTrId("txt_mus_dblist_val_unknown4"); } @@ -1322,7 +1302,7 @@ { firstrow.append(videoList.at(0)); } - if (firstrow.length() == 0 && videoList.value(2, "").length()) + else { firstrow.append(videoList.at(2)); } @@ -1335,10 +1315,9 @@ else if (aDoc->baseAppClass().contains("image")) { QStringList imageList = filterDoc(aDoc, "Name", "MediaId"); - if (imageList.value(0, "").length()) - { - firstrow.append(imageList.at(0)); - } + + firstrow.append(imageList.at(0)); + listitem->setData(mIconArray.at(3), Qt::DecorationRole); if (imageList.value(1, "").length()) { @@ -1364,7 +1343,13 @@ 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); } @@ -1409,10 +1394,9 @@ QStringList fileList = filterDoc(aDoc, "Name", "IsFolder", "Extension"); firstrow = fileList.at(0); - if (fileList.at(1).toInt(&ok) == 1) // folder result icon map - + if (fileList.at(1).toInt(&ok) == 1) // not to show folder results { - listitem->setData(mIconArray.at(13), Qt::DecorationRole); + addtoList = false; } else { @@ -1433,7 +1417,7 @@ } else { - listitem->setData(mIconArray.at(14), Qt::DecorationRole); + listitem->setData(mIconArray.at(13), Qt::DecorationRole); } } } @@ -1449,18 +1433,23 @@ } else { - listitem->setData(mIconArray.at(14), Qt::DecorationRole); + listitem->setData(mIconArray.at(13), Qt::DecorationRole); } } listitem->setText(firstrow); listitem->setSecondaryText(secondrow); listitem->setData(aDoc->docId(), Qt::UserRole); listitem->setData(aDoc->baseAppClass(), Qt::UserRole + 1); - mListView->addItem(listitem); + if (addtoList) + mListView->addItem(listitem); + else + delete listitem; delete aDoc; } - +// --------------------------------------------------------------------------- +// SearchProgressiveState::constructHandlers overloaded +// --------------------------------------------------------------------------- InDeviceHandler* SearchProgressiveState::constructHandlers(int mDatabase) { InDeviceHandler* handler = NULL; diff -r 7d8c8d8f5eab -r 68cdadcf169e searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/src/t_searchstateprovider.cpp --- a/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/src/t_searchstateprovider.cpp Wed Aug 18 09:49:49 2010 +0300 +++ b/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/src/t_searchstateprovider.cpp Thu Sep 02 20:27:46 2010 +0300 @@ -177,14 +177,22 @@ //Will be corrected in later (estimate 4.6.0) Qt release for Symbian. int main(int argc, char *argv[]) { - QApplication app(argc, argv); - int error = 0; - TRAPD(err, - QTEST_DISABLE_KEYPAD_NAVIGATION - SearchStateProviderTest tc; - error = QTest::qExec(&tc, argc, argv);); - Q_UNUSED(err); - return error; + QCoreApplication app(argc, argv); +#ifdef __WINSCW__ + char *new_argv[3]; + QString str = "C:\\data\\" + QFileInfo( + QCoreApplication::applicationFilePath()).baseName() + ".log"; + QByteArray bytes = str.toAscii(); + char arg1[] = "-o"; + new_argv[0] = argv[0]; + new_argv[1] = arg1; + new_argv[2] = bytes.data(); + SearchStateProviderTest tc; + return QTest::qExec(&tc, 3, new_argv); +#else + SearchStateProviderTest tc; + return QTest::qExec(&tc, argc, argv); +#endif } #else //Q_OS_SYMBIAN QTEST_MAIN(SearchStateProviderTest) diff -r 7d8c8d8f5eab -r 68cdadcf169e searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/t_searchstateprovider.pro --- a/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/t_searchstateprovider.pro Wed Aug 18 09:49:49 2010 +0300 +++ b/searchui/stateproviders/searchstateprovider/tsrc/t_searchstateprovider/t_searchstateprovider.pro Thu Sep 02 20:27:46 2010 +0300 @@ -17,7 +17,9 @@ TEMPLATE = app DEFINES += BUILD_SEARCHSTATEPROVIDER +CONFIG += hb console mobility +MOBILITY = serviceframework symbian { CONFIG(debug, debug|release) { DESTDIR = ./debug