author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 09:02:20 +0200 | |
changeset 22 | 9a9a761f03f1 |
parent 18 | a758fa0cb043 |
child 25 | 0ed94ceaa377 |
permissions | -rw-r--r-- |
22
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
1 |
// |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
2 |
// ============================================================================ |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
3 |
// Name : WidgetMMCHandler.cpp |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
4 |
// Part of : SW Installer UIs / WidgetInstallerUI |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
5 |
// |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
6 |
// Description: Handle notifications of MMC events. |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
7 |
// |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
8 |
// |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
9 |
// Version : 3.1 |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
10 |
// |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
11 |
// Copyright © 2006 Nokia Corporation. |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
12 |
// This material, including documentation and any related |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
13 |
// computer programs, is protected by copyright controlled by |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
14 |
// Nokia Corporation. All rights are reserved. Copying, |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
15 |
// including reproducing, storing, adapting or translating, any |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
16 |
// or all of this material requires the prior written consent of |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
17 |
// Nokia Corporation. This material also contains confidential |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
18 |
// information which may not be disclosed to others without the |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
19 |
// prior written consent of Nokia Corporation. |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
20 |
// ============================================================================== |
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
21 |
/// |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
|
22
9a9a761f03f1
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
23 |
// INCLUDE FILES |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include "wrtusbhandler.h" |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
#include "wrtharvester.h" |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
#include "wrtusbhandler.h" |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
27 |
#include <DriveInfo.h> |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
// CONSTANTS |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
|
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
32 |
static TInt TimerCallBack( TAny* ptr ) |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
33 |
{ |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
34 |
CWrtUsbHandler* temp = static_cast<CWrtUsbHandler*>(ptr); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
35 |
if(temp) |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
36 |
{ |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
37 |
temp->DeleteTimer(); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
38 |
temp->DoScanAndUpdate(); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
39 |
} |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
40 |
return 0; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
41 |
} |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
43 |
// CWrtUsbHandler::NewL() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
// two-phase constructor |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
// |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
// @since 3.1 |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
// @param aRegistry - Widget registry for callback. |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
// @param aFs - file session |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
49 |
// @return pointer to CWrtUsbHandler |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
// ============================================================================ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
// |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
52 |
CWrtUsbHandler* CWrtUsbHandler::NewL( |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
CWrtHarvester* aHarvester, |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
RFs& aFs ) |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
{ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
56 |
CWrtUsbHandler* self = |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
57 |
new(ELeave) CWrtUsbHandler( aHarvester , aFs ); |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
CleanupStack::PushL( self ); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
self->ConstructL(); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
CleanupStack::Pop( self ); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
return self; |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
65 |
// CWrtUsbHandler::CWrtUsbHandler() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
// C++ default constructor |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
// |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
// @since 3.1 |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
// ============================================================================ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
// |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
71 |
CWrtUsbHandler::CWrtUsbHandler( CWrtHarvester* aHarvester, |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
RFs& aFs ) |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
: CActive( CActive::EPriorityUserInput ), |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
iHarvester( aHarvester ), |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
iFs( aFs ), |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
iDriveFlags( 0 ) |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
CActiveScheduler::Add( this ); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
82 |
// CWrtUsbHandler::ConstructL() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
// Symbian default constructor |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
// |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
// @since 3.1 |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
// ============================================================================ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
// |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
88 |
void CWrtUsbHandler::ConstructL() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
if ( KErrNone != ScanDrives( iDriveFlags ) ) |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
iDriveFlags = 0; |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
93 |
} |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
97 |
// CWrtUsbHandler::~CWrtUsbHandler() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
// destructor |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
// |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
100 |
// @since 3.1 |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
102 |
CWrtUsbHandler::~CWrtUsbHandler() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
Cancel(); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
105 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
108 |
// CWrtUsbHandler::Start() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
// Start monitoring. |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
// |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
// @since 5.0 |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
113 |
void CWrtUsbHandler::Start() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
iFs.NotifyChange( ENotifyDisk, iStatus ); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
SetActive(); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
120 |
// CWrtUsbHandler::RunL() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
// Handle notifications of MMC events. |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
// |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
// @since 3.1 |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
125 |
void CWrtUsbHandler::RunL() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
if ( iStatus == KErrNone ) |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
128 |
{ |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
129 |
//Call back Timer |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
130 |
iCallBackTimer = CPeriodic::NewL(CActive::EPriorityLow); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
131 |
iCallBackTimer->Start(10000000,0,TCallBack(&TimerCallBack,this)); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
132 |
} |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
133 |
} |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
|
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
135 |
void CWrtUsbHandler::DoScanAndUpdate() |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
136 |
{ |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
137 |
TInt err = 0; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
138 |
TInt driveFlags = 0; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
139 |
TInt deltaDriveFlags = 0; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
140 |
if ( KErrNone == ScanDrives( driveFlags ) ) |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
141 |
{ |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
142 |
deltaDriveFlags = iDriveFlags ^ driveFlags; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
143 |
iDriveFlags = driveFlags; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
144 |
} |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
145 |
|
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
146 |
if ( deltaDriveFlags ) |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
147 |
{ |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
148 |
//Unpluging USB from Mass storage . . . |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
149 |
if(iHarvester->IsInMSMode() == 1) |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
150 |
{ |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
151 |
iHarvester->SetMSMode(0); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
152 |
iHarvester->ClearAllOperations(); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
153 |
TRAP(err, iHarvester->UpdateL() ); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
154 |
iFs.NotifyChange( ENotifyDisk, iStatus ); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
155 |
SetActive(); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
156 |
return; |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
|
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
159 |
TVolumeInfo volInfo; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
160 |
TInt temp = deltaDriveFlags; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
161 |
TBool massMemAltered = EFalse; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
162 |
for(TInt DriveNo = EDriveA+1 ; DriveNo<=EDriveY; DriveNo++ ) |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
163 |
{ |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
temp = temp >> 1; |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
if( temp & 01) |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
166 |
{ |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
167 |
TUint status(0); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
168 |
err = DriveInfo::GetDriveStatus( iFs, DriveNo , status ); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
169 |
if(!err && (status & DriveInfo::EDriveExternallyMountable) && (status & DriveInfo::EDriveInternal )) |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
170 |
{ |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
171 |
//Internal Memory |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
172 |
massMemAltered = ETrue; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
173 |
} |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
174 |
} |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
175 |
} |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
176 |
if( massMemAltered ) |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
177 |
{ |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
178 |
iHarvester->SetMSMode(1); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
179 |
} |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
180 |
|
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
181 |
TRAP( err, iHarvester->UpdateL() ); |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
183 |
iFs.NotifyChange( ENotifyDisk, iStatus ); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
184 |
SetActive(); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
186 |
|
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
187 |
|
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
188 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
189 |
// CWrtUsbHandler::RunError() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
190 |
// Ignore errors from RunL. |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
191 |
// |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
192 |
// @since 5.0 |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
194 |
TInt CWrtUsbHandler::RunError( TInt /* aError */ ) |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
return KErrNone; // indicates error was handled |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
197 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
198 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
199 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
200 |
// CWrtUsbHandler::DoCancel() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
201 |
// Cancel the MMC event handler |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
202 |
// |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
// @since 3.1 |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
204 |
// ============================================================================ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
205 |
void CWrtUsbHandler::DoCancel() |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
206 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
207 |
iFs.NotifyChangeCancel(); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
208 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
209 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
/* Scans drives and records a bit flag for those that exist and are |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
211 |
* suitable for installing widgets to. |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
*/ |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
213 |
TInt CWrtUsbHandler::ScanDrives( TInt& aDriveFlags ) |
11
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
214 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
// List all drives in the system |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
216 |
TDriveList driveList; |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
217 |
TInt error = iFs.DriveList( driveList ); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
218 |
if ( KErrNone == error ) |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
219 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
220 |
for ( TInt driveNumber = EDriveY; |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
221 |
driveNumber >= EDriveA; |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
driveNumber-- ) |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
223 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
224 |
// The drives that will be filtered out are the same ones that |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
// WidgetInstaller filters out in CWidgetUIHandler::SelectDriveL() |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
226 |
if ( (EDriveD == driveNumber) |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
227 |
|| !driveList[driveNumber] ) |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
229 |
// EDriveD is a temporary drive usually a RAM disk |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
continue; |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
231 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
233 |
TVolumeInfo volInfo; |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
234 |
if ( iFs.Volume( volInfo, driveNumber ) != KErrNone ) |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
// volume is not usable (e.g. no media card inserted) |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
continue; |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
if ( (volInfo.iDrive.iType == EMediaNotPresent) || |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
240 |
(volInfo.iDrive.iType == EMediaRom) || |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
241 |
(volInfo.iDrive.iType == EMediaRemote) || |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
242 |
(volInfo.iDrive.iDriveAtt & KDriveAttRom) || |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
243 |
(volInfo.iDrive.iDriveAtt & KDriveAttSubsted) ) |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
244 |
{ |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
245 |
// not a suitable widget install drive |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
246 |
continue; |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
247 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
248 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
249 |
// found a usable drive |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
250 |
aDriveFlags |= (1 << driveNumber); |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
251 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
253 |
} |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
254 |
|
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
255 |
return error; |
c8a366e56285
Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
256 |
} |
15
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
257 |
void CWrtUsbHandler::DeleteTimer() |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
258 |
{ |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
259 |
iCallBackTimer->Cancel(); |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
260 |
delete iCallBackTimer; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
261 |
iCallBackTimer = NULL; |
60c5402cb945
Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
11
diff
changeset
|
262 |
} |