locationcentre/lcserver/src/lcregistry.cpp
branchRCL_3
changeset 9 91123d004e8f
parent 0 522cd55cc3d7
equal deleted inserted replaced
8:41042d2af523 9:91123d004e8f
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // SYSTEM INCLUDES
    19 // SYSTEM INCLUDES
    20 #include <PathInfo.h>
    20 #include <pathinfo.h>
    21 #include <apgcli.h>
    21 #include <apgcli.h>
    22 #include <documenthandler.h>            // CDocumentHandler
    22 #include <DocumentHandler.h>            // CDocumentHandler
    23 #include <pathinfo.h>
    23 #include <pathinfo.h>
    24 
    24 
    25 // USER INCLUDES
    25 // USER INCLUDES
    26 #include "lcregistry.h"
    26 #include "lcregistry.h"
    27 #include "lcregistrationparser.h"
    27 #include "lcregistrationparser.h"
   348 												   regAppInfo );
   348 												   regAppInfo );
   349 			if ( lResult )
   349 			if ( lResult )
   350 				{
   350 				{
   351 				// Check if the Application suffered an Upgrade. If its an upgrade
   351 				// Check if the Application suffered an Upgrade. If its an upgrade
   352 				// then its equivalent to a new installation.
   352 				// then its equivalent to a new installation.
   353 				if ( IsAppUpgraded( regAppInfo->FileName()))
   353 				TFileName fileName = regAppInfo->FileName();
       
   354 				if ( IsAppUpgraded(fileName) )
   354 					{
   355 					{
   355 					// Remove the element from the Old array
   356 					// Remove the element from the Old array
   356 					TInt index = iAppInfoArray.Find( regAppInfo );
   357 					TInt index = iAppInfoArray.Find( regAppInfo );
   357 					CLcRegAppInfo* info = iAppInfoArray[index];
   358 					CLcRegAppInfo* info = iAppInfoArray[index];
   358 					iAppInfoArray.Remove( index );
   359 					iAppInfoArray.Remove( index );
   512 
   513 
   513 // ----------------------------------------------------------------------------
   514 // ----------------------------------------------------------------------------
   514 // CLcRegistry::IsInMMc
   515 // CLcRegistry::IsInMMc
   515 // ----------------------------------------------------------------------------
   516 // ----------------------------------------------------------------------------
   516 //
   517 //
   517 TBool CLcRegistry::IsInMMc( TFileName aFileName )
   518 TBool CLcRegistry::IsInMMc( TFileName& aFileName )
   518 	{
   519 	{
   519 	TBool lResult = EFalse;
   520 	TBool lResult = EFalse;
   520 	TParse parse;
   521 	TParse parse;
   521 	parse.Set(aFileName,NULL,NULL);
   522 	parse.Set(aFileName,NULL,NULL);
   522 	TPtrC lDrive = parse.Drive();
   523 	TPtrC lDrive = parse.Drive();
   538 
   539 
   539 // ----------------------------------------------------------------------------
   540 // ----------------------------------------------------------------------------
   540 // CLcRegistry::DoesApplicationExists
   541 // CLcRegistry::DoesApplicationExists
   541 // ----------------------------------------------------------------------------
   542 // ----------------------------------------------------------------------------
   542 //
   543 //
   543 TBool CLcRegistry::DoesApplicationExists( TFileName 		aFileName,
   544 TBool CLcRegistry::DoesApplicationExists( TFileName& 		aFileName,
   544 										  CLcRegAppInfo*& 	alcRegAppInfoPtr )
   545 										  CLcRegAppInfo*& 	alcRegAppInfoPtr )
   545 	{
   546 	{
   546 	// This function checks wheather registration info with same file name
   547 	// This function checks wheather registration info with same file name
   547 	// is present in the old list. If present then return ETrue or else EFalse.
   548 	// is present in the old list. If present then return ETrue or else EFalse.
   548 	TInt count = iAppInfoArray.Count();
   549 	TInt count = iAppInfoArray.Count();
   562 
   563 
   563 // ----------------------------------------------------------------------------
   564 // ----------------------------------------------------------------------------
   564 // CLcRegistry::CreateAppRegInfoL
   565 // CLcRegistry::CreateAppRegInfoL
   565 // ----------------------------------------------------------------------------
   566 // ----------------------------------------------------------------------------
   566 //
   567 //
   567 CLcRegAppInfo* CLcRegistry::CreateAppRegInfoL(  TFileName	aFileName )
   568 CLcRegAppInfo* CLcRegistry::CreateAppRegInfoL(  TFileName&	aFileName )
   568 	{
   569 	{
   569 	DEBUG( "+ CLcRegistry::CreateAppRegInfoL" );
   570 	DEBUG( "+ CLcRegistry::CreateAppRegInfoL" );
   570 
   571 
   571     CLcRegistrationParser* regParser = CLcRegistrationParser::NewL( iFs );
   572     CLcRegistrationParser* regParser = CLcRegistrationParser::NewL( iFs );
   572  	CleanupStack::PushL( regParser );
   573  	CleanupStack::PushL( regParser );
   911 
   912 
   912 // -----------------------------------------------------------------------------
   913 // -----------------------------------------------------------------------------
   913 // CLcRegistry::IsAppUpgraded
   914 // CLcRegistry::IsAppUpgraded
   914 // -----------------------------------------------------------------------------
   915 // -----------------------------------------------------------------------------
   915 //	
   916 //	
   916 TBool CLcRegistry::IsAppUpgraded( TFileName aFileName )
   917 TBool CLcRegistry::IsAppUpgraded( TFileName& aFileName )
   917 	{
   918 	{
   918 	DEBUG( "+ CLcRegistry::CheckforAppUpgrade(");
   919 	DEBUG( "+ CLcRegistry::CheckforAppUpgrade(");
   919 	
   920 	
   920 	// If filename is already there in the old list and presence
   921 	// If filename is already there in the old list and presence
   921 	// flag also true then check the time stamp between current file and old file
   922 	// flag also true then check the time stamp between current file and old file