iaupdate/IAD/engine/controller/src/iaupdatenodeimpl.cpp
branchRCL_3
changeset 18 3ba40be8e484
parent 0 ba25891c3a9e
child 33 8110bf1194d1
child 65 7333d7932ef7
equal deleted inserted replaced
15:51c0f5edf5ef 18:3ba40be8e484
    18 
    18 
    19 #include <ncdnode.h>
    19 #include <ncdnode.h>
    20 #include <ncdnodepurchase.h>
    20 #include <ncdnodepurchase.h>
    21 #include <ncdnodedownload.h>
    21 #include <ncdnodedownload.h>
    22 #include <ncdnodeinstall.h>
    22 #include <ncdnodeinstall.h>
       
    23 #include <ncdnodecontentinfo.h>
    23 
    24 
    24 #include "iaupdatenodeimpl.h"
    25 #include "iaupdatenodeimpl.h"
    25 #include "iaupdatenodeobserver.h"
    26 #include "iaupdatenodeobserver.h"
    26 #include "iaupdatenodedependencyimpl.h"
    27 #include "iaupdatenodedependencyimpl.h"
    27 #include "iaupdatenodedetails.h"
    28 #include "iaupdatenodedetails.h"
    28 #include "iaupdatecontrollerimpl.h"
    29 #include "iaupdatecontrollerimpl.h"
    29 #include "iaupdateutils.h"
    30 #include "iaupdateutils.h"
    30 #include "iaupdatecontentoperationmanager.h"
    31 #include "iaupdatecontentoperationmanager.h"
       
    32 #include "iaupdateprotocolconsts.h"
    31 #include "iaupdatedebug.h"
    33 #include "iaupdatedebug.h"
       
    34 
    32 
    35 
    33 
    36 
    34 // -----------------------------------------------------------------------------
    37 // -----------------------------------------------------------------------------
    35 // CIAUpdateNode::NewLC
    38 // CIAUpdateNode::NewLC
    36 // Two-phased constructor.
    39 // Two-phased constructor.
   148 // 
   151 // 
   149 // ---------------------------------------------------------------------------
   152 // ---------------------------------------------------------------------------
   150 //    
   153 //    
   151 MIAUpdateNode::TPackageType CIAUpdateNode::Type() const
   154 MIAUpdateNode::TPackageType CIAUpdateNode::Type() const
   152     {
   155     {
       
   156     MIAUpdateNode::TPackageType packageType;
       
   157     if ( Mime().Compare( IAUpdateProtocolConsts::KMimeWidget ) == 0 )
       
   158         {
       
   159         packageType = MIAUpdateNode::EPackageTypeWidget;
       
   160         }
       
   161     else
       
   162         {
       
   163         packageType = Details().ContentType();
       
   164         }
   153     IAUPDATE_TRACE_1("[IAUPDATE] CIAUpdateNode::Type() = %d", 
   165     IAUPDATE_TRACE_1("[IAUPDATE] CIAUpdateNode::Type() = %d", 
   154                      Details().ContentType());
   166                              packageType );
   155     return Details().ContentType();
   167     return packageType;
   156     }
   168     }
   157 
   169 
   158 
   170 
   159 // ---------------------------------------------------------------------------
   171 // ---------------------------------------------------------------------------
   160 // CIAUpdateNode::IsSelfUpdate
   172 // CIAUpdateNode::IsSelfUpdate
   756 // ---------------------------------------------------------------------------
   768 // ---------------------------------------------------------------------------
   757 //
   769 //
   758 void CIAUpdateNode::AddDependantL( CIAUpdateNode& aDependantNode ) 
   770 void CIAUpdateNode::AddDependantL( CIAUpdateNode& aDependantNode ) 
   759     {
   771     {
   760 	IAUPDATE_TRACE("[IAUPDATE] CIAUpdateNode::AddDependantL() begin");
   772 	IAUPDATE_TRACE("[IAUPDATE] CIAUpdateNode::AddDependantL() begin");
       
   773 	
   761 
   774 
   762 	for ( TInt i = 0; i < iDependants.Count(); ++i )
   775 	for ( TInt i = 0; i < iDependants.Count(); ++i )
   763 	    {
   776 	    {
   764 	    CIAUpdateNode* node( iDependants[ i ] );
   777 	    CIAUpdateNode* node( iDependants[ i ] );
   765 	    if ( node->Uid() == aDependantNode.Uid() )
   778 	    if ( node->Mime().Compare( IAUpdateProtocolConsts::KMimeWidget) == 0 )
   766 	        {
   779 	        {
   767 	        // Corresponding node is already in the array.
   780 	        if ( node->Identifier() == aDependantNode.Identifier() )
   768 	        return;
   781 	            {
       
   782 	            // Corresponding node is already in the array.
       
   783 	            return;
       
   784 	            }
       
   785 	        }
       
   786 	    else 
       
   787 	        {
       
   788 	        if ( node->Uid() == aDependantNode.Uid() )
       
   789 	            {
       
   790 	            // Corresponding node is already in the array.
       
   791 	            return;
       
   792 	            }
   769 	        }
   793 	        }
   770 	    }
   794 	    }
   771 
   795 
   772 	iDependants.AppendL( &aDependantNode );
   796 	iDependants.AppendL( &aDependantNode );
   773 
   797 
   896 TBool CIAUpdateNode::IsInstalledL() const
   920 TBool CIAUpdateNode::IsInstalledL() const
   897     {
   921     {
   898     IAUPDATE_TRACE("[IAUPDATE] CIAUpdateNode::IsInstalledL() begin");
   922     IAUPDATE_TRACE("[IAUPDATE] CIAUpdateNode::IsInstalledL() begin");
   899 
   923 
   900     TIAUpdateVersion installedVersion;
   924     TIAUpdateVersion installedVersion;
   901     TBool installed( IAUpdateUtils::IsAppInstalledL( Uid(), installedVersion ) );
   925 
       
   926     TBool installed = EFalse;
       
   927         
       
   928     if ( Mime().Compare( IAUpdateProtocolConsts::KMimeWidget ) == 0 )
       
   929         {
       
   930         installed = IAUpdateUtils::IsWidgetInstalledL( Identifier(), installedVersion );
       
   931         }
       
   932     else 
       
   933         {
       
   934         installed = IAUpdateUtils::IsAppInstalledL( Uid(), installedVersion );
       
   935         }    
       
   936 		
   902     IAUPDATE_TRACE_3("CIAUpdateNode::IsInstalledL() Installed version  %d.%d.%d", 
   937     IAUPDATE_TRACE_3("CIAUpdateNode::IsInstalledL() Installed version  %d.%d.%d", 
   903             installedVersion.iMajor, 
   938             installedVersion.iMajor, 
   904             installedVersion.iMinor, 
   939             installedVersion.iMinor, 
   905             installedVersion.iBuild );
   940             installedVersion.iBuild );
   906     IAUPDATE_TRACE_3("CIAUpdateNode::IsInstalledL() Metadata version  %d.%d.%d", 
   941     IAUPDATE_TRACE_3("CIAUpdateNode::IsInstalledL() Metadata version  %d.%d.%d",