Modified that RefreshList does not work while UpdateList on ListView, GroupedListView
authorSuhwan_Park <suhwan0927.park@samsung.com>
Tue, 16 Apr 2013 10:20:08 +0000 (19:20 +0900)
committerSuhwan_Park <suhwan0927.park@samsung.com>
Tue, 16 Apr 2013 10:20:08 +0000 (19:20 +0900)
Change-Id: I0a2771445d755d37dd17b270f1ca8d25bb35345a
Signed-off-by: Suhwan_Park <suhwan0927.park@samsung.com>
src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp
src/ui/controls/FUiCtrl_ListViewImpl.cpp
src/ui/inc/FUiCtrl_GroupedListViewImpl.h
src/ui/inc/FUiCtrl_ListViewImpl.h

index 2faf4c9..92d2487 100644 (file)
@@ -554,6 +554,7 @@ _GroupedListViewImpl::_GroupedListViewImpl(GroupedListView* pGroupedList, _Table
        , __pEmptyText(null)
        , __redrawListView(true)
        , __isBoundsChanged(false)
+       , __needReloadItems(false)
        , __pItemNeedsLazyDeletion(null)
        , __pPropagatedTouchEventListener(null)
 {
@@ -1060,6 +1061,11 @@ _GroupedListViewImpl::RefreshList(int groupIndex, int itemIndex, ListRefreshType
 {
        result r = E_SUCCESS;
 
+       if (__needReloadItems)
+       {
+               return r;
+       }
+
        int groupCount = GetCore().GetGroupCount();
        int itemCount = GetCore().GetItemCountAt(groupIndex);
 
@@ -1188,6 +1194,8 @@ _GroupedListViewImpl::RefreshList(int groupIndex, int itemIndex, int elementId)
 result
 _GroupedListViewImpl::UpdateList(void)
 {
+       __needReloadItems = true;
+
        // for lazy delete item
        SetItemNeedsLazyDeletion();
 
@@ -1203,6 +1211,8 @@ _GroupedListViewImpl::UpdateList(void)
                Show();
        }
 
+       __needReloadItems = false;
+
        SetLastResultReturn(r);
 }
 
index 2f00bb4..d86f39f 100644 (file)
@@ -552,6 +552,7 @@ _ListViewImpl::_ListViewImpl(ListView* pList, _TableView* pCore)
        , __pEmptyText(null)
        , __redrawListView(true)
        , __isBoundsChanged(false)
+       , __needReloadItems(false)
        , __pItemNeedsLazyDeletion(null)
        , __pPropagatedTouchEventListener(null)
 {
@@ -1042,6 +1043,11 @@ _ListViewImpl::RefreshList(int index, ListRefreshType type, bool needFlush)
 {
        result r = E_SUCCESS;
 
+       if (__needReloadItems)
+       {
+               return r;
+       }
+
        int itemCount = GetCore().GetItemCountAt(0);
 
        if ((index < 0) || (index > itemCount) || ((type != LIST_REFRESH_TYPE_ITEM_ADD) && (index == itemCount)))
@@ -1166,6 +1172,8 @@ _ListViewImpl::RefreshList(int index, int elementId)
 result
 _ListViewImpl::UpdateList(void)
 {
+       __needReloadItems = true;
+
        // for lazy delete item
        SetItemNeedsLazyDeletion();
 
@@ -1181,6 +1189,8 @@ _ListViewImpl::UpdateList(void)
                Show();
        }
 
+       __needReloadItems = false;
+
        SetLastResultReturn(r);
 }
 
index fd916f1..e535e7c 100644 (file)
@@ -276,6 +276,7 @@ private:
 
        bool __redrawListView;
        bool __isBoundsChanged;
+       bool __needReloadItems;
        _ListViewItem* __pItemNeedsLazyDeletion;
 
        class _GroupedListViewPropagatedTouchEventListener;
index 9ce8304..925d1d3 100644 (file)
@@ -255,6 +255,7 @@ private:
 
        bool __redrawListView;
        bool __isBoundsChanged;
+       bool __needReloadItems;
        _ListViewItem* __pItemNeedsLazyDeletion;
 
        class _ListViewPropagatedTouchEventListener;