mpxplugins/serviceplugins/collectionplugins/mpxsqlitepodcastdbplugin/src/mpxpodcastdbmanager.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 21 Jun 2010 15:37:19 +0300
branchRCL_3
changeset 21 cb96c29156b2
parent 0 ff3acec5bc43
permissions -rw-r--r--
Revision: 201023 Kit: 2010125

/*
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  This class is responsible for managing all of podcast collection
*                databases.
*
*/


// INCLUDE FILES
#include <mpxlog.h>
#include "mpxpodcastcollectiondbdef.h"
#include "mpxpodcastdbmanager.h"

// ============================ MEMBER FUNCTIONS ==============================

// ----------------------------------------------------------------------------
// Two-phased constructor.
// ----------------------------------------------------------------------------
//
CMPXPodcastDbManager* CMPXPodcastDbManager::NewL(
    RFs& aFs)
    {
    MPX_FUNC("CMPXPodcastDbManager::NewL");

    CMPXPodcastDbManager* self = CMPXPodcastDbManager::NewLC(aFs);
    CleanupStack::Pop(self);
    return self;
    }

// ----------------------------------------------------------------------------
// Two-phased constructor.
// ----------------------------------------------------------------------------
//
CMPXPodcastDbManager* CMPXPodcastDbManager::NewLC(
    RFs& aFs)
    {
    MPX_FUNC("CMPXPodcastDbManager::NewLC");

    CMPXPodcastDbManager* self = new (ELeave) CMPXPodcastDbManager(aFs);
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
    }

// ----------------------------------------------------------------------------
// Destructor
// ----------------------------------------------------------------------------
//
CMPXPodcastDbManager::~CMPXPodcastDbManager()
    {
    MPX_FUNC("CMPXPodcastDbManager::~CMPXPodcastDbManager");
    }

// ----------------------------------------------------------------------------
// Constructor
// ----------------------------------------------------------------------------
//
CMPXPodcastDbManager::CMPXPodcastDbManager(
    RFs& aFs) :
    CMPXDbManager(aFs)
    {
    MPX_FUNC("CMPXPodcastDbManager::CMPXPodcastDbManager");
    }

// ----------------------------------------------------------------------------
// Second phase constructor.
// ----------------------------------------------------------------------------
//
void CMPXPodcastDbManager::ConstructL()
    {
    MPX_FUNC("CMPXPodcastDbManager::ConstructL");
    //Find out if the system has an internal drive (eMMC)
    TBool eMMC( EFalse );
    TDriveInfo driveInfo;
    if( Fs().Drive( driveInfo, EDriveE ) == KErrNone )
    	{
        if ( driveInfo.iDriveAtt & KDriveAttInternal )
            eMMC = ETrue;
        }

    //Use different name for Dbs if the system has an internal drive vs. MMC-only.
    //Since hard-coded drive letters in the Thumbnail URIs
    //So Dbs are not interchangeable between an internal drive system and MMC-only system.
    if( eMMC )	
        {
        CMPXDbManager::ConstructL(TFileName( KMCDbFileEMMC ));
        }
    else
        {
        CMPXDbManager::ConstructL(TFileName( KMCDbFile ));
        }
    }

// End of File