sipplugins/sippsipsettingsui/src/sipupdatedpasswordsetitem.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  To update the text on the list box every time
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include "sipupdatedpasswordsetitem.h"
       
    22 #include    "gssippluginlogger.h"
       
    23 // CONSTANTS
       
    24 
       
    25 const TInt KSIPExtraPasswdChars = 4;
       
    26 const TInt KSIPRemovePasswdChars = 2;
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ===============================
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CSIPUpdatedPasswordSetItem::CSIPUpdatedPasswordSetItem
       
    32 // C++ default constructor can NOT contain any code, that
       
    33 // might leave.
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 CSIPUpdatedPasswordSetItem::CSIPUpdatedPasswordSetItem(
       
    37     TInt aIdentifier,
       
    38     enum TAknPasswordSettingItemMode aMode, 
       
    39     TDes& aPassword ) :
       
    40     CAknPasswordSettingItem( aIdentifier, aMode, aPassword ),
       
    41     iPassword( aPassword )
       
    42     {
       
    43     __GSLOGSTRING("CSIPUpdatedPasswordSetItem::CSIPUpdatedPasswordSetItem" )
       
    44     }
       
    45 
       
    46 // Destructor
       
    47 CSIPUpdatedPasswordSetItem::~CSIPUpdatedPasswordSetItem()
       
    48     {
       
    49     __GSLOGSTRING("CSIPUpdatedPasswordSetItem::~CSIPUpdatedPasswordSetItem" )
       
    50     }
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 // CSIPUpdatedPasswordSetItem::EditItemL
       
    54 // Displays the popup list and then updates the list manually afterwards
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 void CSIPUpdatedPasswordSetItem::EditItemL( TBool aCalledFromMenu )
       
    58     {
       
    59     __GSLOGSTRING("CSIPUpdatedPasswordSetItem::EditItemL" )
       
    60     CAknPasswordSettingItem::EditItemL( aCalledFromMenu );
       
    61     UpdateListBoxTextL();
       
    62     StoreL();
       
    63        
       
    64     if ( iPassword.Length() )
       
    65         {
       
    66         // Remove two asterisks from ListBoxText() descriptor if needed.
       
    67         TInt pos = SettingName().Length() + KSIPExtraPasswdChars;
       
    68         TPtr ptr = ListBoxText()->Des();
       
    69         ptr.Delete( pos, KSIPRemovePasswdChars );
       
    70         }
       
    71     }