photosgallery/common/src/glxcommandparser.cpp
branchRCL_3
changeset 24 ea65f74e6de4
parent 15 191387a8b767
equal deleted inserted replaced
23:b023a8d2866a 24:ea65f74e6de4
   213     if (!aCommand.IsSupported(aAttribute) || aCommand.Type(aAttribute) != EMPXTypeCObject)
   213     if (!aCommand.IsSupported(aAttribute) || aCommand.Type(aAttribute) != EMPXTypeCObject)
   214         {
   214         {
   215         User::Leave(KErrArgument);
   215         User::Leave(KErrArgument);
   216         }
   216         }
   217   
   217   
   218     const CMPXCollectionPath* path = aCommand.ValueCObjectL<CMPXCollectionPath>(aAttribute);
   218     CMPXCollectionPath* path = aCommand.ValueCObjectL<CMPXCollectionPath>(aAttribute);
       
   219 	// ValueCObjectL returns the ownership of path, hence we need to delete
       
   220     CleanupStack::PushL(path);
   219 	RArray<TMPXItemId> list;
   221 	RArray<TMPXItemId> list;
   220     path->SelectionL(list);
   222     path->SelectionL(list);
   221   
   223   
   222     if (list.Count() == 0) // append the current item
   224     if (list.Count() == 0) // append the current item
   223         {
   225         {
   228     	for( TInt i = 0 ; i < list.Count() ; i++ )
   230     	for( TInt i = 0 ; i < list.Count() ; i++ )
   229     		{
   231     		{
   230     		aArray.AppendL(TGlxMediaId(list[i]));
   232     		aArray.AppendL(TGlxMediaId(list[i]));
   231     		}
   233     		}
   232     	}
   234     	}
       
   235     CleanupStack::PopAndDestroy(path);
   233     CleanupStack::Pop(&aArray);
   236     CleanupStack::Pop(&aArray);
   234     }
   237     }
   235 
   238 
   236 /// @todo minor: Rowland Cook 12/06/2007 Add method decription.
   239 /// @todo minor: Rowland Cook 12/06/2007 Add method decription.
   237 // -----------------------------------------------------------------------------
   240 // -----------------------------------------------------------------------------