equal
deleted
inserted
replaced
26 const TInt KMsgPluginBaseAppClassMaxLen = 64; |
26 const TInt KMsgPluginBaseAppClassMaxLen = 64; |
27 |
27 |
28 // local declarations and functions |
28 // local declarations and functions |
29 namespace { |
29 namespace { |
30 _LIT(KCPixSearchServerPrivateDirectory, "\\Private\\2001f6f7\\"); |
30 _LIT(KCPixSearchServerPrivateDirectory, "\\Private\\2001f6f7\\"); |
|
31 _LIT(KIndexingDBPath,"indexing\\indexdb"); |
31 _LIT(KPathIndexDbPath, CPIX_INDEVICE_INDEXDB); |
32 _LIT(KPathIndexDbPath, CPIX_INDEVICE_INDEXDB); |
32 |
33 |
33 _LIT(KAtSign, "@"); |
34 _LIT(KAtSign, "@"); |
34 _LIT(KColon, ":"); |
35 _LIT(KColon, ":"); |
35 }; |
36 }; |
274 CPIXLOGSTRING2("CCPixIndexerUtils::MountL Drive %d already Mounted",aMedia); |
275 CPIXLOGSTRING2("CCPixIndexerUtils::MountL Drive %d already Mounted",aMedia); |
275 return; |
276 return; |
276 } |
277 } |
277 if(IsDriveCanbeMountedL(aMedia)) |
278 if(IsDriveCanbeMountedL(aMedia)) |
278 { |
279 { |
|
280 //clean the existing database if any |
|
281 RemoveUnmountedDatabaseL(aMedia,aPath); |
279 // Form the baseappclass for this media |
282 // Form the baseappclass for this media |
280 TBuf<KMsgPluginBaseAppClassMaxLen> baseAppClass; |
283 TBuf<KMsgPluginBaseAppClassMaxLen> baseAppClass; |
281 FormBaseAppClass(TDriveNumber(aMedia), aBaseAppClassGeneric,baseAppClass); |
284 FormBaseAppClass(TDriveNumber(aMedia), aBaseAppClassGeneric,baseAppClass); |
282 |
285 |
283 // Define this volume |
286 // Define this volume |
465 RArray<TDriveNumber>& CCPixIndexerUtils::CCPixIndexerUtils::GetMountedDriveList() |
468 RArray<TDriveNumber>& CCPixIndexerUtils::CCPixIndexerUtils::GetMountedDriveList() |
466 { |
469 { |
467 return iMountedDrives; |
470 return iMountedDrives; |
468 } |
471 } |
469 |
472 |
|
473 // ----------------------------------------------------------------------------- |
|
474 // CCPixIndexerUtils::RemoveUnmountedDatabase() |
|
475 // ----------------------------------------------------------------------------- |
|
476 // |
|
477 void CCPixIndexerUtils::RemoveUnmountedDatabaseL(TDriveNumber aMedia, const TDesC& aPath) |
|
478 { |
|
479 RFs aFs; |
|
480 User::LeaveIfError( aFs.Connect() ); |
|
481 TChar drive; |
|
482 TInt err = aFs.DriveToChar((TDriveNumber)aMedia,drive); |
|
483 if ( err == KErrNone ) |
|
484 { |
|
485 TBuf<KMaxFileName> folderpath; |
|
486 folderpath.Append(drive); |
|
487 folderpath.Append(KColon); |
|
488 folderpath.Append(KCPixSearchServerPrivateDirectory); |
|
489 folderpath.Append(KIndexingDBPath); |
|
490 folderpath.Append(aPath); |
|
491 CFileMan* FileMan = CFileMan::NewL(aFs); |
|
492 if ( FileMan ) |
|
493 FileMan->Delete( folderpath ); |
|
494 delete FileMan; |
|
495 } |
|
496 aFs.Close(); |
|
497 } |
|
498 |
470 //End of file |
499 //End of file |