code refactoring. 27/87727/1
authorHermet Park <hermet@hermet.pe.kr>
Fri, 9 Sep 2016 08:06:32 +0000 (17:06 +0900)
committerHermet Park <hermet@hermet.pe.kr>
Fri, 9 Sep 2016 08:06:32 +0000 (17:06 +0900)
use auto identifier for simplication.

Change-Id: I34c0f9a2ce975f91bcc6d9ec37e8c5774d90902d

src/lib/efl/mobile/UiView.cpp
src/lib/interface/UiIfaceViewmgr.cpp

index 317fc42..621e1ff 100644 (file)
@@ -64,8 +64,6 @@ public:
 
 }
 
-typedef list<UiPopup*>::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();
index 167afe2..27ac715 100644 (file)
@@ -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<UiIfaceView *>::iterator
-#define VIEW_RITR list<UiIfaceView *>::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;
 }