messagingappbase/msgavkon/muiu_internal/settingsarray/src/MuiuSettingsArray.cpp
branchRCL_3
changeset 9 1d7827e39b52
parent 0 72b543305e3a
child 15 52d61119153d
equal deleted inserted replaced
5:4697dfb2d7ad 9:1d7827e39b52
    27 #include <aknradiobuttonsettingpage.h>
    27 #include <aknradiobuttonsettingpage.h>
    28 #include <aknpasswordsettingpage.h>
    28 #include <aknpasswordsettingpage.h>
    29 #include <akntextsettingpage.h>
    29 #include <akntextsettingpage.h>
    30 #include <muiu_internal.rsg>
    30 #include <muiu_internal.rsg>
    31 #include "MuiuSettingsArray.h"
    31 #include "MuiuSettingsArray.h"
       
    32 #include <e32property.h>
       
    33 #include <MessagingInternalPSkeys.h>
       
    34 #include <StringLoader.h>
    32 
    35 
    33 // CONSTANTS
    36 // CONSTANTS
    34 const TInt KMuiuSettingsArrayGranularity    = 4;
    37 const TInt KMuiuSettingsArrayGranularity    = 4;
    35 const TInt KMuiuSettingsArrayVisibleTextLength = 30;
    38 const TInt KMuiuSettingsArrayVisibleTextLength = 30;
    36 const TInt KPaswordStrLength = 32;
    39 const TInt KPaswordStrLength = 32;
   104             item.iCurrentNumber = 0;
   107             item.iCurrentNumber = 0;
   105             item.iMuiuSettingsItemArray = 0;
   108             item.iMuiuSettingsItemArray = 0;
   106             item.iType = EMuiuSettingsUnknown;
   109             item.iType = EMuiuSettingsUnknown;
   107             HBufC* txt = reader.ReadHBufCL();   // message text
   110             HBufC* txt = reader.ReadHBufCL();   // message text
   108             item.iLabelText.Copy( *txt );
   111             item.iLabelText.Copy( *txt );
       
   112             TBool flag = EFalse;
       
   113             //If string retrived from resource is "Message sent as" 
       
   114             flag = IsMessageSentStringL( txt );
       
   115 
   109             delete txt;
   116             delete txt;
   110             
   117             
   111             const TMuiuSettingsType type = ( TMuiuSettingsType ) reader.ReadInt16();
   118             const TMuiuSettingsType type = ( TMuiuSettingsType ) reader.ReadInt16();
   112             item.iType = type;
   119             item.iType = type;
   113             const TInt maxLength = reader.ReadInt16();
   120             const TInt maxLength = reader.ReadInt16();
   134                     array->AppendL( *txt );
   141                     array->AppendL( *txt );
   135                     CleanupStack::PopAndDestroy(); // txt
   142                     CleanupStack::PopAndDestroy(); // txt
   136                     }
   143                     }
   137                 CleanupStack::PopAndDestroy(); //reader2
   144                 CleanupStack::PopAndDestroy(); //reader2
   138                 item.iMuiuSettingsItemArray = array;
   145                 item.iMuiuSettingsItemArray = array;
       
   146                 if(!flag)
   139                 AppendL( item );
   147                 AppendL( item );
   140                 CleanupStack::Pop( array ); //array
   148                 CleanupStack::Pop( array ); //array
   141                 }
   149                 }
   142             else
   150             else
   143                 {
   151                 {
   433         }
   441         }
   434 
   442 
   435     return tempText;
   443     return tempText;
   436     }
   444     }
   437 
   445 
       
   446 // ---------------------------------------------------------
       
   447 // CMuiuSettingsArray::IsMessageSentStringL
       
   448 // ---------------------------------------------------------
       
   449 //
       
   450 TBool CMuiuSettingsArray::IsMessageSentStringL(HBufC* aString)
       
   451     {
       
   452     TInt flag = EFalse;
       
   453     HBufC* string = StringLoader::LoadLC( R_MUIU__MCE_SETTINGS_SMS_CONVERSION);
       
   454     if (aString->Compare(string->Des()) == 0)
       
   455         {
       
   456          TInt val = 0;
       
   457          TInt ret = RProperty::Get( KPSUidMuiu, KMuiuRemoveMsgSentSettings, val );
       
   458          if ( ret == KErrNone && val != 0 )
       
   459              {
       
   460              flag = ETrue;
       
   461              RProperty::Set( KPSUidMuiu, KMuiuRemoveMsgSentSettings, 0) ;
       
   462              }
       
   463          }
       
   464     CleanupStack::PopAndDestroy( string );
       
   465     return flag;
       
   466     }
   438 //  End of File
   467 //  End of File