ncdengine/provider/server/src/ncdnodeinstallimpl.cpp
branchRCL_3
changeset 11 3ba40be8e484
parent 0 ba25891c3a9e
equal deleted inserted replaced
9:51c0f5edf5ef 11:3ba40be8e484
     1 /*
     1 /*
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   342         iInstalled = ETrue;
   342         iInstalled = ETrue;
   343         DLTRACE(("Dependency has already been installed, setting iInstalled to ETrue"));
   343         DLTRACE(("Dependency has already been installed, setting iInstalled to ETrue"));
   344         }
   344         }
   345 
   345 
   346     
   346     
   347     if ( iInstalledContent ) 
   347     // Identifier might be Null
   348         {
   348     if ( iInstalledContent && iInstalledContent->ApplicationUid() != TUid::Null() ) 
   349         DASSERT( iInstalledContent->ApplicationUid() != TUid::Null() );
   349         {
       
   350         
       
   351          DASSERT( iInstalledContent->ApplicationUid() != TUid::Null() );
   350         
   352         
   351         // Disable launching if protocol says so. 
   353         // Disable launching if protocol says so. 
   352         // By default apps defined in content info are launchable
   354         // By default apps defined in content info are launchable
   353         iInstalledContent->SetLaunchable( iLaunchable );
   355         iInstalledContent->SetLaunchable( iLaunchable );
   354         
   356         
   540         }
   542         }
   541     DLTRACEOUT(("All installed"));
   543     DLTRACEOUT(("All installed"));
   542     return ETrue;
   544     return ETrue;
   543     }
   545     }
   544 
   546 
   545 
       
   546 // ---------------------------------------------------------------------------
   547 // ---------------------------------------------------------------------------
   547 // 
   548 // 
   548 // ---------------------------------------------------------------------------
   549 // ---------------------------------------------------------------------------
   549 //  
   550 //  
   550 TBool CNcdNodeInstall::InternalizeContentInfoL()
   551 TBool CNcdNodeInstall::InternalizeContentInfoL()
   559     
   560     
   560     const CNcdNodeContentInfo* info = NULL;
   561     const CNcdNodeContentInfo* info = NULL;
   561     TRAPD( err, info = &iMetadata.ContentInfoL() );
   562     TRAPD( err, info = &iMetadata.ContentInfoL() );
   562     
   563     
   563     TBool installed = EFalse;
   564     TBool installed = EFalse;
   564     if ( err == KErrNone && info->Uid() != TUid::Null() ) 
   565 
   565         {
   566     // Either UID or Identifier exists, we can continue here
   566         DLINFO(("Uid: %x", info->Uid().iUid ));
   567     if ( err == KErrNone && ( info->Uid() != TUid::Null()|| info->Identifier().Length() != 0 ) ) 
   567         TNcdApplicationStatus status = 
   568         {
   568             CNcdProviderUtils::IsApplicationInstalledL(
   569         TNcdApplicationStatus status = ENcdApplicationNotInstalled;
   569                 info->Uid(), 
   570         
   570                 info->Version() );
   571         if (info->MimeType().Compare( KMimeTypeMatchWidget ) == 0 && info->Identifier().Length() != 0  )
       
   572             {
       
   573             status = CNcdProviderUtils::IsWidgetInstalledL(
       
   574                     info->Identifier(), 
       
   575                     info->Version() );
       
   576             }
       
   577         else if ( info->Uid() != TUid::Null() ) 
       
   578             {
       
   579             DLINFO(("Uid: %x", info->Uid().iUid ));
       
   580             status = 
       
   581                 CNcdProviderUtils::IsApplicationInstalledL(
       
   582                                    info->Uid(), 
       
   583                                    info->Version() );
       
   584             }
   571         
   585         
   572         // Application can be older version for it to be considered installed
   586         // Application can be older version for it to be considered installed
   573         // Upgrade will be available for the user
   587         // Upgrade will be available for the user
   574         installed = status != ENcdApplicationNotInstalled;
   588         installed = status != ENcdApplicationNotInstalled;
   575 
   589 
   576         delete iInstalledContent;
   590         delete iInstalledContent;
   577         iInstalledContent = NULL;
   591         iInstalledContent = NULL;
   578 
   592 
   579         iInstalled = installed;    
   593         iInstalled = installed;    
   580         iLaunchable = installed;
   594         iLaunchable = installed;
   581                             
   595                                         
   582         if ( installed ) 
   596         if ( installed ) 
   583             {
   597             {
   584             DLTRACE(("Application installed"));
   598             DLTRACE(("Application installed"));
   585             CNcdExtendedInstallInfo* install = CNcdExtendedInstallInfo::NewLC();
   599             CNcdExtendedInstallInfo* install = CNcdExtendedInstallInfo::NewLC();
   586             install->SetApplicationUid( info->Uid() );
   600 
   587             
   601             if (info->MimeType().Compare( KMimeTypeMatchWidget ) == 0 )
   588             // This ensures that CNcdInstalledApplication actually checks the 
   602                 {                          
   589             // application's version number when it checks if it's installed
   603                 install->SetApplicationUid(CNcdProviderUtils::WidgetUidL(info->Identifier()));
   590             // or not
   604                 }
   591             install->SetUriExists( ETrue );
   605             else
   592 
   606                 {
   593             // This will be used to determine whether the app is actually installed
   607                 install->SetApplicationUid( info->Uid() );
   594             // or not
   608                 }
   595             install->SetApplicationVersionL( info->Version() );
   609             
   596             install->SetLaunchable( ETrue );
   610              // This ensures that CNcdInstalledApplication actually checks the 
   597             
   611              // application's version number when it checks if it's installed
   598             // don't set because it can mess upgrade handling in 
   612              // or not
   599             // CNcdNodeMetadata::HandleContentUpgradeL
   613              install->SetUriExists( ETrue );
   600             iContentVersion = TCatalogsVersion();
   614 
   601 
   615              // This will be used to determine whether the app is actually installed
   602             iInstalledContent = install;
   616              // or not
   603             CleanupStack::Pop( install );
   617              install->SetApplicationVersionL( info->Version() );
   604             }
   618              install->SetLaunchable( ETrue );
   605         }
   619 
       
   620              // don't set because it can mess upgrade handling in 
       
   621              // CNcdNodeMetadata::HandleContentUpgradeL
       
   622               iContentVersion = TCatalogsVersion();
       
   623 
       
   624               iInstalledContent = install;
       
   625               CleanupStack::Pop( install );
       
   626               }
       
   627         
       
   628             }
   606     return installed;
   629     return installed;
   607     }
   630     }
   608 
       
   609 
   631 
   610 // ---------------------------------------------------------------------------
   632 // ---------------------------------------------------------------------------
   611 // Content version getter
   633 // Content version getter
   612 // ---------------------------------------------------------------------------
   634 // ---------------------------------------------------------------------------
   613 //  
   635 //