50 |
50 |
51 void CMmcFileList::ConstructL() |
51 void CMmcFileList::ConstructL() |
52 { |
52 { |
53 iHem = CHarvesterEventManager::GetInstanceL(); |
53 iHem = CHarvesterEventManager::GetInstanceL(); |
54 iMediaIdUtil = &RMediaIdUtil::GetInstanceL(); |
54 iMediaIdUtil = &RMediaIdUtil::GetInstanceL(); |
|
55 CHarvesterCenRepUtil::GetIgnorePathL( iIgnorePaths ); |
55 } |
56 } |
56 |
57 |
57 CMmcFileList::~CMmcFileList() |
58 CMmcFileList::~CMmcFileList() |
58 { |
59 { |
59 if( iHem ) |
60 if( iHem ) |
60 { |
61 { |
61 iHem->ReleaseInstance(); |
62 iHem->ReleaseInstance(); |
62 } |
63 } |
63 RMediaIdUtil::ReleaseInstance(); |
64 RMediaIdUtil::ReleaseInstance(); |
|
65 iIgnorePaths.ResetAndDestroy(); |
|
66 iIgnorePaths.Close(); |
64 } |
67 } |
65 |
68 |
66 TBool CMmcFileList::IsDescInArray(const TPtrC& aSearch, const RPointerArray<HBufC>& aArray) |
69 TBool CMmcFileList::IsDescInArray(const TPtrC& aSearch, const RPointerArray<HBufC>& aArray) |
67 { |
70 { |
68 const TInt count = aArray.Count(); |
71 const TInt count = aArray.Count(); |
94 TUint32 mediaId( 0 ); |
97 TUint32 mediaId( 0 ); |
95 iMediaIdUtil->GetMediaId( aDrivePath, mediaId ); |
98 iMediaIdUtil->GetMediaId( aDrivePath, mediaId ); |
96 |
99 |
97 WRITELOG1( "CMmcFileList::BuildFileListL - mediaId: %d", mediaId ); |
100 WRITELOG1( "CMmcFileList::BuildFileListL - mediaId: %d", mediaId ); |
98 |
101 |
99 RPointerArray<HBufC> ignorePaths; |
|
100 TCleanupItem cleanupItem( MdsUtils::CleanupPtrArray<HBufC>, &ignorePaths ); |
|
101 CleanupStack::PushL( cleanupItem ); |
|
102 |
|
103 CHarvesterCenRepUtil::GetIgnorePathL( ignorePaths ); |
|
104 |
|
105 CDir* directory = NULL; |
102 CDir* directory = NULL; |
106 TFileName name; |
103 TFileName name; |
|
104 TBool rootDir( ETrue ); |
107 |
105 |
108 while ( path->Count() > 0 ) |
106 while ( path->Count() > 0 ) |
109 { |
107 { |
110 TInt error = aFs.GetDir( (*path)[0], KEntryAttDir, KHarvesterGetDirFlags, directory ); |
108 TInt error( KErrNone ); |
|
109 if( rootDir ) |
|
110 { |
|
111 error = aFs.GetDir( (*path)[0], KEntryAttDir, KHarvesterGetRootDirFlags, directory ); |
|
112 rootDir = EFalse; |
|
113 } |
|
114 else |
|
115 { |
|
116 error = aFs.GetDir( (*path)[0], KEntryAttDir, KHarvesterGetDirFlags, directory ); |
|
117 } |
111 if ( error == KErrNone ) |
118 if ( error == KErrNone ) |
112 { |
119 { |
113 for ( TInt i=0; i < directory->Count(); ++i ) |
120 for ( TInt i=0; i < directory->Count(); ++i ) |
114 { |
121 { |
115 TEntry entry = (*directory)[i]; |
122 TEntry entry = (*directory)[i]; |