255 { |
254 { |
256 if ( !appUi->IsSearchViewOpen() ) |
255 if ( !appUi->IsSearchViewOpen() ) |
257 { |
256 { |
258 appUi->ExitEmbeddedAppIfNeededL(); |
257 appUi->ExitEmbeddedAppIfNeededL(); |
259 } |
258 } |
260 TInt usb_err(KErrNone); |
259 TRAP_IGNORE( RefreshDriveInfoL() ); |
261 TRAP( usb_err,RefreshDriveInfoL() ); |
260 TFileManagerDriveInfo& drvInfo( DriveInfo() ); |
262 if (usb_err != KErrNone) |
261 if ( !( drvInfo.iState & TFileManagerDriveInfo::EDrivePresent ) ) |
263 { |
262 { |
264 usbWrongRemoved = ETrue; |
263 User::Leave(KErrPathNotFound); |
265 HBufC* error = StringLoader::LoadLC(R_QTN_SELEC_EMPTY_LIST); |
264 } |
266 |
265 else |
267 if (iContainer) |
266 { |
268 { |
267 TInt index( iEngine.CurrentIndex() ); |
269 iContainer->ListBoxSetTextL(*error); |
268 if ( index != KErrNotFound ) |
270 } |
269 { |
271 CleanupStack::PopAndDestroy(error); |
270 iContainer->RefreshListL( index ); |
272 } |
271 } |
273 else |
272 else |
274 { |
273 { |
275 TFileManagerDriveInfo& drvInfo( DriveInfo() ); |
274 iContainer->RefreshListL( iIndex ); |
276 if ( !( drvInfo.iState & TFileManagerDriveInfo::EDrivePresent ) ) |
275 } |
277 { |
276 RefreshTitleL(); |
278 //User::Leave(KErrPathNotFound); |
277 } |
279 HBufC* error = StringLoader::LoadLC(R_QTN_SELEC_EMPTY_LIST); |
278 iFolderDepth = iEngine.FolderLevel(); |
280 |
279 } |
281 if (iContainer) |
|
282 { |
|
283 iContainer->ListBoxSetTextL(*error); |
|
284 } |
|
285 CleanupStack::PopAndDestroy(error); |
|
286 } |
|
287 else |
|
288 { |
|
289 usbWrongRemoved = EFalse; |
|
290 TInt index( iEngine.CurrentIndex() ); |
|
291 if ( index != KErrNotFound ) |
|
292 { |
|
293 iContainer->RefreshListL( index ); |
|
294 } |
|
295 else |
|
296 { |
|
297 iContainer->RefreshListL( iIndex ); |
|
298 } |
|
299 |
|
300 } |
|
301 } |
|
302 RefreshTitleL(); |
|
303 iFolderDepth = iEngine.FolderLevel(); |
|
304 } |
|
305 } |
280 } |
306 |
281 |
307 // ----------------------------------------------------------------------------- |
282 // ----------------------------------------------------------------------------- |
308 // CFileManagerFoldersView::HandleResourceChangeL |
283 // CFileManagerFoldersView::HandleResourceChangeL |
309 // (other items were commented in a header). |
284 // (other items were commented in a header). |
333 // ------------------------------------------------------------------------------ |
308 // ------------------------------------------------------------------------------ |
334 // |
309 // |
335 void CFileManagerFoldersView::BackstepL( |
310 void CFileManagerFoldersView::BackstepL( |
336 TInt aBacksteps ) |
311 TInt aBacksteps ) |
337 { |
312 { |
338 |
313 if (iActiveProcess != ENoProcess) |
339 |
314 { |
340 |
315 return; // Ignore to avoid container mess up |
341 if ( usbWrongRemoved ) |
316 } |
342 { |
317 iPopupController->HideInfoPopupNote(); |
343 CFileManagerAppUi* appUi = static_cast<CFileManagerAppUi*> (AppUi()); |
318 CFileManagerAppUi* appUi = static_cast<CFileManagerAppUi*> (AppUi()); |
344 usbWrongRemoved = EFalse; |
319 TInt level(iEngine.FolderLevel()); |
345 iFolderDepth = 0; |
|
346 iIndex = 0; |
|
347 appUi->CloseFoldersViewL(); |
|
348 } |
|
349 else |
|
350 { |
|
351 if (iActiveProcess != ENoProcess) |
|
352 { |
|
353 return; // Ignore to avoid container mess up |
|
354 } |
|
355 |
|
356 iPopupController->HideInfoPopupNote(); |
|
357 CFileManagerAppUi* appUi = static_cast<CFileManagerAppUi*> (AppUi()); |
|
358 TInt level(iEngine.FolderLevel()); |
|
359 |
|
360 while ( aBacksteps > 0 ) |
320 while ( aBacksteps > 0 ) |
361 { |
321 { |
362 if ( level < iInitialFolderDepth ) |
322 if ( level < iInitialFolderDepth ) |
363 { |
323 { |
364 break; |
324 break; |
371 if ( !appUi->IsSearchViewOpen() ) |
331 if ( !appUi->IsSearchViewOpen() ) |
372 { |
332 { |
373 appUi->ExitEmbeddedAppIfNeededL(); |
333 appUi->ExitEmbeddedAppIfNeededL(); |
374 } |
334 } |
375 |
335 |
376 if (level < iInitialFolderDepth) |
336 if (level < iInitialFolderDepth) |
377 { |
337 { |
378 iFolderDepth = 0; |
338 iFolderDepth = 0; |
379 iIndex = 0; |
339 iIndex = 0; |
380 appUi->CloseFoldersViewL(); |
340 appUi->CloseFoldersViewL(); |
381 } |
341 } |
382 else |
342 else |
383 { |
343 { |
384 iEngine.SetObserver(this); |
344 iEngine.SetObserver(this); |
385 iEngine.RefreshDirectory(); |
345 iEngine.RefreshDirectory(); |
386 } |
346 } |
387 } |
347 } |
388 } |
|
389 |
348 |
390 // ------------------------------------------------------------------------------ |
349 // ------------------------------------------------------------------------------ |
391 // CFileManagerFoldersView::FolderName |
350 // CFileManagerFoldersView::FolderName |
392 // |
351 // |
393 // ------------------------------------------------------------------------------ |
352 // ------------------------------------------------------------------------------ |