idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp
branchRCL_3
changeset 19 502e5d91ad42
parent 18 bd874ee5e5e2
child 51 15e4dd19031c
--- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp	Fri Mar 12 15:43:54 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp	Mon Mar 15 12:41:53 2010 +0200
@@ -557,33 +557,34 @@
     {
     if (aSettingIndex >= 0 && aSettingIndex < iSettings.Count())
         {
-        // Old setting type is bookmark. Remove bookmark item from MCS 
-        // if it was created in runtime.
-        if( iSettings[aSettingIndex].type == EBookmark )
-            {
-                iBkmList->RemoveMenuItemL( iSettings[aSettingIndex].id );
-            }
-
-        // Old setting type is application.
-        // Remove app item from MCS if it was created in runtime (mailbox).
-        if ( iSettings[ aSettingIndex ].type == EApplication )
-            {
-                iAppList->RemoveMenuItemL( iSettings[ aSettingIndex ].id );
-            }
-
-        iSettings[aSettingIndex].id = aId;
-        iSettings[aSettingIndex].type = aType;
+        TSettingItem oldItem = iSettings[ aSettingIndex ];
+        iSettings[ aSettingIndex ].id = aId;
+        iSettings[ aSettingIndex ].type = aType;
 
         if ( aType == EApplication )
             {
             CMenuItem& item = iAppList->ItemL( aId );
             SaveSettingsL( aSettingIndex, item );
             }
-        else
+         else
             {
             CMenuItem& item = iBkmList->ItemL( aId );
             SaveSettingsL( aSettingIndex, item );
             }
+        
+        // Old setting type is bookmark. Remove bookmark item from MCS 
+        // if it was created in runtime.
+        if ( oldItem.type == EBookmark )
+            {
+                iBkmList->RemoveMenuItemL( oldItem.id );
+            }
+
+        // Old setting type is application.
+        // Remove app item from MCS if it was created in runtime (mailbox).
+        if ( oldItem.type == EApplication )
+            {
+                iAppList->RemoveMenuItemL( oldItem.id );
+            }
 
         return ETrue;
         }