contentstorage/srvsrc/casrv.cpp
changeset 109 e0aa398e6810
parent 103 b99b84bcd2d1
--- a/contentstorage/srvsrc/casrv.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/srvsrc/casrv.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -18,13 +18,15 @@
 #include <sqldb.h>
 #include <eikenv.h>
 #include <eikappui.h>
+
 #include "casrv.h"
 #include "casrvdef.h"
 #include "casrvsession.h"
 #include "casrvengutils.h"
 #include "castorageproxy.h"
 #include "casrvmanager.h"
-#include "caprogressnotifier.h"
+#include "cabackupnotifier.h"
+ 
 
 // ==================== LOCAL FUNCTIONS ====================
 
@@ -78,6 +80,7 @@
                 }
             }
         }
+
     // Let the caller know how it went.
     RProcess::Rendezvous( err );
     if( !err )
@@ -117,6 +120,7 @@
     // Base class would do it for us but that's too late - our sessions
     // call the server back (SessionClosed, RemoveContainer, etc.).
     Cancel();
+    delete iBackupNotifier;
     CSession2* session;
     iSessionIter.SetToFirst();
     while( ( session = iSessionIter++ ) != NULL )
@@ -124,8 +128,8 @@
         delete session;
         }
     delete iSrvManager;
+    iSoftwareRegistry.Close();
     delete iSrvEngUtils;
-    delete iProgressNotifier;
     delete iStorageProxy;
     }
 
@@ -156,8 +160,9 @@
     iSessionCount = 0;
     iStorageProxy = CCaStorageProxy::NewL();
     iSrvEngUtils = CCaSrvEngUtils::NewL();
-    iProgressNotifier = CCaProgressNotifier::NewL( *iStorageProxy );
-    iSrvManager = CCaSrvManager::NewL( *iStorageProxy, iSrvEngUtils );
+    User::LeaveIfError( iSoftwareRegistry.Connect() );
+    iSrvManager = CCaSrvManager::NewL( *iStorageProxy,
+        &iSoftwareRegistry, iSrvEngUtils);
     TInt errCode = iSrvManager->LoadOperationErrorCodeL();
     if( KSqlErrNotDb <= errCode && errCode <= KSqlErrGeneral )
         {
@@ -166,8 +171,10 @@
         delete iSrvManager;
         iSrvManager = NULL;
         iStorageProxy->LoadDataBaseFromRomL();
-        iSrvManager = CCaSrvManager::NewL( *iStorageProxy, iSrvEngUtils );
+        iSrvManager = CCaSrvManager::NewL( *iStorageProxy,
+            &iSoftwareRegistry, iSrvEngUtils );
         }
+    iBackupNotifier = CCaBackupNotifier::NewL( iStorageProxy );
     }
 
 // ---------------------------------------------------------