ncdengine/provider/server/src/ncdsearchoperationimpl.cpp
branchRCL_3
changeset 66 8b7f4e561641
parent 65 7333d7932ef7
equal deleted inserted replaced
65:7333d7932ef7 66:8b7f4e561641
   722             parentIdentifier = CNcdNodeIdentifier::NewLC( *iNodeIdentifier );
   722             parentIdentifier = CNcdNodeIdentifier::NewLC( *iNodeIdentifier );
   723             }
   723             }
   724         delete metaIdentifier;
   724         delete metaIdentifier;
   725         metaIdentifier = NULL;
   725         metaIdentifier = NULL;
   726         }
   726         }
   727 
   727     if( addMetaData )
   728     // set iParentIdentifier as parent if not set otherwise, this would be the case of a
   728         {
   729     // normal top-level node from a content source
   729         // set iParentIdentifier as parent if not set otherwise, this would be the case of a
   730     if ( ! parentIdentifier ) 
   730         // normal top-level node from a content source
   731         {
   731         if ( ! parentIdentifier ) 
   732         parentIdentifier = CNcdNodeIdentifier::NewLC( *iParentIdentifier );
   732             {
   733         }
   733             parentIdentifier = CNcdNodeIdentifier::NewLC( *iParentIdentifier );
   734     
   734             }
   735     // Get the node reference from the data handler.
   735         
   736     // The node has the given parent and its metadata
   736         // Get the node reference from the data handler.
   737     // will be internalized with the given data.
   737         // The node has the given parent and its metadata
   738     CNcdNode& node =
   738         // will be internalized with the given data.
   739     iNodeManager->DataHandlerL( *parentIdentifier, *aData, iClientUid );
   739         CNcdNode& node =
   740     
   740             iNodeManager->DataHandlerL( *parentIdentifier, *aData, iClientUid );
   741     CleanupStack::PopAndDestroy( parentIdentifier );
   741             
   742 
   742         CleanupStack::PopAndDestroy( parentIdentifier );
   743     // Notice that the loaded nodes should contain the actual node identifier
   743 
   744     // instead of metadata identifier, because the identifiers are returned to
   744         // Notice that the loaded nodes should contain the actual node identifier
   745     // the proxy side after operation completes.
   745         // instead of metadata identifier, because the identifiers are returned to
   746     CNcdNodeIdentifier* loadedNodeId = 
   746         // the proxy side after operation completes.
   747         CNcdNodeIdentifier::NewLC( node.Identifier() );
   747         CNcdNodeIdentifier* loadedNodeId = 
   748     iLoadedNodes.AppendL( loadedNodeId );
   748             CNcdNodeIdentifier::NewLC( node.Identifier() );
   749     CleanupStack::Pop( loadedNodeId );        
   749         iLoadedNodes.AppendL( loadedNodeId );
   750 
   750         CleanupStack::Pop( loadedNodeId );        
   751     // If the data contains icon id and datablock id, they are stored until
   751 
   752     // the datablock arrives later.
   752         // If the data contains icon id and datablock id, they are stored until
   753     const MNcdPreminetProtocolIcon* icon = aData->Icon();
   753         // the datablock arrives later.
   754     if ( icon != NULL ) 
   754         const MNcdPreminetProtocolIcon* icon = aData->Icon();
   755         {
   755         if ( icon != NULL ) 
   756         const TDesC& iconId = icon->Id();
   756             {
   757         const TDesC& dataBlockId = icon->DataBlock();
   757             const TDesC& iconId = icon->Id();
   758         if ( iconId != KNullDesC && dataBlockId != KNullDesC ) 
   758             const TDesC& dataBlockId = icon->DataBlock();
   759             {
   759             if ( iconId != KNullDesC && dataBlockId != KNullDesC ) 
   760             // The node metadata was created by using the DataHandlerL
   760                 {
   761             // and inserted for the node.
   761                 // The node metadata was created by using the DataHandlerL
   762             // So, the metadata can be asked from the node now.
   762                 // and inserted for the node.
   763             MapIconIdForDataBlockL(iconId, dataBlockId, 
   763                 // So, the metadata can be asked from the node now.
   764                                    node.NodeMetaDataL().Identifier() );
   764                 MapIconIdForDataBlockL(iconId, dataBlockId, 
   765             node.NodeMetaDataL().IconL().SetIconDataReady( EFalse );
   765                                        node.NodeMetaDataL().Identifier() );
   766             }
   766                 node.NodeMetaDataL().IconL().SetIconDataReady( EFalse );
   767         }
   767                 }
   768     
   768             }
       
   769         }
       
   770     else if ( parentIdentifier )
       
   771         {
       
   772         CleanupStack::PopAndDestroy( parentIdentifier );
       
   773         }
   769     DLTRACEOUT((""));
   774     DLTRACEOUT((""));
   770     }
   775     }
   771     
   776     
   772 // ---------------------------------------------------------------------------
   777 // ---------------------------------------------------------------------------
   773 // ?description_if_needed
   778 // ?description_if_needed