c++: use in-class member initialization for simple initializations. 26/78726/1 accepted/tizen/common/20160708.140253 accepted/tizen/mobile/20160708.091600 submit/tizen/20160707.233627
authorHermet Park <hermet@hermet.pe.kr>
Wed, 6 Jul 2016 13:47:27 +0000 (22:47 +0900)
committerHermet Park <hermet@hermet.pe.kr>
Wed, 6 Jul 2016 13:47:27 +0000 (22:47 +0900)
Change-Id: Id0f23e9807d9df71a9045ff600c3a0c082254c39

src/lib/efl/UiBaseKeyListener.cpp
src/lib/efl/UiBaseViewmgr.cpp
src/lib/efl/mobile/UiStandardView.cpp
src/lib/efl/mobile/UiView.cpp
src/lib/interface/UiIfaceApp.cpp
src/lib/interface/UiIfaceOverlay.cpp
src/lib/interface/UiIfaceView.cpp
src/lib/interface/UiIfaceViewmgr.cpp

index 374553dce2247ded57c91c673021f286240799e4..983211f8ae65840bffa84b73915b3f9ed3aca3ca 100644 (file)
@@ -27,9 +27,9 @@ namespace efl_viewmanager
 class UiBaseKeyListenerImpl
 {
 protected:
-       UiBaseKeyListener *keyListener;
-       UiBaseViewmgr *viewmgr;
-       Evas_Object *keyGrabber;
+       UiBaseKeyListener *keyListener = NULL;
+       UiBaseViewmgr *viewmgr = NULL;
+       Evas_Object *keyGrabber = NULL;
 
 public:
        UiBaseKeyListenerImpl(UiBaseKeyListener *key_listener, UiBaseViewmgr *viewmgr);
@@ -52,7 +52,7 @@ static void _keyGrabRectKeyUpCb(UiBaseKeyListenerImpl *keyListener, Evas_Event_K
 }
 
 UiBaseKeyListenerImpl::UiBaseKeyListenerImpl(UiBaseKeyListener *keyListener, UiBaseViewmgr *viewmgr)
-               : keyListener(keyListener), viewmgr(viewmgr), keyGrabber(NULL)
+               : keyListener(keyListener), viewmgr(viewmgr)
 {
 }
 
index eea2048931d2b540186e07492b00830da26a6d18..b822edbb9eac1b81aa977f073b55ef5fe6c18206 100644 (file)
@@ -33,15 +33,15 @@ class UiBaseViewmgrImpl
        friend class UiBaseViewmgr;
 
 private:
-       UiBaseViewmgr *_viewmgr;
-       Elm_Win *_win;                              //This is acting like a base object of viewmgr.
-       Elm_Conformant *_conform;                   //Conformant for viewmgr.
-       Elm_Scroller *_scroller;                    //Scroller for viewmgr.
-       Elm_Layout *_layout;                        //Viewmgr's base layout.
-       UiBaseKeyListener *_keyListener;            //HW Key Handler such as "BACK" key...
-       UiViewIndicator _indicator;                 //Mode of indicator.
-       string _transitionStyle;                    //Current transition effect style name
-       map<string, Elm_Layout *> _effectMap;       //Map for effect layouts.
+       UiBaseViewmgr *_viewmgr = NULL;
+       Elm_Win *_win = NULL;                                      //This is acting like a base object of viewmgr.
+       Elm_Conformant *_conform = NULL;                           //Conformant for viewmgr.
+       Elm_Scroller *_scroller = NULL;                            //Scroller for viewmgr.
+       Elm_Layout *_layout = NULL;                                //Viewmgr's base layout.
+       UiBaseKeyListener *_keyListener = NULL;                    //HW Key Handler such as "BACK" key...
+       UiViewIndicator _indicator = UI_VIEW_INDICATOR_DEFAULT;    //Mode of indicator.
+       string _transitionStyle = "default";                       //Current transition effect style name
+       map<string, Elm_Layout *> _effectMap;                      //Map for effect layouts.
 
        Elm_Layout *_setTransitionLayout(string transitionStyle);
 
@@ -242,7 +242,7 @@ bool UiBaseViewmgrImpl::_createScroller(Elm_Conformant *conform)
 }
 
 UiBaseViewmgrImpl::UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, UiBaseKeyListener *keyListener)
