196 if( error != KErrNone ) |
196 if( error != KErrNone ) |
197 { |
197 { |
198 continue; |
198 continue; |
199 } |
199 } |
200 HBufC* pathBuf = path.AllocL(); |
200 HBufC* pathBuf = path.AllocL(); |
201 CleanupStack::PushL( pathBuf ); |
201 aPaths.Append( pathBuf ); |
202 aPaths.AppendL( pathBuf ); |
|
203 CleanupStack::Pop( pathBuf ); |
|
204 } |
202 } |
205 |
203 |
206 CleanupStack::PopAndDestroy( &scanPathKeys ); |
204 CleanupStack::PopAndDestroy( &scanPathKeys ); |
207 CleanupStack::PopAndDestroy( repo ); |
205 CleanupStack::PopAndDestroy( repo ); |
208 } |
206 } |
214 CleanupClosePushL( scanPathKeys ); |
212 CleanupClosePushL( scanPathKeys ); |
215 |
213 |
216 repo->FindL( aPartialKey, KSearchMask, scanPathKeys ); |
214 repo->FindL( aPartialKey, KSearchMask, scanPathKeys ); |
217 |
215 |
218 TBuf<KMaxFileName> path; |
216 TBuf<KMaxFileName> path; |
219 |
|
220 for( TInt i = scanPathKeys.Count() - 1; i >=0; i-- ) |
217 for( TInt i = scanPathKeys.Count() - 1; i >=0; i-- ) |
221 { |
218 { |
222 const TInt error( repo->Get( scanPathKeys[i], path ) ); |
219 const TInt error( repo->Get( scanPathKeys[i], path ) ); |
223 |
|
224 if( error != KErrNone ) |
220 if( error != KErrNone ) |
225 { |
221 { |
226 continue; |
222 continue; |
227 } |
223 } |
228 TUint32 preinstalled = MdeConstants::MediaObject::ENotPreinstalled; |
224 TUint32 preinstalled = MdeConstants::MediaObject::ENotPreinstalled; |
229 |
|
230 if( path[ path.Length() - 1 ] != TChar('\\') ) |
225 if( path[ path.Length() - 1 ] != TChar('\\') ) |
231 { |
226 { |
232 User::LeaveIfError( repo->GetMeta( scanPathKeys[i], preinstalled ) ); |
227 User::LeaveIfError( repo->GetMeta( scanPathKeys[i], preinstalled ) ); |
233 } |
228 } |
234 TScanItem* item = new (ELeave) TScanItem(); |
229 TScanItem* item = new (ELeave) TScanItem(); |
235 CleanupStack::PushL( item ); |
230 CleanupStack::PushL( item ); |
236 item->iPath = path.AllocL(); |
231 item->iPath = path.AllocL(); |
237 item->iPreinstalled = preinstalled; |
232 item->iPreinstalled = preinstalled; |
238 CleanupStack::Pop( item ); |
233 CleanupStack::Pop( item ); |
239 aItems.AppendL( item ); // ownership is transferred |
234 aItems.Append( item ); // ownership is transferred |
240 } |
235 } |
241 |
236 |
242 CleanupStack::PopAndDestroy( &scanPathKeys ); |
237 CleanupStack::PopAndDestroy( &scanPathKeys ); |
243 CleanupStack::PopAndDestroy( repo ); |
238 CleanupStack::PopAndDestroy( repo ); |
244 } |
239 } |