metadataengine/server/src/mdsmaintenanceengine.cpp
branchRCL_3
changeset 22 29d87345eaeb
parent 21 85f623e1ef41
--- a/metadataengine/server/src/mdsmaintenanceengine.cpp	Wed Sep 01 12:24:24 2010 +0100
+++ b/metadataengine/server/src/mdsmaintenanceengine.cpp	Tue Sep 14 22:10:25 2010 +0300
@@ -120,7 +120,7 @@
     TBool isValid(EFalse);
     TRAPD(err, isValid = iMaintenance->ValidateL( ));
     
-    if(err == KErrCorrupt)
+    if( err == KErrCorrupt )
         {
         DeleteDatabase();
         User::Leave( err );
@@ -174,11 +174,6 @@
 				User::Leave( schemaError );
 				}
 			}
-
-		if ( FailedImports() != 0 )
-  			{
-	       	User::Leave( KErrBadName );
-       		}
 		
 		// try to read default import file from C drive
        	TRAPD( err, ImportMetadataL( aManipulate, aSchema, KMdsDefaultImportFile ) );
@@ -188,6 +183,13 @@
        		// and ignore errors
        		TRAP_IGNORE( ImportMetadataL( aManipulate, aSchema, KMdsDefaultRomImportFile ) );
        		}
+
+#ifdef _DEBUG
+        if ( FailedImports() != 0 )
+            {
+            User::Leave( KErrBadName );
+            }
+#endif
        	
        	__LOG1( ELogAlways, "MDS DB tables created %d", 0 );
 
@@ -206,6 +208,12 @@
 			DeleteDatabase();
 			User::Leave( err );
         	}
+        
+        if( !iMaintenance->CheckForCorruptionL() )
+            {
+            DeleteDatabase();
+            User::Leave( KErrCorrupt );
+            }
         }
     __LOG1( ELogAlways, "CMdSMaintenanceEngine::InstallL complete: %d", 0 );
     }