emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp
changeset 1 12c456ceeff2
parent 0 8466d47a6819
child 2 5253a20d2a1e
equal deleted inserted replaced
0:8466d47a6819 1:12c456ceeff2
   427 
   427 
   428 // ---------------------------------------------------------------------------
   428 // ---------------------------------------------------------------------------
   429 // CMailCpsSettings::GetContentId
   429 // CMailCpsSettings::GetContentId
   430 // ---------------------------------------------------------------------------
   430 // ---------------------------------------------------------------------------
   431 //
   431 //
   432 void CMailCpsSettings::GetContentId( TInt aId, TDes16& aValue )
   432 TInt CMailCpsSettings::GetContentId( TInt aMailboxId, TInt aId, TDes16& aValue )
   433     {
   433     {
   434     FUNC_LOG;    
   434     FUNC_LOG;
       
   435     TBool cidFound(EFalse);
       
   436     TInt ret(0);
       
   437     TInt found(0);
   435     for (TInt i = 0; i < KMaxMailboxCount; i++)
   438     for (TInt i = 0; i < KMaxMailboxCount; i++)
   436         {       
   439         {       
   437         TInt value;
   440         TInt value;
   438         TUint32 mailboxKey(KCMailMailboxIdBase+i);
   441         TUint32 mailboxKey(KCMailMailboxIdBase+i);
   439         iCenRep->Get( mailboxKey, value );
   442         iCenRep->Get( mailboxKey, value );     
   440         if (aId == value)
   443         if (aMailboxId == value)
   441             {
   444             {
   442             iCenRep->Get( KCMailWidgetContentIdBase+i, aValue );
   445             found++;
   443             break;
   446             if ( !cidFound && found == aId )
   444             }
   447                 {
   445         }    
   448                 iCenRep->Get( KCMailWidgetContentIdBase+i, aValue );
       
   449                 cidFound = ETrue;
       
   450                 }            
       
   451             else if ( cidFound && found == aId + 1 )
       
   452                 {
       
   453                 // There is more widgets with same mailbox accounts. 
       
   454                 ret = aId + 1;
       
   455                 break;
       
   456                 }
       
   457             }
       
   458         }
       
   459     // if there is more than one mailbox with different cid return id of next mailbox
       
   460     return ret;
   446     }
   461     }
   447 
   462 
   448 // ---------------------------------------------------------------------------
   463 // ---------------------------------------------------------------------------
   449 // CMailCpsSettings::IsSelected
   464 // CMailCpsSettings::IsSelected
   450 // ---------------------------------------------------------------------------
   465 // ---------------------------------------------------------------------------