filemanager/App/src/CFileManagerFoldersView.cpp
branchRCL_3
changeset 10 1772663c5b4e
parent 0 6a9f87576119
child 20 efe289f793e7
equal deleted inserted replaced
9:8812206c49a0 10:1772663c5b4e
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
    21 #include <StringLoader.h>
    21 #include <akntitle.h>
    22 #include <akntitle.h> 
    22 #include <aknnavi.h>
    23 #include <aknnavi.h> 
    23 #include <aknnavide.h>
    24 #include <aknnavide.h> 
       
    25 #include <barsread.h>
    24 #include <barsread.h>
    26 #include <aknlists.h>
    25 #include <aknlists.h>
    27 #include <AknsConstants.h>
    26 #include <AknsConstants.h>
    28 #include <AknInfoPopupNoteController.h>
    27 #include <AknInfoPopupNoteController.h>
    29 #include <csxhelp/fmgr.hlp.hrh>
    28 #include <csxhelp/fmgr.hlp.hrh>
   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 // ------------------------------------------------------------------------------