brandingserver/tools/bsimport/src/bsbrandremover.cpp
changeset 0 e6b17d312c8b
child 21 cfd5c2994f10
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2006-2006 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:  Removes brands from branding server
       
    15 *
       
    16 */
       
    17 
       
    18 #include <utf.h>
       
    19 
       
    20 #include <cbsfactory.h>
       
    21 #include <mbsupdater.h>
       
    22 
       
    23 #include "bsbrandremover.h"
       
    24 
       
    25 
       
    26 // ======== MEMBER FUNCTIONS ========
       
    27     
       
    28 // ---------------------------------------------------------------------------
       
    29 // BSBrandRemover::RemoveBrand
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 void BSBrandRemover::RemoveBrandL( const TDesC& aBrandId,
       
    33                                    const TDesC& aApplicationId )
       
    34     {
       
    35     // 16bit -> 8bit conversion
       
    36     HBufC8* brandBuf = HBufC8::NewLC( aBrandId.Length() );
       
    37     HBufC8* appBuf = HBufC8::NewLC( aApplicationId.Length() );
       
    38     TPtr8 brand( brandBuf->Des() );
       
    39     TPtr8 app( appBuf->Des() );
       
    40     
       
    41     CnvUtfConverter::ConvertFromUnicodeToUtf8( brand, aBrandId );
       
    42     CnvUtfConverter::ConvertFromUnicodeToUtf8( app, aApplicationId );
       
    43     
       
    44     // Remove brand
       
    45     CBSFactory* factory = CBSFactory::NewL( brand, app );
       
    46     CleanupStack::PushL( factory );
       
    47     MBSUpdater* updater = factory->CreateUpdaterLC();
       
    48     //updater->StartTransactionL( brand, ELangOther, KBSAutomaticVersionUpdate );
       
    49     updater->StartTransactionL( brand, ELangOther, MBSUpdater::EUpdateUninstall);
       
    50     
       
    51     updater->RemoveBrandL( brand, app );
       
    52     
       
    53     updater->StopTransactionL();
       
    54     CleanupStack::PopAndDestroy( 4 ); // updater, factory, brandBuf, appBuf
       
    55     }
       
    56 
       
    57 // End of file