convergedcallengine/spsettings/backuphelper/src/spsbackuphelpermain.cpp
changeset 0 ff3b6d0fd310
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2009 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 for spsettings backuphelper
       
    15 *
       
    16 */
       
    17 
       
    18 //  Include Files  
       
    19 #include <e32base.h>
       
    20 
       
    21 #include "spsbackuphelpermonitor.h"
       
    22 
       
    23 //  Constants
       
    24 
       
    25 //  Local Functions
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // DoStartL
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 void DoStartL()
       
    32     {
       
    33     // Create active scheduler (to run active objects)
       
    34     CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
       
    35     CleanupStack::PushL(scheduler);
       
    36     CActiveScheduler::Install(scheduler);
       
    37 
       
    38     CSpsBackupHelperMonitor* monitor = CSpsBackupHelperMonitor::NewL();
       
    39     
       
    40     scheduler->Start();
       
    41     delete monitor;
       
    42     
       
    43     // Delete active scheduler
       
    44     CleanupStack::PopAndDestroy(scheduler);
       
    45     }
       
    46 
       
    47 //  Global Functions
       
    48 
       
    49 // ---------------------------------------------------------------------------
       
    50 // E32Main
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 GLDEF_C TInt E32Main()
       
    54     {
       
    55     // Create cleanup stack
       
    56     __UHEAP_MARK;
       
    57     CTrapCleanup* cleanup = CTrapCleanup::New();
       
    58     
       
    59     TInt mainError;
       
    60     if( cleanup )
       
    61         {
       
    62         // Run application code inside TRAP harness
       
    63         TRAP(mainError, DoStartL());
       
    64         }
       
    65 
       
    66     delete cleanup;
       
    67     __UHEAP_MARKEND;
       
    68     return KErrNone;
       
    69     }
       
    70 
       
    71