85
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 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 |
*
|
93
|
14 |
* Description:
|
85
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include "widgetscannerutils.h"
|
|
20 |
#include "cainnerentry.h"
|
|
21 |
#include "cadef.h"
|
|
22 |
|
|
23 |
// -----------------------------------------------------------------------------
|
93
|
24 |
//
|
85
|
25 |
// -----------------------------------------------------------------------------
|
|
26 |
//
|
|
27 |
TBool WidgetScannerUtils::IsFileOnDrive(const TDesC& aFileName,
|
93
|
28 |
const DriveInfo::TDefaultDrives& aDefaultDrive)
|
85
|
29 |
{
|
|
30 |
if (aFileName.Length()) {
|
|
31 |
TInt drive;
|
|
32 |
TInt err = DriveInfo::GetDefaultDrive(aDefaultDrive, drive);
|
|
33 |
if (!err) {
|
|
34 |
TInt fileDrive;
|
|
35 |
err = RFs::CharToDrive(aFileName[0], fileDrive);
|
|
36 |
if (!err && fileDrive == drive) {
|
|
37 |
return ETrue;
|
|
38 |
}
|
|
39 |
}
|
|
40 |
}
|
|
41 |
return EFalse;
|
|
42 |
}
|
|
43 |
|
|
44 |
|
|
45 |
// -----------------------------------------------------------------------------
|
93
|
46 |
//
|
85
|
47 |
// -----------------------------------------------------------------------------
|
|
48 |
//
|
93
|
49 |
void WidgetScannerUtils::CurrentMmcId( const RFs& aFs, TDes& aMmcId )
|
85
|
50 |
{
|
|
51 |
TInt mmcDrive;
|
|
52 |
if ( DriveInfo::GetDefaultDrive(
|
|
53 |
DriveInfo::EDefaultRemovableMassStorage, mmcDrive ) == KErrNone )
|
|
54 |
{
|
|
55 |
TVolumeInfo volumeInfo;
|
|
56 |
if( aFs.Volume( volumeInfo, mmcDrive ) == KErrNone )
|
|
57 |
{
|
93
|
58 |
aMmcId.Zero();
|
|
59 |
aMmcId.AppendNum( volumeInfo.iUniqueID );
|
85
|
60 |
}
|
|
61 |
}
|
|
62 |
}
|
|
63 |
|
93
|
64 |
// End of File
|