phonebookui/Phonebook2/Application/src/tpbk2multidriveavailable.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002-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 is MMC version of TPbk2ExtraDriveAvailable
       
    15 *                Checks is there MMC in phone
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include "tpbk2multidriveavailable.h"
       
    21 #include <driveinfo.h>
       
    22 
       
    23 
       
    24 const TInt PhoneMemoryOnly = 1;
       
    25 
       
    26 // ================= MEMBER FUNCTIONS =======================
       
    27 
       
    28 // --------------------------------------------------------------------------
       
    29 // TPbk2ExtraDriveAvailable::ExtraDriveAvailable
       
    30 // --------------------------------------------------------------------------
       
    31 //
       
    32 TBool TPbk2MultiDriveAvailable::MultiDriveAvailable( RFs& aFs )
       
    33     {
       
    34     DriveInfo::TDriveArray driveArray;
       
    35     TInt err = DriveInfo::GetUserVisibleDrives( 
       
    36         aFs, driveArray );
       
    37     TInt foundDrives(0);
       
    38     if ( err == KErrNone )
       
    39         {
       
    40         TVolumeInfo volumeInfo;
       
    41         TInt driveCount( driveArray.Count() );
       
    42         for ( TInt i(0); i < driveCount && foundDrives <= PhoneMemoryOnly; ++i )
       
    43             {
       
    44             if ( aFs.Volume( volumeInfo, driveArray[i] ) == KErrNone )
       
    45                 {
       
    46                 ++foundDrives;
       
    47                 }
       
    48             }
       
    49         }
       
    50     return foundDrives > PhoneMemoryOnly;
       
    51     }
       
    52 
       
    53 // End of file