|
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 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include "widgetscannerutils.h" |
|
20 #include "cainnerentry.h" |
|
21 #include "cadef.h" |
|
22 |
|
23 // ----------------------------------------------------------------------------- |
|
24 // |
|
25 // ----------------------------------------------------------------------------- |
|
26 // |
|
27 TBool WidgetScannerUtils::IsFileOnDrive(const TDesC& aFileName, |
|
28 const DriveInfo::TDefaultDrives& aDefaultDrive) |
|
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 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 TUint WidgetScannerUtils::CurrentMmcId( RFs& aFs ) |
|
50 { |
|
51 TUint mmcId = 0; |
|
52 TInt mmcDrive; |
|
53 if ( DriveInfo::GetDefaultDrive( |
|
54 DriveInfo::EDefaultRemovableMassStorage, mmcDrive ) == KErrNone ) |
|
55 { |
|
56 TVolumeInfo volumeInfo; |
|
57 if( aFs.Volume( volumeInfo, mmcDrive ) == KErrNone ) |
|
58 { |
|
59 mmcId = volumeInfo.iUniqueID; |
|
60 } |
|
61 } |
|
62 return mmcId; |
|
63 } |
|
64 |
|
65 // End of File |