1 /* |
1 // |
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
2 // ============================================================================ |
3 * All rights reserved. |
3 // Name : WidgetMMCHandler.cpp |
4 * This component and the accompanying materials are made available |
4 // Part of : SW Installer UIs / WidgetInstallerUI |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 // |
6 * which accompanies this distribution, and is available |
6 // Description: Handle notifications of MMC events. |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 // |
8 * |
8 // |
9 * Initial Contributors: |
9 // Version : 3.1 |
10 * Nokia Corporation - initial contribution. |
10 // |
11 * |
11 // Copyright © 2006 Nokia Corporation. |
12 * Contributors: |
12 // This material, including documentation and any related |
13 * |
13 // computer programs, is protected by copyright controlled by |
14 * Description: Handle notifications of MMC events. |
14 // Nokia Corporation. All rights are reserved. Copying, |
15 * |
15 // including reproducing, storing, adapting or translating, any |
16 * |
16 // or all of this material requires the prior written consent of |
17 * |
17 // Nokia Corporation. This material also contains confidential |
18 */ |
18 // information which may not be disclosed to others without the |
19 |
19 // prior written consent of Nokia Corporation. |
|
20 // ============================================================================== |
|
21 /// |
|
22 |
|
23 // INCLUDE FILES |
20 #include "WidgetMMCHandler.h" |
24 #include "WidgetMMCHandler.h" |
21 #include "WidgetRegistry.h" |
25 #include "WidgetRegistry.h" |
22 |
26 |
23 // CONSTANTS |
27 // CONSTANTS |
24 LOG_NAMES( "widreg", "widrmmc.txt" ) |
28 LOG_NAMES( "widreg", "widrmmc.txt" ) |
113 void CWidgetMMCHandler::RunL() |
117 void CWidgetMMCHandler::RunL() |
114 { |
118 { |
115 LOG_OPEN; |
119 LOG_OPEN; |
116 LOG1( "MMC notification status %d", iStatus.Int() ); |
120 LOG1( "MMC notification status %d", iStatus.Int() ); |
117 |
121 |
118 if ( iStatus == KErrNone ) |
122 TInt status = iStatus.Int(); |
|
123 |
|
124 // Request the notification before scanning |
|
125 iFs.NotifyChange( ENotifyDisk, iStatus ); |
|
126 SetActive(); |
|
127 |
|
128 if ( status == KErrNone ) |
119 { |
129 { |
120 TInt driveFlags = 0; |
130 TInt driveFlags = 0; |
121 TInt deltaDriveFlags = 0; |
131 TInt deltaDriveFlags = 0; |
122 if ( KErrNone == ScanDrives( driveFlags ) ) |
132 if ( KErrNone == ScanDrives( driveFlags ) ) |
123 { |
133 { |
129 iDriveFlags = driveFlags; |
139 iDriveFlags = driveFlags; |
130 } |
140 } |
131 } |
141 } |
132 LOG( "MMC notification done" ); |
142 LOG( "MMC notification done" ); |
133 LOG_CLOSE; |
143 LOG_CLOSE; |
134 |
|
135 iFs.NotifyChange( ENotifyDisk, iStatus ); |
|
136 SetActive(); |
|
137 } |
144 } |
138 |
145 |
139 // ============================================================================ |
146 // ============================================================================ |
140 // CWidgetMMCHandler::RunError() |
147 // CWidgetMMCHandler::RunError() |
141 // Ignore errors from RunL. |
148 // Ignore errors from RunL. |