iaupdate/IAD/engine/controller/src/iaupdateloader.cpp
branchRCL_3
changeset 21 5bddc28da627
parent 1 c42dffbd5b4f
equal deleted inserted replaced
19:f8cf9d484c15 21:5bddc28da627
     1 /*
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-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".
   502     for ( TInt i = 0; i < childCount; ++i )
   502     for ( TInt i = 0; i < childCount; ++i )
   503         {
   503         {
   504         IAUPDATE_TRACE_1("[IAUPDATE] Container child: %d", i);
   504         IAUPDATE_TRACE_1("[IAUPDATE] Container child: %d", i);
   505 
   505 
   506         MNcdNode* node( aParentContainer.ChildL( i ) );
   506         MNcdNode* node( aParentContainer.ChildL( i ) );
   507         CleanupReleasePushL( *node );
   507         if ( node )
   508 
   508             {
   509         MNcdNodeContainer* container(
   509             CleanupReleasePushL( *node );
       
   510 
       
   511             MNcdNodeContainer* container(
   510             node->QueryInterfaceLC< MNcdNodeContainer >() );
   512             node->QueryInterfaceLC< MNcdNodeContainer >() );
   511         if ( container )
   513             if ( container )
   512             {
   514                 {
   513             IAUPDATE_TRACE("[IAUPDATE] Container child had container interface");
   515                 IAUPDATE_TRACE("[IAUPDATE] Container child had container interface");
   514             LoadContainerL( *container );
   516                 LoadContainerL( *container );
   515             CleanupStack::PopAndDestroy( container );                
   517                 CleanupStack::PopAndDestroy( container );                
   516             }
   518                 }
   517 
   519             CleanupStack::PopAndDestroy( node );
   518         CleanupStack::PopAndDestroy( node );
   520             }
   519         }
   521         }
   520 
   522 
   521     IAUPDATE_TRACE("[IAUPDATE] CIAUpdateLoader::LoadChildContainersL() end");
   523     IAUPDATE_TRACE("[IAUPDATE] CIAUpdateLoader::LoadChildContainersL() end");
   522     }
   524     }
   523 
   525 
   634     IAUPDATE_TRACE_1("[IAUPDATE] Container child count: %d", childCount);
   636     IAUPDATE_TRACE_1("[IAUPDATE] Container child count: %d", childCount);
   635  
   637  
   636     for ( TInt i = 0; i < childCount; ++i )
   638     for ( TInt i = 0; i < childCount; ++i )
   637         {
   639         {
   638         MNcdNode* node( aContainer.ChildL( i ) );
   640         MNcdNode* node( aContainer.ChildL( i ) );
   639         CleanupReleasePushL( *node );
   641         if ( node )
   640 
   642             {
   641         MNcdNodeContainer* container( 
   643             CleanupReleasePushL( *node );
   642             node->QueryInterfaceLC< MNcdNodeContainer >() );
   644 
   643         if ( container )
   645             MNcdNodeContainer* container( 
   644             {
   646                node->QueryInterfaceLC< MNcdNodeContainer >() );
   645             IAUPDATE_TRACE_1("[IAUPDATE] Container child: %d had container interface", i);
   647             if ( container )
   646 
       
   647             switch ( aPreviousOperationType )
       
   648                 {
   648                 {
   649                 case TIAUpdateOperationInfo::ELoadRoot:
   649                 IAUPDATE_TRACE_1("[IAUPDATE] Container child: %d had container interface", i);
   650                     IAUPDATE_TRACE("[IAUPDATE] Load children of the root child");
   650                 switch ( aPreviousOperationType )
   651                     // When root is loaded, also its children are loaded
   651                     {
   652                     // and they have now their child count. So, no need to
   652                     case TIAUpdateOperationInfo::ELoadRoot:
   653                     // reload children of the root. Load their children
   653                         IAUPDATE_TRACE("[IAUPDATE] Load children of the root child");
   654                     // directly now.
   654                         // When root is loaded, also its children are loaded
   655                     LoadChildrenL( *container );
   655                         // and they have now their child count. So, no need to
   656                     break;
   656                         // reload children of the root. Load their children
   657                     
   657                         // directly now.
   658                 case TIAUpdateOperationInfo::ELoadChildren:
   658                         LoadChildrenL( *container );
   659                     IAUPDATE_TRACE("[IAUPDATE] Load children of a container");
   659                         break;
   660                     // Notice, that now we need to first load the child count
   660                             
   661                     // for the child containers. So, even if children were 
   661                     case TIAUpdateOperationInfo::ELoadChildren:
   662                     // already updated by LoadChildrenL, a new request for
   662                         IAUPDATE_TRACE("[IAUPDATE] Load children of a container");
   663                     // containers needs . Otherwise, the child count 
   663                         // Notice, that now we need to first load the child count
   664                     // will not be up-to-date. When the child containers are 
   664                         // for the child containers. So, even if children were 
   665                     // loaded, the flow will continue to load the children.
   665                         // already updated by LoadChildrenL, a new request for
   666                     LoadContainerL( *container );
   666                         // containers needs . Otherwise, the child count 
   667                     break;
   667                         // will not be up-to-date. When the child containers are 
   668 
   668                         // loaded, the flow will continue to load the children.
   669                 case TIAUpdateOperationInfo::ELoadAllChildren:
   669                         LoadContainerL( *container );
   670                     IAUPDATE_TRACE("[IAUPDATE] Load all children of a container");
   670                         break;
   671                     // Notice, here we will try to skip the loading of the child
   671 
   672                     // count of the container. So, all the children are tried to
   672                     case TIAUpdateOperationInfo::ELoadAllChildren:
   673                     // be loaded directly even if the child count may not be
   673                         IAUPDATE_TRACE("[IAUPDATE] Load all children of a container");
   674                     // up-to-date.
   674                         // Notice, here we will try to skip the loading of the child
   675                     LoadAllChildrenL( *container );
   675                         // count of the container. So, all the children are tried to
   676                     break;
   676                         // be loaded directly even if the child count may not be
   677                     
   677                         // up-to-date.
   678                 default:
   678                         LoadAllChildrenL( *container );
   679                     IAUPDATE_TRACE("[IAUPDATE] ERROR: Wrong operation type");
   679                         break;
   680                     User::Leave( KErrArgument );
   680                             
   681                     break;
   681                     default:
       
   682                         IAUPDATE_TRACE("[IAUPDATE] ERROR: Wrong operation type");
       
   683                         User::Leave( KErrArgument );
       
   684                         break;
       
   685                     }
       
   686                 CleanupStack::PopAndDestroy( container );                
   682                 }
   687                 }
   683 
   688             CleanupStack::PopAndDestroy( node );
   684             CleanupStack::PopAndDestroy( container );                
   689             }
   685             }
       
   686 
       
   687         CleanupStack::PopAndDestroy( node );
       
   688         }
   690         }
   689 
   691 
   690     IAUPDATE_TRACE("[IAUPDATE] CIAUpdateLoader::LoadChildrenOfChildrenL() end");
   692     IAUPDATE_TRACE("[IAUPDATE] CIAUpdateLoader::LoadChildrenOfChildrenL() end");
   691     }
   693     }
   692 
   694