From 95aa5bf262679b5e5f269a8ee849ff3059bdf1cb Mon Sep 17 00:00:00 2001 From: Suhwan_Park Date: Tue, 16 Apr 2013 19:20:08 +0900 Subject: [PATCH] Modified that RefreshList does not work while UpdateList on ListView, GroupedListView Change-Id: I0a2771445d755d37dd17b270f1ca8d25bb35345a Signed-off-by: Suhwan_Park --- src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp | 10 ++++++++++ src/ui/controls/FUiCtrl_ListViewImpl.cpp | 10 ++++++++++ src/ui/inc/FUiCtrl_GroupedListViewImpl.h | 1 + src/ui/inc/FUiCtrl_ListViewImpl.h | 1 + 4 files changed, 22 insertions(+) diff --git a/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp b/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp index 2faf4c9..92d2487 100644 --- a/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp +++ b/src/ui/controls/FUiCtrl_GroupedListViewImpl.cpp @@ -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); } diff --git a/src/ui/controls/FUiCtrl_ListViewImpl.cpp b/src/ui/controls/FUiCtrl_ListViewImpl.cpp index 2f00bb4..d86f39f 100644 --- a/src/ui/controls/FUiCtrl_ListViewImpl.cpp +++ b/src/ui/controls/FUiCtrl_ListViewImpl.cpp @@ -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); } diff --git a/src/ui/inc/FUiCtrl_GroupedListViewImpl.h b/src/ui/inc/FUiCtrl_GroupedListViewImpl.h index fd916f1..e535e7c 100644 --- a/src/ui/inc/FUiCtrl_GroupedListViewImpl.h +++ b/src/ui/inc/FUiCtrl_GroupedListViewImpl.h @@ -276,6 +276,7 @@ private: bool __redrawListView; bool __isBoundsChanged; + bool __needReloadItems; _ListViewItem* __pItemNeedsLazyDeletion; class _GroupedListViewPropagatedTouchEventListener; diff --git a/src/ui/inc/FUiCtrl_ListViewImpl.h b/src/ui/inc/FUiCtrl_ListViewImpl.h index 9ce8304..925d1d3 100644 --- a/src/ui/inc/FUiCtrl_ListViewImpl.h +++ b/src/ui/inc/FUiCtrl_ListViewImpl.h @@ -255,6 +255,7 @@ private: bool __redrawListView; bool __isBoundsChanged; + bool __needReloadItems; _ListViewItem* __pItemNeedsLazyDeletion; class _ListViewPropagatedTouchEventListener; -- 2.7.4