-               : _viewmgr(viewmgr), _keyListener(keyListener), _transitionStyle("default")
+               : _viewmgr(viewmgr), _keyListener(keyListener)
 {
        if (!pkg) {
                LOGE("Invalid package name");
index e343e0cea4e5e0dcc2414ecfb0e2d5cedd456b35..919e1e8e3ce1a109dddeaa4f21f2b562e74ff5c8 100644 (file)
@@ -31,11 +31,11 @@ class UiStandardViewImpl
        friend class UiStandardView;
 
 private:
-       UiStandardView *_view;
-       Elm_Layout *_layout;                //Base layout for view
-       Elm_Toolbar *_toolbar;              //Toolbar
-       Elm_Button *_titleLeftBtn;        //Title left button
-       Elm_Button *_titleRightBtn;       //Title right button
+       UiStandardView *_view = NULL;
+       Elm_Layout *_layout = NULL;              //Base layout for view
+       Elm_Toolbar *_toolbar = NULL;            //Toolbar
+       Elm_Button *_titleLeftBtn = NULL;        //Title left button
+       Elm_Button *_titleRightBtn = NULL;       //Title right button
 
        bool _createLayout();
        bool _destroyLayout();
@@ -161,7 +161,7 @@ bool UiStandardViewImpl::_createLayout()
 }
 
 UiStandardViewImpl::UiStandardViewImpl(UiStandardView *view)
-               : _view(view), _layout(NULL), _toolbar(NULL), _titleLeftBtn(NULL), _titleRightBtn(NULL)
+               : _view(view)
 {
 }
 
index 38769e2f217b64989c0b2ab4a4f6c45ae1d7fa24..317fc429e8d49899a0fbaf007313b774878fd65a 100644 (file)
@@ -34,8 +34,8 @@ class UiViewImpl
        friend class UiView;
 
 private:
-       UiView *_view;
-       UiMenu *_menu;
+       UiView *_view = NULL;
+       UiMenu *_menu = NULL;
        list<UiPopup *> _popupList;
 
        void _connectPopup(UiPopup *popup);
index 441532f4a4d45eea9d2f06983be5de3f8a91a702..a1ff436559392bb2d0b2d9fb8a742d92c966fd16 100644 (file)
@@ -30,10 +30,10 @@ class UiIfaceAppImpl
 public:
        friend class UiIfaceApp;
 
-       UiIfaceApp *app;
-       UiIfaceViewmgr *viewmgr;
-       Eina_Stringshare *pkg;
-       Eina_Stringshare *locale_dir;
+       UiIfaceApp *app = NULL;
+       UiIfaceViewmgr *viewmgr = NULL;
+       Eina_Stringshare *pkg = NULL;
+       Eina_Stringshare *locale_dir = NULL;
 
        UiIfaceAppImpl(UiIfaceApp *app, const char *pkg, const char *locale_dir, UiIfaceViewmgr* viewmgr);
        ~UiIfaceAppImpl();
index 9b547ed049ba347fbc65d6e11dfde0bd2108d383..a1536ae9d4bd51f0282916dd436657dd54af51d6 100644 (file)
@@ -30,9 +30,9 @@ class UiIfaceOverlayImpl
        friend class UiIfaceOverlay;
 
 private:
-       UiIfaceOverlay *_overlay;
-       UiIfaceView *_view;
-       T _content;
+       UiIfaceOverlay *_overlay = NULL;
+       UiIfaceView *_view = NULL;
+       T _content = NULL;
 
 public:
        bool setContent(T content);
@@ -47,7 +47,7 @@ public:
 }
 
 UiIfaceOverlayImpl::UiIfaceOverlayImpl(UiIfaceOverlay *overlay, UiIfaceView *view)
