From: Hermet Park Date: Fri, 9 Sep 2016 08:06:32 +0000 (+0900) Subject: code refactoring. X-Git-Tag: accepted/tizen/common/20160928.164036^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F87727%2F1;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git code refactoring. use auto identifier for simplication. Change-Id: I34c0f9a2ce975f91bcc6d9ec37e8c5774d90902d --- diff --git a/src/lib/efl/mobile/UiView.cpp b/src/lib/efl/mobile/UiView.cpp index 317fc42..621e1ff 100644 --- a/src/lib/efl/mobile/UiView.cpp +++ b/src/lib/efl/mobile/UiView.cpp @@ -64,8 +64,6 @@ public: } -typedef list::reverse_iterator popupRitr; - void UiViewImpl::_connectPopup(UiPopup *popup) { this->_popupList.push_back(popup); @@ -78,7 +76,7 @@ void UiViewImpl::_disconnectPopup(UiPopup *popup) bool UiViewImpl::_deactivatePopup(bool topOne) { - for (popupRitr it = this->_popupList.rbegin(); it != this->_popupList.rend(); it++) { + for (auto it = this->_popupList.rbegin(); it != this->_popupList.rend(); it++) { UiPopup *popup = *it; if (!popup->isActivated()) continue; popup->onBack(); diff --git a/src/lib/interface/UiIfaceViewmgr.cpp b/src/lib/interface/UiIfaceViewmgr.cpp index 167afe2..27ac715 100644 --- a/src/lib/interface/UiIfaceViewmgr.cpp +++ b/src/lib/interface/UiIfaceViewmgr.cpp @@ -78,13 +78,8 @@ bool UiIfaceViewmgrImpl::_softKey = true; //FIXME: Read system profile to decide whether support event block or not. bool UiIfaceViewmgrImpl::_eventBlock = true; -#define VIEW_ITR list::iterator -#define VIEW_RITR list::reverse_iterator - bool UiIfaceViewmgrImpl::insertViewAfter(UiIfaceView *view, UiIfaceView *after) { - VIEW_ITR it; - if (!view) { LOGE("invalid view argument. view(NULL)"); return false; @@ -96,7 +91,7 @@ bool UiIfaceViewmgrImpl::insertViewAfter(UiIfaceView *view, UiIfaceView *after) } if (this->_viewList.size() > 0) { - for (it = this->_viewList.begin(); it != this->_viewList.end(); it++) { + for (auto it = this->_viewList.begin(); it != this->_viewList.end(); it++) { if (after == *it) { //If the after is a last item of list. //view has to push now. @@ -202,7 +197,7 @@ UiIfaceViewmgrImpl::~UiIfaceViewmgrImpl() { //Terminate views this->_destroying = EINA_TRUE; - for (VIEW_RITR ritr = this->_viewList.rbegin(); ritr != this->_viewList.rend(); ritr++) { + for (auto ritr = this->_viewList.rbegin(); ritr != this->_viewList.rend(); ritr++) { UiIfaceView *view = *ritr; if ((view->getState() != UI_VIEW_STATE_DEACTIVATE) && (view->getState() != UI_VIEW_STATE_UNLOAD)) { @@ -302,8 +297,6 @@ bool UiIfaceViewmgrImpl::popView() bool UiIfaceViewmgrImpl::insertViewBefore(UiIfaceView *view, UiIfaceView *before) { - VIEW_ITR it; - if (!view) { LOGE("invalid view argument. view(NULL)"); return false; @@ -315,10 +308,9 @@ bool UiIfaceViewmgrImpl::insertViewBefore(UiIfaceView *view, UiIfaceView *before } if (this->_viewList.size() > 0) { - for (it = this->_viewList.begin(); it != this->_viewList.end(); it++) { + for (auto it = this->_viewList.begin(); it != this->_viewList.end(); it++) { if (before == *it) { this->_viewList.insert(it, view); - return true; } } @@ -349,7 +341,7 @@ UiIfaceView *UiIfaceViewmgrImpl::getView(unsigned int idx) return NULL; } - VIEW_ITR it = this->_viewList.begin(); + auto it = this->_viewList.begin(); advance(it, idx); return *it; }