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