14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #include <liwcommon.h> |
19 #include <LiwCommon.h> |
20 #include <s32mem.h> |
20 #include <S32MEM.h> |
21 #include <escapeutils.h> |
21 #include <EscapeUtils.h> |
22 |
22 |
23 #include "cpserverdatamanager.h" |
23 #include "cpserverdatamanager.h" |
24 #include "ccontentmap.h" |
24 #include "ccontentmap.h" |
25 #include "cpublisherregistrymap.h" |
25 #include "cpublisherregistrymap.h" |
26 #include "cpstorage.h" |
26 #include "cpstorage.h" |
130 |
130 |
131 return id; |
131 return id; |
132 } |
132 } |
133 |
133 |
134 // --------------------------------------------------------------------------- |
134 // --------------------------------------------------------------------------- |
135 // |
135 // |
136 // --------------------------------------------------------------------------- |
|
137 // |
|
138 void CCPDataManager::AddNonPersistentDataL( const CCPLiwMap* aMap ) |
|
139 { |
|
140 CLiwDefaultList* notificationList = CLiwDefaultList::NewLC( ); |
|
141 BuildChangeInfoForAddL( aMap, notificationList ); |
|
142 HandleChangeL( notificationList ); |
|
143 CleanupStack::PopAndDestroy( notificationList ); |
|
144 } |
|
145 |
|
146 // --------------------------------------------------------------------------- |
|
147 // |
|
148 // --------------------------------------------------------------------------- |
136 // --------------------------------------------------------------------------- |
149 // |
137 // |
150 void CCPDataManager::GetListL( const CCPLiwMap& aMap, |
138 void CCPDataManager::GetListL( const CCPLiwMap& aMap, |
151 CLiwGenericParamList& aOutParamList ) |
139 CLiwGenericParamList& aOutParamList ) |
152 { |
140 { |
508 aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) ); |
496 aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) ); |
509 CleanupStack::PopAndDestroy( changeInfoMap ); |
497 CleanupStack::PopAndDestroy( changeInfoMap ); |
510 } |
498 } |
511 |
499 |
512 // ----------------------------------------------------------------------------- |
500 // ----------------------------------------------------------------------------- |
513 // |
501 // |
514 // ----------------------------------------------------------------------------- |
502 // ----------------------------------------------------------------------------- |
515 // |
503 // |
516 void CCPDataManager::BuildChangeInfoForAddL( const CCPLiwMap* aMap, |
504 void CCPDataManager::CopyVariantL(const TDesC8& aKey, |
517 CLiwDefaultList* aChangeInfoList ) |
|
518 { |
|
519 CLiwDefaultMap* changeInfoMap = CLiwDefaultMap::NewLC(); |
|
520 |
|
521 CopyVariantL(KId, aMap, changeInfoMap ); |
|
522 CopyVariantL(KPublisherId, aMap, changeInfoMap ); |
|
523 CopyVariantL(KContentType, aMap, changeInfoMap ); |
|
524 CopyVariantL(KContentId, aMap, changeInfoMap ); |
|
525 CopyVariantL(KFlag, aMap, changeInfoMap ); |
|
526 CopyVariantL(KType, aMap, changeInfoMap ); |
|
527 CopyVariantL(KActionTrigger, aMap, changeInfoMap ); |
|
528 CopyVariantL(KDataMap, aMap, changeInfoMap ); |
|
529 CopyActionTrigger16L( aMap, changeInfoMap ); |
|
530 |
|
531 changeInfoMap->InsertL( KOperation, TLiwVariant( KOperationAdd ) ); |
|
532 |
|
533 aChangeInfoList->AppendL( TLiwVariant( changeInfoMap ) ); |
|
534 CleanupStack::PopAndDestroy( changeInfoMap ); |
|
535 } |
|
536 |
|
537 // ----------------------------------------------------------------------------- |
|
538 // |
|
539 // ----------------------------------------------------------------------------- |
|
540 // |
|
541 void CCPDataManager::CopyVariantL(const TDesC8& aKey, |
|
542 const CLiwMap* aInMap, CLiwDefaultMap* aOutMap ) |
505 const CLiwMap* aInMap, CLiwDefaultMap* aOutMap ) |
543 { |
506 { |
544 TLiwVariant variant; |
507 TLiwVariant variant; |
545 variant.PushL(); |
508 variant.PushL(); |
546 if ( aInMap->FindL( aKey, variant ) ) |
509 if ( aInMap->FindL( aKey, variant ) ) |