port all Q_WS_* to Q_OS_* so that we are forward compatible with Qt5
authorkoda
Thu, 06 Jun 2013 15:55:10 +0200
changeset 9163 67334acaaac7
parent 9161 b2f02b083374
child 9165 7b0d5388abc4
port all Q_WS_* to Q_OS_* so that we are forward compatible with Qt5
QTfrontend/HWApplication.cpp
QTfrontend/hwform.cpp
QTfrontend/main.cpp
QTfrontend/ui/page/pagenet.cpp
QTfrontend/ui/page/pagevideos.cpp
QTfrontend/ui/widget/feedbackdialog.cpp
QTfrontend/ui/widget/roomnameprompt.cpp
QTfrontend/ui/widget/seedprompt.cpp
--- a/QTfrontend/HWApplication.cpp	Sun Jun 09 22:24:41 2013 +0400
+++ b/QTfrontend/HWApplication.cpp	Thu Jun 06 15:55:10 2013 +0200
@@ -23,11 +23,11 @@
 #include "hwform.h"
 #include "MessageDialog.h"
 
-#if !defined(Q_WS_WIN)
+#if !defined(Q_OS_WIN)
 #include "signal.h"
 #endif
 
-#if !defined(Q_WS_WIN)
+#if !defined(Q_OS_WIN)
 void terminateFrontend(int signal)
 {
     Q_UNUSED(signal);
@@ -38,7 +38,7 @@
 HWApplication::HWApplication(int &argc, char **argv) :
     QApplication(argc, argv)
 {
-#if !defined(Q_WS_WIN)
+#if !defined(Q_OS_WIN)
     signal(SIGINT, &terminateFrontend);
 #endif
 #if 0
--- a/QTfrontend/hwform.cpp	Sun Jun 09 22:24:41 2013 +0400
+++ b/QTfrontend/hwform.cpp	Thu Jun 06 15:55:10 2013 +0200
@@ -102,7 +102,7 @@
 #include "DataManager.h"
 #include "AutoUpdater.h"
 
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
 #define WINVER 0x0500
 #include <windows.h>
 #else
@@ -110,7 +110,7 @@
 #include <sys/types.h>
 #endif
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <sys/sysctl.h>
 #endif
 
@@ -1923,7 +1923,7 @@
 
     QString prefix = "\"" + datadir->absolutePath() + "\"";
     QString userPrefix = "\"" + cfgdir->absolutePath() + "\"";
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
     prefix = prefix.replace("/","\\");
     userPrefix = userPrefix.replace("/","\\");
 #endif
--- a/QTfrontend/main.cpp	Sun Jun 09 22:24:41 2013 +0400
+++ b/QTfrontend/main.cpp	Thu Jun 06 15:55:10 2013 +0200
@@ -135,7 +135,7 @@
     HWApplication app(argc, argv);
 
     QLabel *splash = NULL;
-#if defined Q_WS_WIN
+#if defined Q_OS_WIN
     QPixmap pixmap(":res/splash.png");
     splash = new QLabel(0, Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
     splash->setAttribute(Qt::WA_TranslucentBackground);
--- a/QTfrontend/ui/page/pagenet.cpp	Sun Jun 09 22:24:41 2013 +0400
+++ b/QTfrontend/ui/page/pagenet.cpp	Thu Jun 06 15:55:10 2013 +0200
@@ -73,7 +73,7 @@
     BtnNetSvrStart = formattedButton(QPushButton::tr("Start server"));
     BtnNetSvrStart->setMinimumWidth(180);
     QString serverPath = bindir->absolutePath() + "/hedgewars-server";
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
     serverPath += + ".exe";
 #endif
     QFile server(serverPath);
--- a/QTfrontend/ui/page/pagevideos.cpp	Sun Jun 09 22:24:41 2013 +0400
+++ b/QTfrontend/ui/page/pagevideos.cpp	Thu Jun 06 15:55:10 2013 +0200
@@ -414,7 +414,7 @@
             setName(item, newName);
         }
     }
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
     // there is a bug in qt, QDir::rename() doesn't fail on such names but damages files
     if (newName.contains(QRegExp("[\"*:<>?\\/|]")))
     {
--- a/QTfrontend/ui/widget/feedbackdialog.cpp	Sun Jun 09 22:24:41 2013 +0400
+++ b/QTfrontend/ui/widget/feedbackdialog.cpp	Thu Jun 06 15:55:10 2013 +0200
@@ -34,7 +34,7 @@
 
 #include <string>
 
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
 #define WINVER 0x0500
 #include <windows.h>
 #else
@@ -42,7 +42,7 @@
 #include <sys/types.h>
 #endif
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <sys/sysctl.h>
 #ifndef _SC_NPROCESSORS_ONLN
 #define _SC_NPROCESSORS_ONLN 58
@@ -207,7 +207,7 @@
     QString processor_name = "Processor: ";
 
     // platform specific code
-#ifdef Q_WS_MACX
+#ifdef Q_OS_MACX
     number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n";
 
     uint64_t memsize;
@@ -240,7 +240,7 @@
         default: os_version += "\"Unknown version\"\n"; break;
     }
 #endif
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
     SYSTEM_INFO sysinfo;
     GetSystemInfo(&sysinfo);
     number_of_cores += QString::number(sysinfo.dwNumberOfProcessors) + "\n";
@@ -262,7 +262,7 @@
     }
     kernel_line += "Windows kernel\n";
 #endif
-#ifdef Q_WS_X11
+#ifdef Q_OS_X11
     number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n";
     long pages = sysconf(_SC_PHYS_PAGES),
 /*
@@ -277,7 +277,7 @@
 #endif
 
     // uname -a
-#if defined(Q_WS_X11) || defined(Q_WS_MACX)
+#if defined(Q_OS_X11) || defined(Q_OS_MAC)
     QProcess *process = new QProcess();
     QStringList arguments = QStringList("-a");
     process->start("uname", arguments);
@@ -286,7 +286,7 @@
     delete process;
 #endif
 
-#if (!defined(Q_WS_MACX) && defined(__i386__)) || defined(__x86_64__)
+#if (!defined(Q_OS_MAC) && defined(__i386__)) || defined(__x86_64__)
     // cpu info
     quint32 registers[4];
     quint32 i;
--- a/QTfrontend/ui/widget/roomnameprompt.cpp	Sun Jun 09 22:24:41 2013 +0400
+++ b/QTfrontend/ui/widget/roomnameprompt.cpp	Thu Jun 06 15:55:10 2013 +0200
@@ -62,7 +62,7 @@
     QPushButton * btnOkay = new QPushButton(tr("Create room"));
     connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
     connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept()));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
         buttonLayout->addWidget(btnCancel);
         buttonLayout->addWidget(btnOkay);
 #else
--- a/QTfrontend/ui/widget/seedprompt.cpp	Sun Jun 09 22:24:41 2013 +0400
+++ b/QTfrontend/ui/widget/seedprompt.cpp	Thu Jun 06 15:55:10 2013 +0200
@@ -62,7 +62,7 @@
         QPushButton * btnOkay = new QPushButton(tr("Set seed"));
         connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
         connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept()));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
         buttonLayout->addWidget(btnCancel);
         buttonLayout->addWidget(btnOkay);
 #else