// ---------------------------------------------------------------------------
// CAknMemorySelectionDialogMultiDrive::AddDrivePathsL
// ---------------------------------------------------------------------------
//
EXPORT_C TInt CAknMemorySelectionDialogMultiDrive::AddDrivePathsL(
    const TDesC& aRootPath,
    const TDesC& aDefaultFolder
    )
    {
    // TODO: Verify paramters if they are valid.
    TInt rootPathCount=iRootPathArray.Count();
    TInt result = KErrNone;
    TPath path;
    for ( TInt i=0;i<rootPathCount;i++ )
        {
        path.Copy( iRootPathArray[i] );
        path.Append( aRootPath );
        AknCFDUtility::AddTrailingBackslash( path );
        iRootPathArray.Delete(i);
        iRootPathArray.Compress();
        iRootPathArray.InsertL( i, path );
        path.Copy( aDefaultFolder );
        AknCFDUtility::AddTrailingBackslash( path );
        iDefaultFolderArray.Delete(i);
        iDefaultFolderArray.Compress();
        iDefaultFolderArray.InsertL( i, path );
        }
    return result;
    }
// ---------------------------------------------------------------------------
// CAknMemorySelectionModelMultiDrive::ReadUserDefinedDataL
// ---------------------------------------------------------------------------
//
void CAknMemorySelectionModelMultiDrive::ReadUserDefinedDataL(
    TResourceReader& aReader, TInt aLocations )
    {
    if ( aLocations <= 0)
        {
        return;
        }
    
    iDefDriveArray = new ( ELeave ) CDesCArrayFlat( aLocations );
    iDefDefaultFolderArray = new ( ELeave ) CDesCArrayFlat( aLocations );
    for ( TInt i = 0; i < aLocations; i++ )
        {
        // read the location, save path and default folder in array
        TPath temp;
        temp.Copy( aReader.ReadTPtrC() );
        iDefDriveArray->AppendL( temp );
        temp.Copy( aReader.ReadTPtrC() );
        iDefDefaultFolderArray->AppendL( temp );
        }
    }