installationservices/swi/source/swis/server/planner.cpp
branchRCL_3
changeset 65 7333d7932ef7
parent 34 741e5bba2bd1
child 66 8b7f4e561641
equal deleted inserted replaced
62:5cc91383ab1e 65:7333d7932ef7
   353  */
   353  */
   354 void CPlanner::CreateNewNodesL(RPointerArray<CSisRegistryPackage>& aProcessPackages, CUninstallationNode& aParentNode, RPointerArray<CSisRegistryPackage>& aPlannedPackages)
   354 void CPlanner::CreateNewNodesL(RPointerArray<CSisRegistryPackage>& aProcessPackages, CUninstallationNode& aParentNode, RPointerArray<CSisRegistryPackage>& aPlannedPackages)
   355 	{
   355 	{
   356 	// We are removing items from array (aProcessPackages)and thus require index 
   356 	// We are removing items from array (aProcessPackages)and thus require index 
   357 	// adjustment. But if loop run in reverse order there is no need to adjust the index
   357 	// adjustment. But if loop run in reverse order there is no need to adjust the index
   358 	CleanupResetAndDestroyPushL(aPlannedPackages);
       
   359 	for (TInt i = aProcessPackages.Count() - 1; i >= 0; --i)
   358 	for (TInt i = aProcessPackages.Count() - 1; i >= 0; --i)
   360 		{
   359 		{
   361 		// Ignore already added package
   360 		// Ignore already added package
   362 		if (IsInPlannedPackages(aPlannedPackages, *aProcessPackages[i]))
   361 		if (IsInPlannedPackages(aPlannedPackages, *aProcessPackages[i]))
   363 			{
   362 			{
   396 		aPlannedPackages.AppendL(aProcessPackages[i]);
   395 		aPlannedPackages.AppendL(aProcessPackages[i]);
   397 		// Ownership is transfered from aProcessPackages to aPlannedPackages
   396 		// Ownership is transfered from aProcessPackages to aPlannedPackages
   398 		aProcessPackages.Remove(i);
   397 		aProcessPackages.Remove(i);
   399 		CleanupStack::PopAndDestroy(&registryEntry);
   398 		CleanupStack::PopAndDestroy(&registryEntry);
   400 		}
   399 		}
   401 	CleanupStack::Pop(&aPlannedPackages);
       
   402 	}
   400 	}
   403 
   401 
   404 /**
   402 /**
   405  * This functions determines whether it is now okay to confirm the removal of the package(Node in the uninstallation tree).  
   403  * This functions determines whether it is now okay to confirm the removal of the package(Node in the uninstallation tree).  
   406  * 
   404  * 
   519 		    {
   517 		    {
   520             DEBUG_PRINTF3(_L("CPlanner::CreatePlannedApplicationL failed to publish Uid %x with error."),aRootNode.PackageL().Uid(), err);
   518             DEBUG_PRINTF3(_L("CPlanner::CreatePlannedApplicationL failed to publish Uid %x with error."),aRootNode.PackageL().Uid(), err);
   521             User::Leave(err);
   519             User::Leave(err);
   522 		    }
   520 		    }
   523 		}
   521 		}
   524 
       
   525 	CleanupStack::Pop(rootApplication);
   522 	CleanupStack::Pop(rootApplication);
   526 	
   523 	
   527 	return rootApplication;
   524 	return rootApplication;
   528 	}
   525 	}
   529 
   526 
   534  * @param aNode The CApplication object to populate.
   531  * @param aNode The CApplication object to populate.
   535  * @param aRegistryEntry The relevant SIS Registry entry for the package.
   532  * @param aRegistryEntry The relevant SIS Registry entry for the package.
   536  */
   533  */
   537 void CPlanner::ConfirmForUninstallL(CUninstallationNode& aNode, RPointerArray<CSisRegistryPackage>& aPlannedPackages)
   534 void CPlanner::ConfirmForUninstallL(CUninstallationNode& aNode, RPointerArray<CSisRegistryPackage>& aPlannedPackages)
   538 	{
   535 	{
   539 	CleanupResetAndDestroyPushL(aPlannedPackages);
       
   540 	aNode.SetIsPlanned(ETrue);
   536 	aNode.SetIsPlanned(ETrue);
   541 
   537 
   542 	// aNode owns package therefore to transfer the ownership
   538 	// aNode owns package therefore to transfer the ownership
   543 	// a copy of CSisRegistryPackage is made.
   539 	// a copy of CSisRegistryPackage is made.
   544 	CSisRegistryPackage* package = CSisRegistryPackage::NewLC(aNode.PackageL());
   540 	CSisRegistryPackage* package = CSisRegistryPackage::NewLC(aNode.PackageL());
   545 	aPlannedPackages.AppendL(package);
   541 	aPlannedPackages.AppendL(package);
   546 	CleanupStack::Pop(2, &aPlannedPackages);
   542 	CleanupStack::Pop(package);
   547 	}
   543 	}
   548 
   544 
   549 /**
   545 /**
   550  * This function is called after the node/package is marked for uninstallation.
   546  * This function is called after the node/package is marked for uninstallation.
   551  * So it will fully populate the details of CApplication object.
   547  * So it will fully populate the details of CApplication object.