22 #include "casrvdef.h" |
22 #include "casrvdef.h" |
23 #include "casrvsession.h" |
23 #include "casrvsession.h" |
24 #include "casrvengutils.h" |
24 #include "casrvengutils.h" |
25 #include "castorageproxy.h" |
25 #include "castorageproxy.h" |
26 #include "casrvmanager.h" |
26 #include "casrvmanager.h" |
27 #include "caprogressnotifier.h" |
|
28 |
27 |
29 // ==================== LOCAL FUNCTIONS ==================== |
28 // ==================== LOCAL FUNCTIONS ==================== |
30 |
29 |
31 /** |
30 /** |
32 * Create a server. |
31 * Create a server. |
154 void CCaSrv::ConstructL() |
153 void CCaSrv::ConstructL() |
155 { |
154 { |
156 iSessionCount = 0; |
155 iSessionCount = 0; |
157 iStorageProxy = CCaStorageProxy::NewL(); |
156 iStorageProxy = CCaStorageProxy::NewL(); |
158 iSrvEngUtils = CCaSrvEngUtils::NewL(); |
157 iSrvEngUtils = CCaSrvEngUtils::NewL(); |
159 iProgressNotifier = CCaProgressNotifier::NewL( *iStorageProxy ); |
158 User::LeaveIfError( iSoftwareRegistry.Connect() ); |
160 iSrvManager = CCaSrvManager::NewL( *iStorageProxy, iSrvEngUtils ); |
159 iSrvManager = CCaSrvManager::NewL( *iStorageProxy, |
|
160 &iSoftwareRegistry, iSrvEngUtils); |
161 TInt errCode = iSrvManager->LoadOperationErrorCodeL(); |
161 TInt errCode = iSrvManager->LoadOperationErrorCodeL(); |
162 if( KSqlErrNotDb <= errCode && errCode <= KSqlErrGeneral ) |
162 if( KSqlErrNotDb <= errCode && errCode <= KSqlErrGeneral ) |
163 { |
163 { |
164 //problem in loading one of plugins, probably data base is corrupted |
164 //problem in loading one of plugins, probably data base is corrupted |
165 //lets load it from ROM and try again |
165 //lets load it from ROM and try again |
166 delete iSrvManager; |
166 delete iSrvManager; |
167 iSrvManager = NULL; |
167 iSrvManager = NULL; |
168 iStorageProxy->LoadDataBaseFromRomL(); |
168 iStorageProxy->LoadDataBaseFromRomL(); |
169 iSrvManager = CCaSrvManager::NewL( *iStorageProxy, iSrvEngUtils ); |
169 iSrvManager = CCaSrvManager::NewL( *iStorageProxy, |
|
170 &iSoftwareRegistry, iSrvEngUtils ); |
170 } |
171 } |
171 } |
172 } |
172 |
173 |
173 // --------------------------------------------------------- |
174 // --------------------------------------------------------- |
174 // |
175 // |