ui: initialize class-member variables
authorGiWoong Kim <giwoong.kim@samsung.com>
Mon, 26 Oct 2015 02:40:16 +0000 (11:40 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 29 Oct 2015 10:49:31 +0000 (19:49 +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 f7859ebb12172e76d80e897c7a387cd43bf9dafc..30f7fec3e2d17b3e3db19bab5ee306b40d456f2e 100644 (file)
@@ -59,7 +59,7 @@ class MenuItem
 {
 public:
     MenuItem(int type, QString name);
-    ~MenuItem();
+    virtual ~MenuItem();
 
     int getType();
     QString getName();
index 184e8b91c38088fd9c86b0c14488f1cbaf73b490..3bc303a37693186bde600d952c1be76d22b46d3e 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)