convert HW_DEV in ifdef DEBUG clauses
authorkoda
Mon, 04 Mar 2013 10:08:38 +0100
changeset 8635 c1c6b815691e
parent 8634 5dcb1dc9e01b
child 8636 fa8cd97a0a09
convert HW_DEV in ifdef DEBUG clauses
CMakeLists.txt
QTfrontend/hwconsts.cpp.in
QTfrontend/hwconsts.h
QTfrontend/net/tcpBase.cpp
QTfrontend/ui/page/pagemain.cpp
QTfrontend/ui_hwform.cpp
--- a/CMakeLists.txt	Sun Mar 03 20:59:27 2013 -0500
+++ b/CMakeLists.txt	Mon Mar 04 10:08:38 2013 +0100
@@ -236,8 +236,6 @@
 #get BUILD_TYPE and enable/disable optimisation
 message(STATUS "Using ${CMAKE_BUILD_TYPE} configuration")
 if(CMAKE_BUILD_TYPE MATCHES "DEBUG")
-    set(HW_DEV true) #becomes isDevBuild
-
     list(APPEND pascal_flags "-O-"              # disable all optimisations
                              "-g"               # enable debug symbols
                              "-gl"              # add line info to bt
@@ -245,8 +243,6 @@
                              )
     list(APPEND haskell_flags "-Wall" "-debug" "-dcore-lint" "-fno-warn-unused-do-bind")
 else()
-    set(HW_DEV false)
-
     list(APPEND pascal_flags "-Os"              # optimise for size
                              "-Xs"              # strip binary
                              "-Si"              # turn on inlining
--- a/QTfrontend/hwconsts.cpp.in	Sun Mar 03 20:59:27 2013 -0500
+++ b/QTfrontend/hwconsts.cpp.in	Mon Mar 04 10:08:38 2013 +0100
@@ -74,7 +74,6 @@
 quint16 netPort = NETGAME_DEFAULT_PORT;
 
 bool haveServer = ${HAVE_NETSERVER};
-bool isDevBuild = ${HW_DEV};
 
 int season = SEASON_NONE;
 int years_since_foundation = 0;
--- a/QTfrontend/hwconsts.h	Sun Mar 03 20:59:27 2013 -0500
+++ b/QTfrontend/hwconsts.h	Mon Mar 04 10:08:38 2013 +0100
@@ -51,7 +51,6 @@
 extern quint16 netPort;
 
 extern bool haveServer;
-extern bool isDevBuild;
 
 //Current season, SEASON_NONE by default
 extern int season;
--- a/QTfrontend/net/tcpBase.cpp	Sun Mar 03 20:59:27 2013 -0500
+++ b/QTfrontend/net/tcpBase.cpp	Mon Mar 04 10:08:38 2013 +0100
@@ -141,9 +141,10 @@
     connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(StartProcessError(QProcess::ProcessError)));
     QStringList arguments=getArguments();
 
+#ifdef DEBUG
     // redirect everything written on stdout/stderr
-    if(isDevBuild)
-        process->setProcessChannelMode(QProcess::ForwardedChannels);
+    process->setProcessChannelMode(QProcess::ForwardedChannels);
+#endif
 
     process->start(bindir->absolutePath() + "/hwengine", arguments);
 #endif
--- a/QTfrontend/ui/page/pagemain.cpp	Sun Mar 03 20:59:27 2013 -0500
+++ b/QTfrontend/ui/page/pagemain.cpp	Mon Mar 04 10:08:38 2013 +0100
@@ -127,17 +127,15 @@
 {
     initPage();
 
-    if(frontendEffects) setAttribute(Qt::WA_NoSystemBackground, true);
+    if(frontendEffects)
+        setAttribute(Qt::WA_NoSystemBackground, true);
     mainNote->setOpenExternalLinks(true);
 
-    if(!isDevBuild)
-    {
-        setDefautDescription(QLabel::tr("Tip: ") + randomTip());
-    }
-    else
-    {
-        setDefautDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete!"));
-    }
+#ifdef DEBUG
+    setDefautDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete!"));
+#else
+    setDefautDescription(QLabel::tr("Tip: ") + randomTip());
+#endif
 
 }
 
--- a/QTfrontend/ui_hwform.cpp	Sun Mar 03 20:59:27 2013 -0500
+++ b/QTfrontend/ui_hwform.cpp	Mon Mar 04 10:08:38 2013 +0100
@@ -54,9 +54,10 @@
     HWForm->setObjectName(QString::fromUtf8("HWForm"));
     HWForm->resize(QSize(640, 480).expandedTo(HWForm->minimumSizeHint()));
     HWForm->setMinimumSize(QSize(720, 450));
-    QString suffix = isDevBuild ?
-        QMainWindow::tr("-r%1 (%2)").arg(*cRevisionString, *cHashString) : QString("");
-    QString title = QMainWindow::tr("Hedgewars %1").arg(*cVersionString) + suffix;
+    QString title = QMainWindow::tr("Hedgewars %1").arg(*cVersionString);
+#ifdef DEBUG
+    title += QMainWindow::tr("-r%1 (%2)").arg(*cRevisionString, *cHashString);
+#endif
     HWForm->setWindowTitle(title);
     centralWidget = new QWidget(HWForm);
     centralWidget->setObjectName(QString::fromUtf8("centralWidget"));