appinstaller/AppMngr2/src/appmngr2logdatabaseentry.cpp
changeset 80 9dcba1ee99f7
parent 77 d1838696558c
equal deleted inserted replaced
77:d1838696558c 80:9dcba1ee99f7
     1 /*
       
     2 * Copyright (c) 2008 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:   Implements CAppMngr2LogDatabaseEntry to access installation log
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "appmngr2logdatabaseentry.h"   // CAppMngr2LogDatabaseEntry
       
    20 
       
    21 // Columns in SQL query KLogReadTableSQL: "SELECT time,name,vendor,version,action FROM log"
       
    22 const TInt KTimeCol = 1;
       
    23 const TInt KNameCol = 2;
       
    24 const TInt KVendorCol = 3;
       
    25 const TInt KVersionCol = 4;
       
    26 const TInt KActionCol = 5;
       
    27 
       
    28 
       
    29 // ======== MEMBER FUNCTIONS ========
       
    30 
       
    31 // ---------------------------------------------------------------------------
       
    32 // CAppMngr2LogDatabaseEntry::NewL()
       
    33 // ---------------------------------------------------------------------------
       
    34 //
       
    35 CAppMngr2LogDatabaseEntry* CAppMngr2LogDatabaseEntry::NewL( RDbView& aView )
       
    36     {
       
    37     CAppMngr2LogDatabaseEntry* self = new (ELeave) CAppMngr2LogDatabaseEntry;
       
    38     CleanupStack::PushL( self );
       
    39     self->ConstructL( aView );
       
    40     CleanupStack::Pop( self );
       
    41     return self;
       
    42     }
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // CAppMngr2LogDatabaseEntry::~CAppMngr2LogDatabaseEntry()
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 CAppMngr2LogDatabaseEntry::~CAppMngr2LogDatabaseEntry()
       
    49     {
       
    50     delete iName;
       
    51     delete iVersion;
       
    52     delete iVendor;
       
    53     }
       
    54 
       
    55 // ---------------------------------------------------------------------------
       
    56 // CAppMngr2LogDatabaseEntry::CAppMngr2LogDatabaseEntry()
       
    57 // ---------------------------------------------------------------------------
       
    58 //
       
    59 CAppMngr2LogDatabaseEntry::CAppMngr2LogDatabaseEntry()
       
    60     {
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // CAppMngr2LogDatabaseEntry::ConstructL()
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 void CAppMngr2LogDatabaseEntry::ConstructL( RDbView& aView )
       
    68     {
       
    69     aView.GetL();
       
    70     TInt64 time = aView.ColInt64( KTimeCol );
       
    71     iTime = TTime( time );
       
    72     iName = aView.ColDes( KNameCol ).AllocL();
       
    73     iVendor = aView.ColDes( KVendorCol ).AllocL();
       
    74     iVersion = aView.ColDes( KVersionCol ).AllocL();
       
    75     iAction = (SwiUI::TLogTaskAction)aView.ColUint32( KActionCol );
       
    76     }
       
    77