-               : _overlay(overlay), _view(view), _content(NULL)
+               : _overlay(overlay), _view(view)
 {
 }
 
index b973ae6c773fd3ac987d3a228dd1b77cdd52a75e..87c6411c1d9ed43e009a23b38d371248c71b2e98 100644 (file)
@@ -34,15 +34,15 @@ class UiIfaceViewImpl
        friend class UiIfaceView;
 
 private:
-       UiIfaceView *_view;
-       T _content;                              ///< A content instance for a screen as a view.
-       string _name;                            ///< View name.
-       string _transition_style;                ///< View transition style name.
-       UiIfaceViewmgr *_viewmgr;              ///< Viewmgr which this view belongs to.
-       UiViewState _state;                    ///< View state.
-       UiViewIndicator _indicator;            ///< View indicator mode.
-       bool _event_block;                       ///< State of event block.
-       bool _removable_content;                 ///< When this value is true, view removes it's content internally on unload state.
+       UiIfaceView *_view = NULL;
+       T _content = NULL;                                      ///< A content instance for a screen as a view.
+       string _name;                                           ///< View name.
+       string _transition_style = "default";                   ///< View transition style name.
+       UiIfaceViewmgr *_viewmgr = NULL;                        ///< Viewmgr which this view belongs to.
+       UiViewState _state = UI_VIEW_STATE_UNLOAD;              ///< View state.
+       UiViewIndicator _indicator = UI_VIEW_INDICATOR_DEFAULT; ///< View indicator mode.
+       bool _event_block = false;                              ///< State of event block.
+       bool _removable_content = true;                         ///< When this value is true, view removes it's content internally on unload state.
 
 public:
        void setEventBlock(bool block);
@@ -123,10 +123,8 @@ void UiIfaceViewImpl::onDestroy()
 }
 
 UiIfaceViewImpl::UiIfaceViewImpl(UiIfaceView *view, const char *name)
-               : _view(view), _content(NULL), _name(string(name ? name : "")), _transition_style(string("default")), _viewmgr(NULL), _state(UI_VIEW_STATE_LOAD),
-                 _indicator(UI_VIEW_INDICATOR_DEFAULT), _event_block(false), _removable_content(true)
+               : _view(view), _name(string(name ? name : ""))
 {
-       this->_state = UI_VIEW_STATE_UNLOAD;
 }
 
 UiIfaceViewImpl::~UiIfaceViewImpl()
index 69dad97411ef57d2992c3de44d6819d1d3bf2ed7..167afe2824e15ddcd89826a98b484d63d53204e2 100644 (file)
@@ -38,9 +38,9 @@ private:
        static UiIfaceViewmgr *_inst;
        static bool _softKey;                      //If system doesn't support HW back key, then this value is @c true.
        static bool _eventBlock;                   //Event block on view transition. This value should be configurable by system.
-       list<UiIfaceView *> _viewList;           //View list.
-       bool _activated;                            //Activated status of this viewmgr.
-       bool _destroying;                           //True, if viewmgr is on destroying.
+       list<UiIfaceView *> _viewList;             //View list.
+       bool _activated = false;                   //Activated status of this viewmgr.
+       bool _destroying = false;                  //True, if viewmgr is on destroying.
 
 public:
        bool connectView(UiIfaceView *view);
@@ -194,7 +194,6 @@ bool UiIfaceViewmgrImpl::popViewFinished(UiIfaceView *view)
 }
 
 UiIfaceViewmgrImpl::UiIfaceViewmgrImpl(UiIfaceViewmgr* viewmgr)
-               : _activated(false), _destroying(false)
 {
        UiIfaceViewmgrImpl::_inst = viewmgr;
 }