equal
deleted
inserted
replaced
31 #include "iaupdatenodedetails.h" |
31 #include "iaupdatenodedetails.h" |
32 #include "iaupdatecontrollerimpl.h" |
32 #include "iaupdatecontrollerimpl.h" |
33 #include "iaupdatecontentoperationmanager.h" |
33 #include "iaupdatecontentoperationmanager.h" |
34 #include "iaupdateutils.h" |
34 #include "iaupdateutils.h" |
35 #include "iaupdatectrlnodeconsts.h" |
35 #include "iaupdatectrlnodeconsts.h" |
|
36 #include "iaupdateprotocolconsts.h" |
36 #include "iaupdatedebug.h" |
37 #include "iaupdatedebug.h" |
37 #include "iaupdateprotocolconsts.h" |
38 |
|
39 |
|
40 |
38 |
41 |
39 |
42 |
40 // ----------------------------------------------------------------------------- |
43 // ----------------------------------------------------------------------------- |
41 // CIAUpdateBaseNode::CIAUpdateBaseNode |
44 // CIAUpdateBaseNode::CIAUpdateBaseNode |
42 // C++ default constructor can NOT contain any code, that |
45 // C++ default constructor can NOT contain any code, that |
100 MNcdNodeContentInfo* contentInfo = aNode->QueryInterfaceLC< MNcdNodeContentInfo >(); |
103 MNcdNodeContentInfo* contentInfo = aNode->QueryInterfaceLC< MNcdNodeContentInfo >(); |
101 if ( contentInfo ) |
104 if ( contentInfo ) |
102 { |
105 { |
103 iMime = contentInfo->MimeType().AllocL(); |
106 iMime = contentInfo->MimeType().AllocL(); |
104 iVersion.InternalizeL( contentInfo->Version() ); |
107 iVersion.InternalizeL( contentInfo->Version() ); |
105 iUid = contentInfo->Uid(); |
108 |
|
109 //Initialize iUid or iIdentifier according to the mime-type |
|
110 iUid = KNullUid; |
|
111 |
|
112 if ( iMime->Compare( IAUpdateProtocolConsts::KMimeWidget ) == 0 ) |
|
113 { |
|
114 iIdentifier = contentInfo->Identifier().AllocL(); |
|
115 } |
|
116 else |
|
117 { |
|
118 iUid = contentInfo->Uid(); |
|
119 iIdentifier = KNullDesC().AllocL(); |
|
120 } |
|
121 |
106 // Release content info. |
122 // Release content info. |
107 // So, we can later check if it still exists and then get |
123 // So, we can later check if it still exists and then get |
108 // new one if it exists. |
124 // new one if it exists. |
109 CleanupStack::PopAndDestroy( contentInfo ); |
125 CleanupStack::PopAndDestroy( contentInfo ); |
110 contentInfo = NULL; |
126 contentInfo = NULL; |
142 delete iMetaNamespace; |
158 delete iMetaNamespace; |
143 delete iMetaId; |
159 delete iMetaId; |
144 delete iName; |
160 delete iName; |
145 delete iDescription; |
161 delete iDescription; |
146 delete iMime; |
162 delete iMime; |
|
163 delete iIdentifier; |
147 delete iDetails; |
164 delete iDetails; |
148 |
165 |
149 IAUPDATE_TRACE("[IAUPDATE] CIAUpdateBaseNode::~CIAUpdateBaseNode() end"); |
166 IAUPDATE_TRACE("[IAUPDATE] CIAUpdateBaseNode::~CIAUpdateBaseNode() end"); |
150 } |
167 } |
151 |
168 |
189 const TUid& CIAUpdateBaseNode::Uid() const |
206 const TUid& CIAUpdateBaseNode::Uid() const |
190 { |
207 { |
191 IAUPDATE_TRACE_1("[IAUPDATE] CIAUpdateBaseNode::Uid() = %x", iUid); |
208 IAUPDATE_TRACE_1("[IAUPDATE] CIAUpdateBaseNode::Uid() = %x", iUid); |
192 return iUid; |
209 return iUid; |
193 } |
210 } |
194 |
211 |
|
212 |
|
213 // --------------------------------------------------------------------------- |
|
214 // CIAUpdateBaseNode::Identifier |
|
215 // |
|
216 // --------------------------------------------------------------------------- |
|
217 // |
|
218 const TDesC& CIAUpdateBaseNode::Identifier() const |
|
219 { |
|
220 return *iIdentifier; |
|
221 } |
195 |
222 |
196 // --------------------------------------------------------------------------- |
223 // --------------------------------------------------------------------------- |
197 // CIAUpdateBaseNode::Name |
224 // CIAUpdateBaseNode::Name |
198 // |
225 // |
199 // --------------------------------------------------------------------------- |
226 // --------------------------------------------------------------------------- |
367 // Nothing to do here because install status is automatically set into the |
394 // Nothing to do here because install status is automatically set into the |
368 // purchase history when normal nodes are used. |
395 // purchase history when normal nodes are used. |
369 // Child classes may have their own implementation here. |
396 // Child classes may have their own implementation here. |
370 return; |
397 return; |
371 } |
398 } |
|
399 |
|
400 // --------------------------------------------------------------------------- |
|
401 // CIAUpdateBaseNode::Mime |
|
402 // |
|
403 // --------------------------------------------------------------------------- |
|
404 // |
|
405 const TDesC& CIAUpdateBaseNode::Mime() const |
|
406 { |
|
407 return *iMime; |
|
408 } |
|
409 |
372 |
410 |
373 |
411 |
374 // --------------------------------------------------------------------------- |
412 // --------------------------------------------------------------------------- |
375 // Public functions |
413 // Public functions |
376 // --------------------------------------------------------------------------- |
414 // --------------------------------------------------------------------------- |
433 // |
471 // |
434 // --------------------------------------------------------------------------- |
472 // --------------------------------------------------------------------------- |
435 // |
473 // |
436 TBool CIAUpdateBaseNode::Equals( const CIAUpdateBaseNode& aNode ) const |
474 TBool CIAUpdateBaseNode::Equals( const CIAUpdateBaseNode& aNode ) const |
437 { |
475 { |
438 if ( aNode.MetaNamespace() == MetaNamespace() |
476 TBool equals = EFalse; |
439 && aNode.MetaId() == MetaId() |
477 if ( iMime->Compare( IAUpdateProtocolConsts::KMimeWidget ) == 0 ) |
440 || ( aNode.Uid() == Uid() |
478 { |
441 && aNode.Version() == Version() |
479 if ( aNode.MetaNamespace() == MetaNamespace() |
442 && aNode.iMime->Match( IAUpdateProtocolConsts::KMimeServicePackPattern()) == KErrNotFound ) ) |
480 && aNode.MetaId() == MetaId() |
443 { |
481 || ( aNode.Identifier() == Identifier() |
444 return ETrue; |
482 && aNode.Version() == Version() ) ) |
445 } |
483 { |
446 else |
484 equals = ETrue; |
447 { |
485 } |
448 return EFalse; |
486 } |
449 } |
487 else |
|
488 { |
|
489 if ( aNode.MetaNamespace() == MetaNamespace() |
|
490 && aNode.MetaId() == MetaId() |
|
491 || ( aNode.Uid() == Uid() |
|
492 && aNode.Version() == Version() |
|
493 && aNode.iMime->Match( IAUpdateProtocolConsts::KMimeServicePackPattern()) == KErrNotFound ) ) |
|
494 { |
|
495 equals = ETrue; |
|
496 } |
|
497 } |
|
498 return equals; |
450 } |
499 } |
451 |
500 |
452 |
501 |
453 // --------------------------------------------------------------------------- |
502 // --------------------------------------------------------------------------- |
454 // CIAUpdateBaseNode::ForceHidden |
503 // CIAUpdateBaseNode::ForceHidden |