14 * Description: Class for database import/export and maintenance |
14 * Description: Class for database import/export and maintenance |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 // INCLUDE FILES |
18 // INCLUDE FILES |
19 #include <driveinfo.h> |
|
20 |
|
21 #include "mdsmaintenanceengine.h" |
19 #include "mdsmaintenanceengine.h" |
22 #include "mdslogger.h" |
20 #include "mdslogger.h" |
23 #include "mdsmanipulationengine.h" |
21 #include "mdsmanipulationengine.h" |
24 #include "mdcserializationbuffer.h" |
22 #include "mdcserializationbuffer.h" |
25 #include "mdsimportexport.h" |
23 #include "mdsimportexport.h" |
281 CleanupClosePushL( fs ); |
279 CleanupClosePushL( fs ); |
282 TVolumeInfo volumeInfo; |
280 TVolumeInfo volumeInfo; |
283 User::LeaveIfError( fs.Volume( volumeInfo, EDriveC ) ); |
281 User::LeaveIfError( fs.Volume( volumeInfo, EDriveC ) ); |
284 MMdsPreferences::InsertL( KCMediaIdKey, MMdsPreferences::EPreferenceValueSet, |
282 MMdsPreferences::InsertL( KCMediaIdKey, MMdsPreferences::EPreferenceValueSet, |
285 (TUint32) volumeInfo.iUniqueID ); |
283 (TUint32) volumeInfo.iUniqueID ); |
286 |
|
287 TInt drive( -1 ); |
|
288 TInt massStorageError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ) ); |
|
289 if( massStorageError == KErrNone ) |
|
290 { |
|
291 TVolumeInfo massStorageVolumeInfo; |
|
292 massStorageError = fs.Volume( massStorageVolumeInfo, drive ); |
|
293 if( massStorageError == KErrNone ) |
|
294 { |
|
295 const TUint32 massStorageMediaId( massStorageVolumeInfo.iUniqueID ); |
|
296 massStorageError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive ); |
|
297 if( massStorageError == KErrNone ) |
|
298 { |
|
299 massStorageError = fs.Volume( massStorageVolumeInfo, drive ); |
|
300 // Update mass storage media id if the mass storage is not memory card |
|
301 if( massStorageError == KErrNone && |
|
302 massStorageVolumeInfo.iUniqueID != massStorageMediaId && |
|
303 massStorageMediaId != 0 ) |
|
304 { |
|
305 MMdsPreferences::InsertL( KMassStorageMediaIdKey, MMdsPreferences::EPreferenceValueSet, |
|
306 (TUint32) massStorageMediaId ); |
|
307 } |
|
308 } |
|
309 } |
|
310 } |
|
311 |
284 |
312 CleanupStack::PopAndDestroy( &fs ); |
285 CleanupStack::PopAndDestroy( &fs ); |
313 } |
286 } |
314 |
287 |