272 // Add element to correct place |
272 // Add element to correct place |
273 iStorageRoot.AppendChildL( settings ); |
273 iStorageRoot.AppendChildL( settings ); |
274 // reset error value |
274 // reset error value |
275 trapErr = KErrNone; |
275 trapErr = KErrNone; |
276 } |
276 } |
277 else if ( KErrNoMemory == trapErr ) |
277 |
278 { |
|
279 User::Leave(trapErr); |
|
280 } |
|
281 COMPONENT_TRACE( ( _L( "PSM Server - CPsmBackupStorage::UpdateBackupL() - Config count: %i" ), aConfigArray.Count() ) ); |
278 COMPONENT_TRACE( ( _L( "PSM Server - CPsmBackupStorage::UpdateBackupL() - Config count: %i" ), aConfigArray.Count() ) ); |
282 |
279 |
283 // Loop config array and update storage |
280 // Loop config array and update storage |
284 for ( TInt i = 0; i < aConfigArray.Count(); i++ ) |
281 for ( TInt i = 0; i < aConfigArray.Count(); i++ ) |
285 { |
282 { |
288 const TPsmsrvConfigInfo& configInfo = aConfigArray[i]; |
285 const TPsmsrvConfigInfo& configInfo = aConfigArray[i]; |
289 |
286 |
290 // Search set element from config and create new if not found |
287 // Search set element from config and create new if not found |
291 TXmlEngElement setItem; |
288 TXmlEngElement setItem; |
292 TRAP( trapErr, setItem = FindSetItemL( settings, configInfo.iConfigId ) ); |
289 TRAP( trapErr, setItem = FindSetItemL( settings, configInfo.iConfigId ) ); |
293 |
290 |
294 COMPONENT_TRACE( ( _L( "PSM Server - FindSetItemL() TRAP error - %d" ), trapErr ) ); |
291 // If not found, create new |
295 |
292 if ( KErrNotFound == trapErr && setItem.IsNull() ) |
296 if ( KErrNoMemory == trapErr && setItem.IsNull() ) |
|
297 { |
|
298 User::Leave(trapErr); |
|
299 } |
|
300 else if (KErrNoMemory == trapErr) |
|
301 { |
|
302 setItem.RemoveAttributeL( KPsmSetItemValue ); |
|
303 User::Leave(trapErr); |
|
304 } |
|
305 else if ( KErrNotFound == trapErr && setItem.IsNull() ) |
|
306 { |
293 { |
307 // First param indicates that cannot have childs, |
294 // First param indicates that cannot have childs, |
308 // second is the owner document and last is tag |
295 // second is the owner document and last is tag |
309 setItem = iStorageFile.CreateElementL( KPsmSetItem ); |
296 setItem = iStorageFile.CreateElementL( KPsmSetItem ); |
310 // Add key and type attributes as they cannot be updated later |
297 // Add key and type attributes as they cannot be updated later |