gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp
branchRCL_3
changeset 11 23553eb4e470
parent 8 f62c3a3d66b8
child 14 9941bcf99348
--- a/gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp	Fri Mar 12 15:43:47 2010 +0200
+++ b/gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp	Mon Mar 15 12:41:46 2010 +0200
@@ -99,6 +99,7 @@
     iPluginLoader->SetObserver( this );
     iPluginLoader->LoadAsyncL( KGSPluginInterfaceUid, KGSMainViewUid,
         iPluginArray );
+    iPosition.Reset();
     }
 
 
@@ -132,10 +133,6 @@
         iAppUi->RemoveFromViewStack( *this, iContainer );
         delete iContainer;
         }
-    if (iPosition.Count() > 0)
-		{
-		iPosition.Close();
-		}
     }
 
 
@@ -207,15 +204,15 @@
     
     // Do this to update listbox from already existing iPluginArray.
     iContainer->UpdateListBoxL();
-    if (iPosition.Count() > 0)
+    if ( iPosition.iCurrentItemIndex != -1 )
 		{
-		if (iScreenMode == Layout_Meta_Data::IsLandscapeOrientation())
+		if ( iIsLandscapeOrientation == Layout_Meta_Data::IsLandscapeOrientation() )
 			{
-			iContainer->SetPosition(iPosition, EFalse);
+			iContainer->RestoreListBoxPositionL( iPosition, EFalse );
 			}
 		else
 			{
-			iContainer->SetPosition(iPosition, ETrue);
+			iContainer->RestoreListBoxPositionL( iPosition, ETrue );
 			}
 		}
     iAppUi->AddToViewStackL( *this, iContainer );
@@ -243,12 +240,10 @@
     
     if ( iContainer )
         {
-		if (iPosition.Count() > 0)
-			{
-			iPosition.Reset();
-			}
-		TRAPD(err, iContainer->GetPositionL(iPosition));
-		iScreenMode = Layout_Meta_Data::IsLandscapeOrientation();
+		
+		iPosition.Reset();
+		TRAPD( err, iContainer->StoreListBoxPositionL( iPosition ) );
+		iIsLandscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation();
 		iAppUi->RemoveFromViewStack(*this, iContainer);
         delete iContainer;
         iContainer = NULL;