contentstorage/casrv/cawidgetscanner/src/widgetscannerutils.cpp
author hgs
Fri, 30 Apr 2010 15:22:08 +0300
changeset 93 82b66994846c
parent 85 7feec50967db
child 98 d2f833ab7940
permissions -rw-r--r--
201017
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
85
7feec50967db 201003_02
hgs
parents:
diff changeset
     1
/*
7feec50967db 201003_02
hgs
parents:
diff changeset
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
7feec50967db 201003_02
hgs
parents:
diff changeset
     3
* All rights reserved.
7feec50967db 201003_02
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
7feec50967db 201003_02
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
7feec50967db 201003_02
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
7feec50967db 201003_02
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
7feec50967db 201003_02
hgs
parents:
diff changeset
     8
*
7feec50967db 201003_02
hgs
parents:
diff changeset
     9
* Initial Contributors:
7feec50967db 201003_02
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
7feec50967db 201003_02
hgs
parents:
diff changeset
    11
*
7feec50967db 201003_02
hgs
parents:
diff changeset
    12
* Contributors:
7feec50967db 201003_02
hgs
parents:
diff changeset
    13
*
93
hgs
parents: 85
diff changeset
    14
* Description:
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    15
 *
7feec50967db 201003_02
hgs
parents:
diff changeset
    16
*/
7feec50967db 201003_02
hgs
parents:
diff changeset
    17
7feec50967db 201003_02
hgs
parents:
diff changeset
    18
// INCLUDE FILES
7feec50967db 201003_02
hgs
parents:
diff changeset
    19
#include "widgetscannerutils.h"
7feec50967db 201003_02
hgs
parents:
diff changeset
    20
#include "cainnerentry.h"
7feec50967db 201003_02
hgs
parents:
diff changeset
    21
#include "cadef.h"
7feec50967db 201003_02
hgs
parents:
diff changeset
    22
7feec50967db 201003_02
hgs
parents:
diff changeset
    23
// -----------------------------------------------------------------------------
93
hgs
parents: 85
diff changeset
    24
//
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    25
// -----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    26
//
7feec50967db 201003_02
hgs
parents:
diff changeset
    27
TBool WidgetScannerUtils::IsFileOnDrive(const TDesC& aFileName,
93
hgs
parents: 85
diff changeset
    28
    const DriveInfo::TDefaultDrives& aDefaultDrive)
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    29
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    30
    if (aFileName.Length()) {
7feec50967db 201003_02
hgs
parents:
diff changeset
    31
        TInt drive;
7feec50967db 201003_02
hgs
parents:
diff changeset
    32
        TInt err = DriveInfo::GetDefaultDrive(aDefaultDrive, drive);
7feec50967db 201003_02
hgs
parents:
diff changeset
    33
        if (!err) {
7feec50967db 201003_02
hgs
parents:
diff changeset
    34
            TInt fileDrive;
7feec50967db 201003_02
hgs
parents:
diff changeset
    35
            err = RFs::CharToDrive(aFileName[0], fileDrive);
7feec50967db 201003_02
hgs
parents:
diff changeset
    36
            if (!err && fileDrive == drive) {
7feec50967db 201003_02
hgs
parents:
diff changeset
    37
                return ETrue;
7feec50967db 201003_02
hgs
parents:
diff changeset
    38
            }
7feec50967db 201003_02
hgs
parents:
diff changeset
    39
        }
7feec50967db 201003_02
hgs
parents:
diff changeset
    40
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
    41
    return EFalse;
7feec50967db 201003_02
hgs
parents:
diff changeset
    42
}
7feec50967db 201003_02
hgs
parents:
diff changeset
    43
7feec50967db 201003_02
hgs
parents:
diff changeset
    44
7feec50967db 201003_02
hgs
parents:
diff changeset
    45
// -----------------------------------------------------------------------------
93
hgs
parents: 85
diff changeset
    46
//
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    47
// -----------------------------------------------------------------------------
7feec50967db 201003_02
hgs
parents:
diff changeset
    48
//
93
hgs
parents: 85
diff changeset
    49
void WidgetScannerUtils::CurrentMmcId( const RFs& aFs, TDes& aMmcId )
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    50
    {
7feec50967db 201003_02
hgs
parents:
diff changeset
    51
    TInt mmcDrive;
7feec50967db 201003_02
hgs
parents:
diff changeset
    52
    if ( DriveInfo::GetDefaultDrive(
7feec50967db 201003_02
hgs
parents:
diff changeset
    53
            DriveInfo::EDefaultRemovableMassStorage, mmcDrive ) == KErrNone )
7feec50967db 201003_02
hgs
parents:
diff changeset
    54
        {
7feec50967db 201003_02
hgs
parents:
diff changeset
    55
        TVolumeInfo volumeInfo;
7feec50967db 201003_02
hgs
parents:
diff changeset
    56
        if( aFs.Volume( volumeInfo, mmcDrive ) == KErrNone )
7feec50967db 201003_02
hgs
parents:
diff changeset
    57
            {
93
hgs
parents: 85
diff changeset
    58
            aMmcId.Zero();
hgs
parents: 85
diff changeset
    59
            aMmcId.AppendNum( volumeInfo.iUniqueID );
85
7feec50967db 201003_02
hgs
parents:
diff changeset
    60
            }
7feec50967db 201003_02
hgs
parents:
diff changeset
    61
        }
7feec50967db 201003_02
hgs
parents:
diff changeset
    62
    }
7feec50967db 201003_02
hgs
parents:
diff changeset
    63
93
hgs
parents: 85
diff changeset
    64
//  End of File