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