[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [WicdClientKDE] a6f9b96: Call the MainWindow destructor on exit.
From:       Anthony Vital <yesmichel () gmail ! com>
Date:       2010-12-23 13:05:12
Message-ID: 20101223130512.9FB43A6090 () git ! kde ! org
[Download RAW message or body]

commit a6f9b96a4af4c0668cce327846704bfb49805350
branch master
Author: Anthony Vital <yesmichel@gmail.com>
Date:   Thu Dec 23 14:04:41 2010 +0100

    Call the MainWindow destructor on exit.

diff --git a/main.cpp b/main.cpp
index 4239d40..1e9e05b 100644
--- a/main.cpp
+++ b/main.cpp
@@ -23,13 +23,25 @@
 
 #include "mainwindow.h"
 
-class MyApp : public KUniqueApplication
+class WicdClient : public KUniqueApplication
 {
 public:
-    MyApp() : KUniqueApplication() { KGlobal::ref(); }
-    ~MyApp() {}
+    WicdClient() : KUniqueApplication()
+    {
+        KGlobal::ref();
+        window = new MainWindow();
+        window->setObjectName("wicdclientkde");
+    }
+
+    ~WicdClient()
+    {
+        delete window;
+    }
 
     int newInstance() { return 0; }
+
+private:
+    MainWindow * window;
 };
 
 int main(int argc, char *argv[])
@@ -53,10 +65,7 @@ int main(int argc, char *argv[])
         return 0;
     }
 
-    MyApp app;
-
-    MainWindow *window = new MainWindow();
-    window->setObjectName("wicdclientkde");
+    WicdClient app;
 
     return app.exec();
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic