diff -r f7f0874bfe7d -r 6b87b143d312 photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp --- a/photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp Tue Feb 02 10:12:14 2010 +0200 +++ b/photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp Fri Feb 19 22:51:01 2010 +0200 @@ -26,8 +26,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -48,7 +47,7 @@ const TInt KListDataWindowSize(25); const TInt KNoOfPages(2); const TInt KBufferTresholdSize(6); -const TInt KRecreateListSize(5); + // ======== MEMBER FUNCTIONS ======== @@ -456,7 +455,7 @@ CFbsBitmap* defaultBitmap = AknIconUtils::CreateIconL(resFile, EMbmGlxiconsQgn_prop_image_notcreated); AknIconUtils::SetSize(defaultBitmap, - CHgDoubleGraphicList::PreferredImageSize()); + CHgDoubleGraphicListFlat::PreferredImageSize()); iList->ItemL(focusIndex).SetIcon(CGulIcon::NewL(defaultBitmap)); } @@ -547,9 +546,9 @@ CFbsBitmap* bitmap = AknIconUtils::CreateIconL(resFile, EMbmGlxiconsQgn_prop_image_notcreated); AknIconUtils::SetSize(bitmap, - CHgDoubleGraphicList::PreferredImageSize()); + CHgDoubleGraphicListFlat::PreferredImageSize()); - iList = CHgDoubleGraphicList::NewL( + iList = CHgDoubleGraphicListFlat::NewL( ClientRect(), mediaCount, CGulIcon::NewL(bitmap) ); @@ -568,8 +567,7 @@ //set the text to be shown if the list is empty. HBufC* emptyText = StringLoader::LoadLC(R_LIST_EMPTY_VIEW_TEXT); iList->SetEmptyTextL(*emptyText); - CleanupStack::PopAndDestroy(emptyText); - iLastFocusedIndex = iList->FirstIndexOnScreen(); + CleanupStack::PopAndDestroy(emptyText); } //Fix for ESLM-7SAHPT::Clear Flag to Disable QWERTY search input in list view @@ -608,32 +606,27 @@ void CGlxListViewImp::HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ) { - TRACER("CGlxListViewImp::HandleItemAddedL"); - if (iList) - { - if ((aEndIndex - aStartIndex) >= KRecreateListSize) - { - iList->ResizeL(aList->Count()); - } - else + TRACER("CGlxListViewImp::HandleItemAddedL"); + + if (iList && aList) + { + iList->ResizeL(aList->Count()); + for (TInt i = aStartIndex; i<= aEndIndex; i++) { - for (TInt i = aStartIndex; i<= aEndIndex; i++) - { - const TGlxMedia& item = iMediaList->Item(i); - iList->InsertItem(CHgItem::NewL(CHgItem::EHgItemFlagsNone, - NULL, item.Title(), item.SubTitle()), i); - } - - if(aStartIndex == aEndIndex ) - { - iLastFocusedIndex = aStartIndex; - iPopulateListTNs = EFalse; - iMediaList->SetFocusL(NGlxListDefs::EAbsolute, iLastFocusedIndex); - } - - iList->SetSelectedIndex(iLastFocusedIndex); - iList->RefreshScreen(iLastFocusedIndex); + const TGlxMedia& item = iMediaList->Item(i); + iList->ItemL(i).SetTitleL(item.Title()); + iList->ItemL(i).SetTextL(item.SubTitle()); + } + + if(aStartIndex == aEndIndex ) + { + iLastFocusedIndex = aStartIndex; + iPopulateListTNs = EFalse; + iMediaList->SetFocusL(NGlxListDefs::EAbsolute, iLastFocusedIndex); } + + iList->SetSelectedIndex(iLastFocusedIndex); + iList->RefreshScreen(iLastFocusedIndex); } }