Remove useless signal sending logic. 29/78129/4
authorWoochan Lee <wc0917.lee@samsung.com>
Mon, 4 Jul 2016 10:04:45 +0000 (19:04 +0900)
committerwoochan lee <wc0917.lee@samsung.com>
Tue, 5 Jul 2016 10:17:43 +0000 (03:17 -0700)
Change-Id: I7add9c86a98e18ccf9580748146e901250555e8a

src/lib/efl/mobile/UiStandardView.cpp

index a77bfc31b4988489ff99f986c703eeeb8c9b2b91..2c28b2d7a23e618d8df6846f65abc2d69e407c7c 100644 (file)
@@ -203,15 +203,20 @@ bool UiStandardViewImpl::setTitleLeftBtn(Elm_Button *titleLeftBtn)
 {
        Elm_Layout *layout = this->getBase();
        LAYOUT_VALIDATE();
+       Elm_Button *pbtn;
 
-       //FIXME: inside of the unset_title_left_btn, it will send a title_left_btn,hide signal.
-       //But right after it needs to send a show signal again if new title_left_btn is valid.
-       //We don't need to send a hide signal in this case.
-       Elm_Button *pbtn = this->unsetTitleLeftBtn();
+       if (!titleLeftBtn)
+       {
+               pbtn = this->unsetTitleLeftBtn();
+               evas_object_del(pbtn);
+
+               return true;
+       }
+
+       pbtn = this->getTitleLeftBtn();
        evas_object_del(pbtn);
 
        this->_titleLeftBtn = titleLeftBtn;
-       if (!titleLeftBtn) return true;
 
        elm_object_style_set(titleLeftBtn, "tizen_view/title_left");
        elm_object_part_content_set(layout, "title_left_btn", titleLeftBtn);
@@ -224,16 +229,20 @@ bool UiStandardViewImpl::setTitleLeftBtn(Elm_Button *titleLeftBtn)
 bool UiStandardViewImpl::setTitleRightBtn(Elm_Button *titleRightBtn)
 {
        Elm_Layout *layout = this->getBase();
-       LAYOUT_VALIDATE();
+       Elm_Button *pbtn;
 
-       //FIXME: inside of the unset_title_right_btn, it will send a title_right_btn,hide signal.
-       //But right after it needs to send a show signal again if new title_right_btn is valid.
-       //We don't need to send a hide signal in this case.
-       Elm_Button *pbtn = this->unsetTitleRightBtn();
+       if (!titleRightBtn)
+       {
+               pbtn = this->unsetTitleRightBtn();
+               evas_object_del(pbtn);
+
+               return true;
+       }
+
+       pbtn = this->getTitleRightBtn();
        evas_object_del(pbtn);
 
        this->_titleRightBtn = titleRightBtn;
-       if (!titleRightBtn) return true;
 
        elm_object_style_set(titleRightBtn, "tizen_view/title_right");
        elm_object_part_content_set(layout, "title_right_btn", titleRightBtn);