ui: initialize class-member variables
authorGiWoong Kim <giwoong.kim@samsung.com>
Mon, 26 Oct 2015 02:40:16 +0000 (11:40 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Mon, 9 Nov 2015 05:05:32 +0000 (14:05 +0900)
1. initialize class-member variables
2. delete unnecessary null checking

Change-Id: Ie20dfc5789f7d9be8cb08487c7bfe460507bcb2c
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/ui/displaybase.cpp
tizen/src/ui/menu/menuitem.h
tizen/src/ui/qt5_supplement.cpp

index 1ae658787a49b8209ca127a309acbcc994654844..9532f1f64f9c258b9f6c650aea3288032bbf5829 100644 (file)
@@ -57,15 +57,16 @@ DisplayBase::DisplayBase(DisplayType *displayForm, QSize resolution, qreal scale
     this->offGuide = NULL;
     this->offGuideShown = false;
 
+    this->isTouch = is_touchscreen_enabled();
+
+    /* touch screen */
     this->tsHelper = new TouchScreenHelper(this);
 
-    isTouch = is_touchscreen_enabled();
-    if (!isTouch) {
-        prevX = 0;
-        prevY = 0;
-        lastMouseTime.tv_sec = 0;
-        mouseStatus = MOUSE_LEAVE;
-    }
+    /* mouse */
+    this->prevX = 0;
+    this->prevY = 0;
+    this->lastMouseTime.tv_sec = 0;
+    this->mouseStatus = MOUSE_LEAVE;
 
     win->getMainView()->getKbdHelper()->setMtTracker(tsHelper->getMtTracker());
 
index f5dcea1c4e4f41975f510426c03f96c6ab520bc7..39d20ce12599dc005232823a4da8a8fc14b37430 100644 (file)
@@ -58,7 +58,7 @@ class MenuItem
 {
 public:
     MenuItem(int type, QString name);
-    ~MenuItem();
+    virtual ~MenuItem();
 
     int getType();
     QString getName();
index 59b31c7632660b6ea464ebd3f9bf2d491dd62c6a..e5a2035b8845bec13564822cc911fd1d8ec3a749 100644 (file)
@@ -299,16 +299,14 @@ void qt5_destroy()
     qt5App->processEvents(QEventLoop::ExcludeUserInputEvents);
     qt5App->quit();
 
-    if (mainwindow) {
-//      FIXME: It causes SIGSEGV now...
-//        delete mainwindow;
-        mainwindow = NULL;
-    }
+#if 0
+    //FIXME: It causes SIGSEGV now...
+    delete mainwindow;
+    mainwindow = NULL;
+#endif
 
-    if (uiInfo) {
-        delete uiInfo;
-        uiInfo = NULL;
-    }
+    delete uiInfo;
+    uiInfo = NULL;
 }
 
 void qt5_early_prepare(bool isOnscreen)