20 #include "castoragefactory.h" |
20 #include "castoragefactory.h" |
21 #include "cainnerentry.h" |
21 #include "cainnerentry.h" |
22 #include "cainnerquery.h" |
22 #include "cainnerquery.h" |
23 #include "caarraycleanup.inl" |
23 #include "caarraycleanup.inl" |
24 #include "calocalizationentry.h" |
24 #include "calocalizationentry.h" |
25 #include "cadef.h" |
|
26 #include "casrvsession.h" |
25 #include "casrvsession.h" |
27 |
26 |
28 |
27 |
29 |
28 |
30 // --------------------------------------------------------------------------- |
29 // --------------------------------------------------------------------------- |
99 |
98 |
100 // --------------------------------------------------------------------------- |
99 // --------------------------------------------------------------------------- |
101 // |
100 // |
102 // --------------------------------------------------------------------------- |
101 // --------------------------------------------------------------------------- |
103 // |
102 // |
104 EXPORT_C void CCaStorageProxy::AddL( CCaInnerEntry* aEntry, TBool aUpdate ) |
103 EXPORT_C void CCaStorageProxy::AddL( CCaInnerEntry* aEntry, |
|
104 TBool aUpdate, |
|
105 TItemAppearance aItemAppearanceChange ) |
105 { |
106 { |
106 TChangeType changeType = EAddChangeType; |
107 TChangeType changeType = EAddChangeType; |
107 RArray<TInt> parentArray; |
108 RArray<TInt> parentArray; |
108 CleanupClosePushL( parentArray ); |
109 CleanupClosePushL( parentArray ); |
|
110 |
109 if( aEntry->GetId() > 0 ) |
111 if( aEntry->GetId() > 0 ) |
110 { |
112 { |
111 changeType = EUpdateChangeType; |
113 changeType = EUpdateChangeType; |
112 RArray<TInt> id; |
114 RArray<TInt> id; |
113 CleanupClosePushL( id ); |
115 CleanupClosePushL( id ); |
114 id.AppendL( aEntry->GetId() ); |
116 id.AppendL( aEntry->GetId() ); |
115 iStorage->GetParentsIdsL( id, parentArray ); |
117 iStorage->GetParentsIdsL( id, parentArray ); |
116 CleanupStack::PopAndDestroy( &id ); |
118 CleanupStack::PopAndDestroy( &id ); |
117 } |
119 } |
|
120 |
|
121 if( aItemAppearanceChange==EItemDisappeared ) |
|
122 { |
|
123 changeType = ERemoveChangeType; |
|
124 } |
|
125 else if( aItemAppearanceChange==EItemAppeared ) |
|
126 { |
|
127 changeType = EAddChangeType; |
|
128 } |
|
129 |
118 iStorage->AddL( aEntry, aUpdate ); |
130 iStorage->AddL( aEntry, aUpdate ); |
119 for( TInt i = 0; i < iHandlerNotifier.Count(); i++ ) |
131 for( TInt i = 0; i < iHandlerNotifier.Count(); i++ ) |
120 { |
132 { |
121 iHandlerNotifier[i]->EntryChanged( aEntry, changeType, parentArray ); |
133 iHandlerNotifier[i]->EntryChanged( aEntry, changeType, parentArray ); |
122 } |
134 } |