appinstaller/AppinstUi/startuplistupdater/src/main.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
child 27 e8965914fac7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
       
     2 * Copyright (c) 2010 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:  Main source file for startup list updater.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "startuplistupdater.h"
       
    19 
       
    20 _LIT( KStartupListUpdaterThread, "StartupListUpdater" );
       
    21 
       
    22 
       
    23 // ---------------------------------------------------------------------------
       
    24 // StartupListUpdaterL()
       
    25 // ---------------------------------------------------------------------------
       
    26 //
       
    27 void StartupListUpdaterL()
       
    28     {
       
    29     User::LeaveIfError( User::RenameThread( KStartupListUpdaterThread ) );
       
    30     RProcess::Rendezvous( KErrNone );
       
    31 
       
    32     CStartupListUpdater* updater = CStartupListUpdater::NewL();
       
    33     CleanupStack::PushL( updater );
       
    34     updater->UpdateStartupListL();
       
    35     CleanupStack::PopAndDestroy( updater );
       
    36 }
       
    37 
       
    38 
       
    39 // ---------------------------------------------------------------------------
       
    40 // E32Main()
       
    41 // ---------------------------------------------------------------------------
       
    42 //
       
    43 GLDEF_C TInt E32Main()
       
    44     {
       
    45     TInt returnCode = KErrNone;
       
    46     __UHEAP_MARK;
       
    47 
       
    48     CTrapCleanup* cleanup = CTrapCleanup::New();
       
    49     if( cleanup )
       
    50         {
       
    51         CActiveScheduler* scheduler = new CActiveScheduler();
       
    52         if( scheduler )
       
    53             {
       
    54             CActiveScheduler::Install( scheduler );
       
    55 
       
    56             TRAP( returnCode, StartupListUpdaterL() );
       
    57 
       
    58             delete scheduler;
       
    59             delete cleanup;
       
    60             }
       
    61         else
       
    62             {
       
    63             delete cleanup;
       
    64             return KErrNoMemory;
       
    65             }
       
    66         }
       
    67     else
       
    68         {
       
    69         return KErrNoMemory;
       
    70         }
       
    71 
       
    72     __UHEAP_MARKEND;
       
    73     return returnCode;
       
    74     }
       
    75