129 CMessagePlugin::~CMessagePlugin() |
129 CMessagePlugin::~CMessagePlugin() |
130 { |
130 { |
131 // remove notification paths before destroying iMonitor |
131 // remove notification paths before destroying iMonitor |
132 for (TInt i=EDriveA; i<=EDriveZ; i++) |
132 for (TInt i=EDriveA; i<=EDriveZ; i++) |
133 UnMount(TDriveNumber(i), EFalse); |
133 UnMount(TDriveNumber(i), EFalse); |
|
134 iMountDrives.Close(); |
134 delete iMessageDataHandler; |
135 delete iMessageDataHandler; |
135 delete iMessageHarvester; |
136 delete iMessageHarvester; |
136 delete iMessageMonitor; |
137 delete iMessageMonitor; |
137 delete iMsvSession; |
138 delete iMsvSession; |
138 iFs.Close(); |
139 iFs.Close(); |
142 // CMessagePlugin::ConstructL |
143 // CMessagePlugin::ConstructL |
143 // --------------------------------------------------------------------------- |
144 // --------------------------------------------------------------------------- |
144 // |
145 // |
145 void CMessagePlugin::ConstructL() |
146 void CMessagePlugin::ConstructL() |
146 { |
147 { |
|
148 iIndexState = ETrue; |
147 TInt err = iFs.Connect(); |
149 TInt err = iFs.Connect(); |
148 OstTrace1( TRACE_NORMAL, CMESSAGEPLUGIN_CONSTRUCTL, "CMessagePlugin::ConstructL;iFs Connect Error=%d", err ); |
150 OstTrace1( TRACE_NORMAL, CMESSAGEPLUGIN_CONSTRUCTL, "CMessagePlugin::ConstructL;iFs Connect Error=%d", err ); |
149 CPIXLOGSTRING2("CMessagePlugin::ConstructL, iFs.Connect: %i", err); |
151 CPIXLOGSTRING2("CMessagePlugin::ConstructL, iFs.Connect: %i", err); |
150 User::LeaveIfError(err); |
152 User::LeaveIfError(err); |
151 iCurrentDrive = EDriveC; //Default drive is C drive |
153 iCurrentDrive = EDriveC; //Default drive is C drive |
193 // Reset the database |
195 // Reset the database |
194 iIndexer[drive]->ResetL(); |
196 iIndexer[drive]->ResetL(); |
195 #ifdef __PERFORMANCE_DATA |
197 #ifdef __PERFORMANCE_DATA |
196 iStartTime.UniversalTime(); |
198 iStartTime.UniversalTime(); |
197 #endif |
199 #endif |
198 iMessageHarvester->StartHarvestingL(); |
200 if( iIndexState ) |
|
201 { |
|
202 iMessageHarvester->StartHarvestingL(); |
|
203 } |
|
204 else |
|
205 { |
|
206 iMountDrives.Append(TDriveNumber(drive)); |
|
207 } |
199 OstTraceFunctionExit0( CMESSAGEPLUGIN_STARTHARVESTINGL_EXIT ); |
208 OstTraceFunctionExit0( CMESSAGEPLUGIN_STARTHARVESTINGL_EXIT ); |
200 } |
209 } |
201 |
210 |
202 // --------------------------------------------------------------------------- |
211 // --------------------------------------------------------------------------- |
203 // CMessagePlugin::MountL |
212 // CMessagePlugin::MountL |
534 TRAP_IGNORE( UpdatePerformaceDataL() ); |
543 TRAP_IGNORE( UpdatePerformaceDataL() ); |
535 #endif |
544 #endif |
536 iObserver->HarvestingCompleted(this, baseAppClass, aError); |
545 iObserver->HarvestingCompleted(this, baseAppClass, aError); |
537 } |
546 } |
538 |
547 |
|
548 void CMessagePlugin::PausePluginL() |
|
549 { |
|
550 OstTraceFunctionEntry0( CMESSAGEPLUGIN_PAUSEPLUGINL_ENTRY ); |
|
551 iIndexState = EFalse; |
|
552 OstTraceFunctionExit0( CMESSAGEPLUGIN_PAUSEPLUGINL_EXIT ); |
|
553 } |
|
554 |
|
555 void CMessagePlugin::ResumePluginL() |
|
556 { |
|
557 OstTraceFunctionEntry0( CMESSAGEPLUGIN_RESUMEPLUGINL_ENTRY ); |
|
558 iIndexState = ETrue; |
|
559 //IndexQueuedItems(); |
|
560 iMessageDataHandler->ResumeL(); |
|
561 iMessageMonitor->ResumeL(); |
|
562 iMessageHarvester->ResumeRequest(); |
|
563 MountAvailableDrivesInQueue(); |
|
564 OstTraceFunctionExit0( CMESSAGEPLUGIN_RESUMEPLUGINL_EXIT ); |
|
565 } |
|
566 |
|
567 void CMessagePlugin::MountAvailableDrivesInQueue() |
|
568 { |
|
569 OstTraceFunctionEntry0( CMESSAGEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_ENTRY ); |
|
570 for(TInt i=0;i<iMountDrives.Count();i++) |
|
571 { |
|
572 TDriveNumber drive = iMountDrives[i]; |
|
573 iMountDrives.Remove(i); |
|
574 iMessageHarvester->StartHarvestingL(); |
|
575 } |
|
576 OstTraceFunctionExit0( CMESSAGEPLUGIN_MOUNTAVAILABLEDRIVESINQUEUE_EXIT ); |
|
577 } |
|
578 |
|
579 TBool CMessagePlugin::GetHarvesterState() |
|
580 { |
|
581 return iIndexState; |
|
582 } |
|
583 |
539 // --------------------------------------------------------------------------- |
584 // --------------------------------------------------------------------------- |
540 // CMessagePlugin::UpdatePerformaceDataL |
585 // CMessagePlugin::UpdatePerformaceDataL |
541 // --------------------------------------------------------------------------- |
586 // --------------------------------------------------------------------------- |
542 // |
587 // |
543 #ifdef __PERFORMANCE_DATA |
588 #ifdef __PERFORMANCE_DATA |