mpxplugins/serviceplugins/collectionplugins/mpxsqlitepodcastdbplugin/src/mpxpodcastdbmanager.cpp
branchRCL_3
changeset 53 3de6c4cf6b67
equal deleted inserted replaced
52:14979e23cb5e 53:3de6c4cf6b67
       
     1 /*
       
     2 * Copyright (c) 2007 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:  This class is responsible for managing all of podcast collection
       
    15 *                databases.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <mpxlog.h>
       
    22 #include "mpxpodcastcollectiondbdef.h"
       
    23 #include "mpxpodcastdbmanager.h"
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ==============================
       
    26 
       
    27 // ----------------------------------------------------------------------------
       
    28 // Two-phased constructor.
       
    29 // ----------------------------------------------------------------------------
       
    30 //
       
    31 CMPXPodcastDbManager* CMPXPodcastDbManager::NewL(
       
    32     RFs& aFs)
       
    33     {
       
    34     MPX_FUNC("CMPXPodcastDbManager::NewL");
       
    35 
       
    36     CMPXPodcastDbManager* self = CMPXPodcastDbManager::NewLC(aFs);
       
    37     CleanupStack::Pop(self);
       
    38     return self;
       
    39     }
       
    40 
       
    41 // ----------------------------------------------------------------------------
       
    42 // Two-phased constructor.
       
    43 // ----------------------------------------------------------------------------
       
    44 //
       
    45 CMPXPodcastDbManager* CMPXPodcastDbManager::NewLC(
       
    46     RFs& aFs)
       
    47     {
       
    48     MPX_FUNC("CMPXPodcastDbManager::NewLC");
       
    49 
       
    50     CMPXPodcastDbManager* self = new (ELeave) CMPXPodcastDbManager(aFs);
       
    51     CleanupStack::PushL(self);
       
    52     self->ConstructL();
       
    53     return self;
       
    54     }
       
    55 
       
    56 // ----------------------------------------------------------------------------
       
    57 // Destructor
       
    58 // ----------------------------------------------------------------------------
       
    59 //
       
    60 CMPXPodcastDbManager::~CMPXPodcastDbManager()
       
    61     {
       
    62     MPX_FUNC("CMPXPodcastDbManager::~CMPXPodcastDbManager");
       
    63     }
       
    64 
       
    65 // ----------------------------------------------------------------------------
       
    66 // Constructor
       
    67 // ----------------------------------------------------------------------------
       
    68 //
       
    69 CMPXPodcastDbManager::CMPXPodcastDbManager(
       
    70     RFs& aFs) :
       
    71     CMPXDbManager(aFs)
       
    72     {
       
    73     MPX_FUNC("CMPXPodcastDbManager::CMPXPodcastDbManager");
       
    74     }
       
    75 
       
    76 // ----------------------------------------------------------------------------
       
    77 // Second phase constructor.
       
    78 // ----------------------------------------------------------------------------
       
    79 //
       
    80 void CMPXPodcastDbManager::ConstructL()
       
    81     {
       
    82     MPX_FUNC("CMPXPodcastDbManager::ConstructL");
       
    83     //Find out if the system has an internal drive (eMMC)
       
    84     TBool eMMC( EFalse );
       
    85     TDriveInfo driveInfo;
       
    86     if( Fs().Drive( driveInfo, EDriveE ) == KErrNone )
       
    87     	{
       
    88         if ( driveInfo.iDriveAtt & KDriveAttInternal )
       
    89             eMMC = ETrue;
       
    90         }
       
    91 
       
    92     //Use different name for Dbs if the system has an internal drive vs. MMC-only.
       
    93     //Since hard-coded drive letters in the Thumbnail URIs
       
    94     //So Dbs are not interchangeable between an internal drive system and MMC-only system.
       
    95     if( eMMC )	
       
    96         {
       
    97         CMPXDbManager::ConstructL(TFileName( KMCDbFileEMMC ));
       
    98         }
       
    99     else
       
   100         {
       
   101         CMPXDbManager::ConstructL(TFileName( KMCDbFile ));
       
   102         }
       
   103     }
       
   104 
       
   105 // End of File