harvesterplugins/notes/src/notesplugin.cpp
changeset 11 773be20e0a25
parent 7 51d10d255e92
child 13 0a2ec6860a93
child 17 7d8c8d8f5eab
equal deleted inserted replaced
7:51d10d255e92 11:773be20e0a25
    51 _LIT(KNpdMemo , "Memo");
    51 _LIT(KNpdMemo , "Memo");
    52 //date Field name in CPIX indexer for notepad record
    52 //date Field name in CPIX indexer for notepad record
    53 _LIT(KNpdUpdateTime , "Date");
    53 _LIT(KNpdUpdateTime , "Date");
    54 
    54 
    55 //Reference from CPix calender harvester plugin.
    55 //Reference from CPix calender harvester plugin.
    56 _LIT(KNotesTimeFormat , "%F%/0%Y %M %D %H%T"); // Locale independent YYYYMMDDHHMM
    56 _LIT(KNotesTimeFormat,"%04d %02d %02d %02d %02d");
    57 
    57 
    58 // ---------------------------------------------------------------------------
    58 // ---------------------------------------------------------------------------
    59 // CNotesPlugin::NewL
    59 // CNotesPlugin::NewL
    60 // ---------------------------------------------------------------------------
    60 // ---------------------------------------------------------------------------
    61 //  
    61 //  
   344 		CSearchDocument* index_item = CSearchDocument::NewLC(docid_str, _L(NOTESAPPCLASS));
   344 		CSearchDocument* index_item = CSearchDocument::NewLC(docid_str, _L(NOTESAPPCLASS));
   345 		// Add Description fields		
   345 		// Add Description fields		
   346 		index_item->AddFieldL(KNpdMemo, entry->DescriptionL());
   346 		index_item->AddFieldL(KNpdMemo, entry->DescriptionL());
   347 		// Add Date fields
   347 		// Add Date fields
   348 		TBuf<30> dateString;
   348 		TBuf<30> dateString;
   349 		TTime endTime = entry->EndTimeL().TimeUtcL();
   349 		TDateTime datetime = entry->EndTimeL().TimeUtcL().DateTime();		
   350 		endTime.FormatL(dateString, KNotesTimeFormat);
   350 		dateString.Format( KNotesTimeFormat, datetime.Year(),
       
   351                                      TInt(datetime.Month()+ 1),
       
   352                                      datetime.Day() + 1,
       
   353                                      datetime.Hour()+ 1,
       
   354                                      datetime.Minute());
       
   355 		 
   351 		index_item->AddFieldL(KNpdUpdateTime, dateString, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized);
   356 		index_item->AddFieldL(KNpdUpdateTime, dateString, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized);
   352 
   357 
   353 		index_item->AddFieldL(KMimeTypeField, KMimeTypeNotes, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized);
   358 		index_item->AddFieldL(KMimeTypeField, KMimeTypeNotes, CDocumentField::EStoreYes | CDocumentField::EIndexUnTokenized);
   354 
   359 
   355 		//For notes, no content is expected in excerpt for now.
   360 		//For notes, no content is expected in excerpt for now.