idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp
branchRCL_3
changeset 9 d0529222e3f0
parent 1 844b978f8d5e
child 18 bd874ee5e5e2
--- a/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp	Tue Feb 02 00:23:10 2010 +0200
+++ b/idlefw/plugins/mcsplugin/settings/src/mcspluginsettingsmodel.cpp	Fri Feb 19 23:07:29 2010 +0200
@@ -84,7 +84,9 @@
    TInt formatLength = KSettingListboxLineFormat().Length();
 
    HBufC* listBoxLine =
-       HBufC::NewLC(title->Length() + caption.Length() + formatLength);
+       HBufC::NewLC( title->Length() + 
+                     caption.Length() + 
+                     formatLength );
 
    TPtr ptr = listBoxLine->Des();
    ptr.Format(KSettingListboxLineFormat, title, &caption);
@@ -198,11 +200,11 @@
     TSettingItem setting = { KErrNotFound, EApplication , EFalse };
 
     TSettingType type = SettingTypeL( aProperties );
-    if( type == EApplication )
+    if ( type == EApplication )
         {
         setting = iAppList->FindItemL( aProperties );
         }
-    else if( type == EBookmark )
+    else if ( type == EBookmark )
         {
         setting = iBkmList->FindItemL( aProperties );
         }
@@ -394,7 +396,7 @@
                 }
             }
         }
- // ETrue tells that modified settings are stored also to plugin reference
+    // ETrue tells that modified settings are stored also to plugin reference
     iPluginSettings->SetSettingsL( *iPluginId, settingItems, ETrue );
     CleanupStack::Pop( &settingItems );
     settingItems.ResetAndDestroy();
@@ -459,10 +461,23 @@
     }
     if ( iSettings[aIndex].type == EApplication )
         {
-        const TDesC& caption = iAppList->MdcaPoint( iSettings[aIndex].id );
-        TPtrC line; 
-        TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) )
-        return line; 
+        // first, we need to check if the item is missing 
+        // (application unistaled or mmc card removed)
+        // If it is, we return "Undefined" application name instead
+        if ( iSettings[ aIndex ].id == KErrNotFound )
+            {
+            const TDesC& caption = iAppList->iUndefinedText->Des();
+            TPtrC line; 
+            TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) )
+            return line; 
+            }
+        else
+            {
+            const TDesC& caption = iAppList->MdcaPoint( iSettings[ aIndex ].id );
+            TPtrC line; 
+            TRAP_IGNORE( line.Set( ListBoxLineL( caption, aIndex ) ) )
+            return line; 
+            }
         }
     else
         {