move signal handler in hwapplication
authorkoda
Sun, 10 Mar 2013 01:02:15 +0100
changeset 8708 6354b01d5500
parent 8707 404c18aed69f
child 8709 191bd86f97a1
move signal handler in hwapplication
QTfrontend/HWApplication.cpp
QTfrontend/main.cpp
--- a/QTfrontend/HWApplication.cpp	Sun Mar 10 00:40:00 2013 +0100
+++ b/QTfrontend/HWApplication.cpp	Sun Mar 10 01:02:15 2013 +0100
@@ -21,10 +21,20 @@
 
 #include "hwform.h"
 
+#if !defined(Q_WS_WIN)
+void terminateFrontend(int signal)
+{
+    Q_UNUSED(signal);
+    QCoreApplication::exit(0);
+}
+#endif
+
 HWApplication::HWApplication(int &argc,  char **argv):
     QApplication(argc, argv)
 {
-
+#if !defined(Q_WS_WIN)
+    signal(SIGINT, &terminateFrontend);
+#endif
 }
 
 bool HWApplication::event(QEvent *event)
--- a/QTfrontend/main.cpp	Sun Mar 10 00:40:00 2013 +0100
+++ b/QTfrontend/main.cpp	Sun Mar 10 01:02:15 2013 +0100
@@ -94,14 +94,7 @@
     else
         season = SEASON_NONE;
 }
-#ifndef _WIN32
-void terminateFrontend(int signal)
-{
-    Q_UNUSED(signal);
 
-    QCoreApplication::exit(0);
-}
-#endif
 
 bool checkForDir(const QString & dir)
 {
@@ -147,10 +140,6 @@
     cocoaInit = new CocoaInitializer(); // Creates the autoreleasepool preventing cocoa object leaks on OS X.
 #endif
 
-#ifndef _WIN32
-    signal(SIGINT, &terminateFrontend);
-#endif
-
     HWApplication app(argc, argv);
 
     QLabel *splash = NULL;