wvuing/wvuieng/EngSrc/wvengutils.cpp
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c)  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:  wvuiengine utility methods
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <centralrepository.h>
       
    20 
       
    21 #include "wvengutils.h"
       
    22 
       
    23 // ======== MEMBER FUNCTIONS ========
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // ?description_if_needed
       
    27 // ---------------------------------------------------------------------------
       
    28 //
       
    29 TUint32 WVEngUtils::CRKeyL( TUid aUid, TUint32 aKey )
       
    30     {
       
    31     TInt retVal = 0;
       
    32 
       
    33     TRAPD( err,
       
    34            CRepository* rep = CRepository::NewL( aUid );
       
    35            rep->Get( aKey, retVal );
       
    36            delete rep;
       
    37          );  // TRAPD
       
    38 
       
    39     if ( err != KErrNotFound && err != KErrPathNotFound )
       
    40         {
       
    41         // "Not found" errors are ignored, because it's ok to
       
    42         // return zero if key is not found
       
    43         User::LeaveIfError( err );
       
    44         }
       
    45 
       
    46     return retVal;
       
    47     }