From: Hermet Park Date: Wed, 6 Jul 2016 13:47:27 +0000 (+0900) Subject: c++: use in-class member initialization for simple initializations. X-Git-Tag: submit/tizen/20160707.233627^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4847936e44228cb506e0d9a8e69d56f77fe01d46;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git c++: use in-class member initialization for simple initializations. Change-Id: Id0f23e9807d9df71a9045ff600c3a0c082254c39 --- diff --git a/src/lib/efl/UiBaseKeyListener.cpp b/src/lib/efl/UiBaseKeyListener.cpp index 374553d..983211f 100644 --- a/src/lib/efl/UiBaseKeyListener.cpp +++ b/src/lib/efl/UiBaseKeyListener.cpp @@ -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) { } diff --git a/src/lib/efl/UiBaseViewmgr.cpp b/src/lib/efl/UiBaseViewmgr.cpp index eea2048..b822edb 100644 --- a/src/lib/efl/UiBaseViewmgr.cpp +++ b/src/lib/efl/UiBaseViewmgr.cpp @@ -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 _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 _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"); diff --git a/src/lib/efl/mobile/UiStandardView.cpp b/src/lib/efl/mobile/UiStandardView.cpp index e343e0c..919e1e8 100644 --- a/src/lib/efl/mobile/UiStandardView.cpp +++ b/src/lib/efl/mobile/UiStandardView.cpp @@ -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) { } diff --git a/src/lib/efl/mobile/UiView.cpp b/src/lib/efl/mobile/UiView.cpp index 38769e2..317fc42 100644 --- a/src/lib/efl/mobile/UiView.cpp +++ b/src/lib/efl/mobile/UiView.cpp @@ -34,8 +34,8 @@ class UiViewImpl friend class UiView; private: - UiView *_view; - UiMenu *_menu; + UiView *_view = NULL; + UiMenu *_menu = NULL; list _popupList; void _connectPopup(UiPopup *popup); diff --git a/src/lib/interface/UiIfaceApp.cpp b/src/lib/interface/UiIfaceApp.cpp index 441532f..a1ff436 100644 --- a/src/lib/interface/UiIfaceApp.cpp +++ b/src/lib/interface/UiIfaceApp.cpp @@ -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(); diff --git a/src/lib/interface/UiIfaceOverlay.cpp b/src/lib/interface/UiIfaceOverlay.cpp index 9b547ed..a1536ae 100644 --- a/src/lib/interface/UiIfaceOverlay.cpp +++ b/src/lib/interface/UiIfaceOverlay.cpp @@ -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) { } diff --git a/src/lib/interface/UiIfaceView.cpp b/src/lib/interface/UiIfaceView.cpp index b973ae6..87c6411 100644 --- a/src/lib/interface/UiIfaceView.cpp +++ b/src/lib/interface/UiIfaceView.cpp @@ -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() diff --git a/src/lib/interface/UiIfaceViewmgr.cpp b/src/lib/interface/UiIfaceViewmgr.cpp index 69dad97..167afe2 100644 --- a/src/lib/interface/UiIfaceViewmgr.cpp +++ b/src/lib/interface/UiIfaceViewmgr.cpp @@ -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 _viewList; //View list. - bool _activated; //Activated status of this viewmgr. - bool _destroying; //True, if viewmgr is on destroying. + list _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; }