upnpframework/upnpcommonui/src/upnpbrowsedialog.cpp
changeset 32 3785f754ee62
parent 0 7f85d04be362
child 34 eab116a48b80
equal deleted inserted replaced
27:03808033c9a2 32:3785f754ee62
  1578                     // Save Parent Id
  1578                     // Save Parent Id
  1579                     if ( iResultArray.Count() > 0 )
  1579                     if ( iResultArray.Count() > 0 )
  1580                         {
  1580                         {
  1581                         HBufC8* containerId = 
  1581                         HBufC8* containerId = 
  1582                             ( iResultArray[ 0 ]->ParentId() ).AllocL();
  1582                             ( iResultArray[ 0 ]->ParentId() ).AllocL();
  1583                         iParentId.Append( containerId );
  1583                         iParentId.AppendL( containerId );
  1584 
  1584 
  1585                         // store parent name
  1585                         // store parent name
  1586                         HBufC8* name = 
  1586                         HBufC8* name = 
  1587                          ( iResultArray[ iSelectedItem ]->Title() ).AllocL();
  1587                          ( iResultArray[ iSelectedItem ]->Title() ).AllocL();
  1588                         iParentName.Append( name );
  1588                         iParentName.AppendL( name );
  1589                         }
  1589                         }
  1590                     }
  1590                     }
  1591                 }
  1591                 }
  1592             }
  1592             }
  1593         // If the result array in response to first browse request
  1593         // If the result array in response to first browse request
  1670                     CUpnpContainer* container = CUpnpContainer::NewL();
  1670                     CUpnpContainer* container = CUpnpContainer::NewL();
  1671                 
  1671                 
  1672                     CleanupStack::PushL( container );
  1672                     CleanupStack::PushL( container );
  1673                     container->CopyL( *aResultArray[ index ] );
  1673                     container->CopyL( *aResultArray[ index ] );
  1674                     CleanupStack::Pop( container );
  1674                     CleanupStack::Pop( container );
  1675                     iResultArray.Append( container );
  1675                     iResultArray.AppendL( container );
  1676                     }
  1676                     }
  1677                 else 
  1677                 else 
  1678                     {
  1678                     {
  1679                     CUpnpItem* item = CUpnpItem::NewL();
  1679                     CUpnpItem* item = CUpnpItem::NewL();
  1680                 
  1680                 
  1681                     CleanupStack::PushL( item );
  1681                     CleanupStack::PushL( item );
  1682                     item->CopyL( *aResultArray[ index ] );
  1682                     item->CopyL( *aResultArray[ index ] );
  1683                     CleanupStack::Pop( item );
  1683                     CleanupStack::Pop( item );
  1684                     iResultArray.Append( item );
  1684                     iResultArray.AppendL( item );
  1685                     }                    
  1685                     }                    
  1686                 }
  1686                 }
  1687             else if ( iBrowseDirection == EBackward )
  1687             else if ( iBrowseDirection == EBackward )
  1688                 {
  1688                 {
  1689                 if ( aResultArray[ index ]->ObjectType() == EUPnPContainer )
  1689                 if ( aResultArray[ index ]->ObjectType() == EUPnPContainer )
  1690                     {
  1690                     {
  1691                     CUpnpContainer* container = CUpnpContainer::NewL();
  1691                     CUpnpContainer* container = CUpnpContainer::NewL();
  1692                     CleanupStack::PushL( container );
  1692                     CleanupStack::PushL( container );
  1693                     container->CopyL( *aResultArray[ index ] );
  1693                     container->CopyL( *aResultArray[ index ] );
  1694                     CleanupStack::Pop( container );
  1694                     CleanupStack::Pop( container );
  1695                     iResultArray.Insert( container, index );
  1695                     iResultArray.InsertL( container, index );
  1696                     iUppermostItem--;
  1696                     iUppermostItem--;
  1697                     }
  1697                     }
  1698                 else
  1698                 else
  1699                     {
  1699                     {
  1700                     CUpnpItem* item = CUpnpItem::NewL();
  1700                     CUpnpItem* item = CUpnpItem::NewL();
  1701                 
  1701                 
  1702                     CleanupStack::PushL( item );
  1702                     CleanupStack::PushL( item );
  1703                     item->CopyL( *aResultArray[ index ] );
  1703                     item->CopyL( *aResultArray[ index ] );
  1704                     CleanupStack::Pop( item );
  1704                     CleanupStack::Pop( item );
  1705                     iResultArray.Insert( item, index );
  1705                     iResultArray.InsertL( item, index );
  1706                     iUppermostItem--;
  1706                     iUppermostItem--;
  1707                     }                    
  1707                     }                    
  1708                 }
  1708                 }
  1709             }
  1709             }
  1710         
  1710         
  2376     iTempArray.Reset();
  2376     iTempArray.Reset();
  2377     
  2377     
  2378     TInt numberOfItems = iBrowseCacheItems[ aCacheIndex ]->GetNumberOfItems();
  2378     TInt numberOfItems = iBrowseCacheItems[ aCacheIndex ]->GetNumberOfItems();
  2379     for ( TInt index = 0; index < numberOfItems; index++ )
  2379     for ( TInt index = 0; index < numberOfItems; index++ )
  2380         {
  2380         {
  2381         iTempArray.Append( iBrowseCacheItems[ aCacheIndex ]->
  2381         iTempArray.Appendl( iBrowseCacheItems[ aCacheIndex ]->
  2382                                                           GetItem( index ) );
  2382                                                           GetItem( index ) );
  2383         }
  2383         }
  2384     iUppermostItem = iBrowseCacheItems[ aCacheIndex ]->GetUpperMostItem();
  2384     iUppermostItem = iBrowseCacheItems[ aCacheIndex ]->GetUpperMostItem();
  2385     iTotalCount = iBrowseCacheItems[ aCacheIndex ]->GetTotalCount();
  2385     iTotalCount = iBrowseCacheItems[ aCacheIndex ]->GetTotalCount();
  2386     iCurrentItem = iBrowseCacheItems[ aCacheIndex ]->GetHighlightedItem();
  2386     iCurrentItem = iBrowseCacheItems[ aCacheIndex ]->GetHighlightedItem();
  2402         CUPnPBrowseCacheItem* test = CUPnPBrowseCacheItem::NewL( 
  2402         CUPnPBrowseCacheItem* test = CUPnPBrowseCacheItem::NewL( 
  2403                                                         aContainerId,
  2403                                                         aContainerId,
  2404                                                         iPrevHighlighteditem,
  2404                                                         iPrevHighlighteditem,
  2405                                                         iUppermostItem );
  2405                                                         iUppermostItem );
  2406         CleanupStack::PushL( test );
  2406         CleanupStack::PushL( test );
  2407         iBrowseCacheItems.Append( test );
  2407         iBrowseCacheItems.AppendL( test );
  2408         CleanupStack::Pop( test );
  2408         CleanupStack::Pop( test );
  2409         }
  2409         }
  2410     else //update current item
  2410     else //update current item
  2411         {
  2411         {
  2412         TInt cacheItemIndex = CacheCheck( aContainerId );
  2412         TInt cacheItemIndex = CacheCheck( aContainerId );