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