diff options
author | Stefan Hacker <dd0t@users.sourceforge.net> | 2014-08-22 03:55:34 +0400 |
---|---|---|
committer | Stefan Hacker <dd0t@users.sourceforge.net> | 2014-08-22 03:55:34 +0400 |
commit | 12eb26431f03f5ed3c634d647b1581572039112d (patch) | |
tree | a827af54d07919cae8cce5135d5652c76537156c /src | |
parent | 4efabcea5c5f6aff6de5d69500044429e8d9c053 (diff) |
Replace all uses of QT_VERSION_CHECK with explicit version.
Qt4's moc is not able to expand QT_VERSION_CHECK which may lead
to invalid codegen when used for backwards compatibility work.
Replaced all occurances with explicit check against numeric
version which are treated correctly. Even though bad interactions
might be rare we should no longer use this macro as long as we
want to compile with Qt 4. Also see:
http://lists.qt-project.org/pipermail/interest/2013-August/008351.html
Diffstat (limited to 'src')
49 files changed, 82 insertions, 82 deletions
diff --git a/src/Connection.h b/src/Connection.h index 7f8922337..53518ecb2 100644 --- a/src/Connection.h +++ b/src/Connection.h @@ -106,7 +106,7 @@ class Connection : public QObject { #endif }; -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION < 0x050000 Q_DECLARE_METATYPE(QAbstractSocket::SocketError) #endif diff --git a/src/SSL.cpp b/src/SSL.cpp index f278b3403..1f0f14060 100644 --- a/src/SSL.cpp +++ b/src/SSL.cpp @@ -158,7 +158,7 @@ void MumbleSSL::addSystemCA() { QList<QSslCertificate> filteredCaList; foreach (QSslCertificate cert, caList) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QStringList orgs = cert.subjectInfo(QSslCertificate::Organization); bool skip = false; foreach (QString ou, orgs) { diff --git a/src/mumble/About.h b/src/mumble/About.h index 06cc19710..e77047cdb 100644 --- a/src/mumble/About.h +++ b/src/mumble/About.h @@ -33,7 +33,7 @@ #include <QtCore/QtGlobal> #include <QtCore/QObject> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QDialog> #else # include <QtGui/QDialog> diff --git a/src/mumble/AudioStats.h b/src/mumble/AudioStats.h index b1fb6ea75..3a30825d6 100644 --- a/src/mumble/AudioStats.h +++ b/src/mumble/AudioStats.h @@ -34,7 +34,7 @@ #include <QtCore/QtGlobal> #include <QtCore/QList> #include <QtCore/QTimer> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QWidget> #else # include <QtGui/QWidget> diff --git a/src/mumble/AudioWizard.h b/src/mumble/AudioWizard.h index f307b536e..7b85571ee 100644 --- a/src/mumble/AudioWizard.h +++ b/src/mumble/AudioWizard.h @@ -32,7 +32,7 @@ #define MUMBLE_MUMBLE_AUDIOWIZARD_H_ #include <QtCore/QtGlobal> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QWizard> # include <QtWidgets/QWizardPage> #else diff --git a/src/mumble/Cert.cpp b/src/mumble/Cert.cpp index df9d65dd4..c4096fcff 100644 --- a/src/mumble/Cert.cpp +++ b/src/mumble/Cert.cpp @@ -85,7 +85,7 @@ void CertView::setCert(const QList<QSslCertificate> &cert) { } else { QSslCertificate qscCert = qlCert.at(0); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 const QStringList &names = qscCert.subjectInfo(QSslCertificate::CommonName); QString name; if (names.count() > 0) { @@ -117,7 +117,7 @@ void CertView::setCert(const QList<QSslCertificate> &cert) { if (qlCert.count() > 1) qscCert = qlCert.last(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 const QStringList &issuerNames = qscCert.issuerInfo(QSslCertificate::CommonName); QString issuerName; if (issuerNames.count() > 0) { diff --git a/src/mumble/Cert.h b/src/mumble/Cert.h index 990df0e2d..d3094741e 100644 --- a/src/mumble/Cert.h +++ b/src/mumble/Cert.h @@ -33,7 +33,7 @@ #include <QtCore/QtGlobal> #include <QtCore/QString> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QGroupBox> #else # include <QtGui/QGroupBox> diff --git a/src/mumble/ConfigDialog_macx.mm b/src/mumble/ConfigDialog_macx.mm index 2d71f9392..64f847608 100644 --- a/src/mumble/ConfigDialog_macx.mm +++ b/src/mumble/ConfigDialog_macx.mm @@ -37,7 +37,7 @@ #include "Global.h" -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 #include <qpa/qplatformnativeinterface.h> static NSWindow *qt_mac_window_for(QWidget *w) { @@ -101,7 +101,7 @@ ConfigDialogMac::ConfigDialogMac(QWidget *p) : QDialog(p) { "To restore all settings to their defaults, you will have to use this button on every page." )); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QTimer::singleShot(0, this, SLOT(delayedInit())); #else delayedInit(); diff --git a/src/mumble/ConfigWidget.h b/src/mumble/ConfigWidget.h index 89ec085c4..ed6f59a14 100644 --- a/src/mumble/ConfigWidget.h +++ b/src/mumble/ConfigWidget.h @@ -34,7 +34,7 @@ #include <QtCore/QtGlobal> #include <QtCore/QObject> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QWidget> #else # include <QtGui/QWidget> diff --git a/src/mumble/ConnectDialog.cpp b/src/mumble/ConnectDialog.cpp index 19c7336a3..faebee0b8 100644 --- a/src/mumble/ConnectDialog.cpp +++ b/src/mumble/ConnectDialog.cpp @@ -369,7 +369,7 @@ ServerItem *ServerItem::fromMimeData(const QMimeData *mime, QWidget *p) { return NULL; QUrl url; -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QUrlQuery query(url); #endif if (mime->hasUrls() && ! mime->urls().isEmpty()) @@ -411,7 +411,7 @@ ServerItem *ServerItem::fromMimeData(const QMimeData *mime, QWidget *p) { url.setUserName(g.s.qsUsername); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 if (! query.hasQueryItem(QLatin1String("title"))) query.addQueryItem(QLatin1String("title"), url.host()); @@ -611,7 +611,7 @@ QMimeData *ServerItem::toMimeData(const QString &name, const QString &host, unsi url.setPort(port); url.setPath(channel); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QUrlQuery query; query.addQueryItem(QLatin1String("title"), name); query.addQueryItem(QLatin1String("version"), QLatin1String("1.2.0")); @@ -813,7 +813,7 @@ ConnectDialog::ConnectDialog(QWidget *p, bool autoconnect) : QDialog(p), bAutoCo qtwServers->sortItems(1, Qt::AscendingOrder); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qtwServers->header()->setSectionResizeMode(0, QHeaderView::Stretch); qtwServers->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); qtwServers->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); @@ -1190,7 +1190,7 @@ void ConnectDialog::initList() { QUrl url; url.setPath(QLatin1String("/list2.cgi")); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QUrlQuery query; query.addQueryItem(QLatin1String("version"), QLatin1String(MUMTEXT(MUMBLE_VERSION_STRING))); url.setQuery(query); diff --git a/src/mumble/ConnectDialog.h b/src/mumble/ConnectDialog.h index f4c683d3f..88e719fc9 100644 --- a/src/mumble/ConnectDialog.h +++ b/src/mumble/ConnectDialog.h @@ -39,7 +39,7 @@ #include <QtCore/QtGlobal> #include <QtCore/QString> #include <QtCore/QUrl> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QTreeWidget> #else # include <QtGui/QTreeWidget> diff --git a/src/mumble/CrashReporter.h b/src/mumble/CrashReporter.h index 7ea4e1777..57c9c29d2 100644 --- a/src/mumble/CrashReporter.h +++ b/src/mumble/CrashReporter.h @@ -35,7 +35,7 @@ #include <QtCore/QEventLoop> #include <QtNetwork/QNetworkReply> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QDialog> # include <QtWidgets/QProgressDialog> # include <QtWidgets/QLineEdit> diff --git a/src/mumble/CustomElements.h b/src/mumble/CustomElements.h index 195cd473c..aaec47154 100644 --- a/src/mumble/CustomElements.h +++ b/src/mumble/CustomElements.h @@ -34,7 +34,7 @@ #include <QtCore/QObject> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QLabel> # include <QtWidgets/QTextBrowser> # include <QtWidgets/QTextEdit> diff --git a/src/mumble/DBus.cpp b/src/mumble/DBus.cpp index 86ac0de8f..24cd2cac9 100644 --- a/src/mumble/DBus.cpp +++ b/src/mumble/DBus.cpp @@ -68,7 +68,7 @@ void MumbleDBus::getCurrentUrl(const QDBusMessage &msg) { u.setPort(port); u.setUserName(user); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QUrlQuery query; query.addQueryItem(QLatin1String("version"), QLatin1String("1.2.0")); u.setQuery(query); diff --git a/src/mumble/Database.cpp b/src/mumble/Database.cpp index 321f9db44..000472409 100644 --- a/src/mumble/Database.cpp +++ b/src/mumble/Database.cpp @@ -68,7 +68,7 @@ Database::Database() { int i; datapaths << g.qdBasePath.absolutePath(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 datapaths << QStandardPaths::writableLocation(QStandardPaths::DataLocation); #else datapaths << QDesktopServices::storageLocation(QDesktopServices::DataLocation); diff --git a/src/mumble/Global.cpp b/src/mumble/Global.cpp index c3931a056..026aa966b 100644 --- a/src/mumble/Global.cpp +++ b/src/mumble/Global.cpp @@ -37,7 +37,7 @@ Global *Global::g_global_struct; static void migrateDataDir() { #ifdef Q_OS_MAC QString olddir = QDir::homePath() + QLatin1String("/Library/Preferences/Mumble"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QString newdir = QStandardPaths::writableLocation(QStandardPaths::DataLocation); #else QString newdir = QDesktopServices::storageLocation(QDesktopServices::DataLocation); @@ -112,7 +112,7 @@ Global::Global() { QStringList qsl; qsl << QCoreApplication::instance()->applicationDirPath(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qsl << QStandardPaths::writableLocation(QStandardPaths::DataLocation); #else qsl << QDesktopServices::storageLocation(QDesktopServices::DataLocation); @@ -146,7 +146,7 @@ Global::Global() { qdBasePath.setPath(appdata); #else migrateDataDir(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qdBasePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation); #else qdBasePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation); diff --git a/src/mumble/GlobalShortcut.cpp b/src/mumble/GlobalShortcut.cpp index 07bb9ba5d..3be7f0fac 100644 --- a/src/mumble/GlobalShortcut.cpp +++ b/src/mumble/GlobalShortcut.cpp @@ -541,7 +541,7 @@ GlobalShortcutConfig::GlobalShortcutConfig(Settings &st) : ConfigWidget(st) { qtwShortcuts->setColumnCount(canSuppress ? 4 : 3); qtwShortcuts->setItemDelegate(new ShortcutDelegate(qtwShortcuts)); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qtwShortcuts->header()->setSectionResizeMode(0, QHeaderView::Fixed); qtwShortcuts->header()->resizeSection(0, 150); qtwShortcuts->header()->setSectionResizeMode(2, QHeaderView::Stretch); diff --git a/src/mumble/GlobalShortcut.h b/src/mumble/GlobalShortcut.h index 154bcaa72..1d127cb82 100644 --- a/src/mumble/GlobalShortcut.h +++ b/src/mumble/GlobalShortcut.h @@ -34,7 +34,7 @@ #include <QtCore/QtGlobal> #include <QtCore/QThread> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QToolButton> # include <QtWidgets/QStyledItemDelegate> #else diff --git a/src/mumble/Log.cpp b/src/mumble/Log.cpp index d8d415cc2..b4dd7b153 100644 --- a/src/mumble/Log.cpp +++ b/src/mumble/Log.cpp @@ -52,7 +52,7 @@ static ConfigRegistrar registrar(4000, LogConfigDialogNew); LogConfig::LogConfig(Settings &st) : ConfigWidget(st) { setupUi(this); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qtwMessages->header()->setSectionResizeMode(ColMessage, QHeaderView::Stretch); qtwMessages->header()->setSectionResizeMode(ColConsole, QHeaderView::ResizeToContents); qtwMessages->header()->setSectionResizeMode(ColNotification, QHeaderView::ResizeToContents); diff --git a/src/mumble/MainWindow.cpp b/src/mumble/MainWindow.cpp index 85d0e8486..ab1101cc6 100644 --- a/src/mumble/MainWindow.cpp +++ b/src/mumble/MainWindow.cpp @@ -147,7 +147,7 @@ MainWindow::MainWindow(QWidget *p) : QMainWindow(p) { qwPTTButtonWidget = NULL; -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION < 0x050000 cuContextUser = QWeakPointer<ClientUser>(); cContextChannel = QWeakPointer<Channel>(); #endif @@ -657,7 +657,7 @@ void MainWindow::openUrl(const QUrl &url) { minor = 2; patch = 0; -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QUrlQuery query(url); QString version = query.queryItemValue(QLatin1String("version")); #else @@ -681,7 +681,7 @@ void MainWindow::openUrl(const QUrl &url) { qsDesiredChannel = url.path(); QString name; -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 if (query.hasQueryItem(QLatin1String("title"))) name = query.queryItemValue(QLatin1String("title")); #else @@ -1533,7 +1533,7 @@ void MainWindow::sendChatbarMessage(QString qsText) { ClientUser *p = pmModel->getUser(qtvUsers->currentIndex()); Channel *c = pmModel->getChannel(qtvUsers->currentIndex()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qsText = qsText.toHtmlEscaped(); #else qsText = Qt::escape(qsText); @@ -2852,7 +2852,7 @@ QPair<QByteArray, QImage> MainWindow::openImageFile() { QPair<QByteArray, QImage> retval; if (g.s.qsImagePath.isEmpty() || ! QDir::root().exists(g.s.qsImagePath)) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 g.s.qsImagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); #else g.s.qsImagePath = QDesktopServices::storageLocation(QDesktopServices::PicturesLocation); diff --git a/src/mumble/Overlay.h b/src/mumble/Overlay.h index 91884a513..7dff8f6a9 100644 --- a/src/mumble/Overlay.h +++ b/src/mumble/Overlay.h @@ -34,7 +34,7 @@ #include <QtCore/QtGlobal> #include <QtCore/QUrl> #include <QtNetwork/QLocalSocket> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QGraphicsItem> #else # include <QtGui/QGraphicsItem> diff --git a/src/mumble/OverlayClient.cpp b/src/mumble/OverlayClient.cpp index e1aa11b4a..c78a01067 100644 --- a/src/mumble/OverlayClient.cpp +++ b/src/mumble/OverlayClient.cpp @@ -142,7 +142,7 @@ void OverlayClient::updateMouse() { QPixmap pm; HICON c = ::GetCursor(); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION < 0x050000 if (c == NULL) c = qgv.viewport()->cursor().handle(); #endif @@ -150,7 +150,7 @@ void OverlayClient::updateMouse() { ICONINFO info; ZeroMemory(&info, sizeof(info)); if (c != NULL && ::GetIconInfo(c, &info)) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 extern QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int format = 0); #else # define qt_pixmapFromWinHBITMAP(bmp) QPixmap::fromWinHBITMAP(bmp) @@ -200,7 +200,7 @@ void OverlayClient::updateMouse() { } #endif -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) && (defined(Q_OS_WIN) || defined(Q_OS_MAC)) +#if QT_VERSION < 0x050000 && (defined(Q_OS_WIN) || defined(Q_OS_MAC)) extern bool Q_GUI_EXPORT qt_use_native_dialogs; #endif @@ -209,7 +209,7 @@ extern bool Q_GUI_EXPORT qt_use_native_dialogs; // that we're about to reparent. void OverlayClient::showGui() { -#if defined(QT3_SUPPORT) || (defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) +#if defined(QT3_SUPPORT) || (defined(Q_OS_WIN) && QT_VERSION < 0x050000) if (QCoreApplication::loopLevel() > 1) return; #else @@ -299,7 +299,7 @@ outer: setupScene(true); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) && (defined(Q_OS_WIN) || defined(Q_OS_MAC)) +#if QT_VERSION < 0x050000 && (defined(Q_OS_WIN) || defined(Q_OS_MAC)) qt_use_native_dialogs = false; #endif @@ -314,7 +314,7 @@ outer: } void OverlayClient::hideGui() { -#if defined(QT3_SUPPORT) || (defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) +#if defined(QT3_SUPPORT) || (defined(Q_OS_WIN) && QT_VERSION < 0x050000) if (QCoreApplication::loopLevel() > 1) { QCoreApplication::exit_loop(); QMetaObject::invokeMethod(this, "hideGui", Qt::QueuedConnection); @@ -379,7 +379,7 @@ void OverlayClient::hideGui() { setupScene(false); qgv.setAttribute(Qt::WA_WState_Hidden, true); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) && (defined(Q_OS_WIN) || defined(Q_OS_MAC)) +#if QT_VERSION < 0x050000 && (defined(Q_OS_WIN) || defined(Q_OS_MAC)) qt_use_native_dialogs = true; #endif diff --git a/src/mumble/OverlayConfig.cpp b/src/mumble/OverlayConfig.cpp index cd860ae08..155e649e3 100644 --- a/src/mumble/OverlayConfig.cpp +++ b/src/mumble/OverlayConfig.cpp @@ -239,7 +239,7 @@ OverlayAppInfo OverlayConfig::applicationInfoForId(const QString &identifier) { #elif defined(Q_OS_WIN) HICON icon = ExtractIcon(qWinAppInst(), identifier.toStdWString().c_str(), 0); if (icon) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 extern QPixmap qt_pixmapFromWinHICON(HICON icon); qiAppIcon = QIcon(qt_pixmapFromWinHICON(icon)); #else diff --git a/src/mumble/OverlayEditorScene.h b/src/mumble/OverlayEditorScene.h index 613df49c9..642ef5ba7 100644 --- a/src/mumble/OverlayEditorScene.h +++ b/src/mumble/OverlayEditorScene.h @@ -32,7 +32,7 @@ #define MUMBLE_MUMBLE_OVERLAYEDITORSCENE_H_ #include <QtCore/QtGlobal> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QGraphicsScene> #else # include <QtGui/QGraphicsScene> diff --git a/src/mumble/Overlay_macx.mm b/src/mumble/Overlay_macx.mm index 8535e7c93..063286ac3 100644 --- a/src/mumble/Overlay_macx.mm +++ b/src/mumble/Overlay_macx.mm @@ -210,7 +210,7 @@ void OverlayClient::updateMouse() { } } -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION < 0x050000 if (cgimg) { pm = QPixmap::fromMacCGImageRef(cgimg); qmCursors.insert(csShape, pm); diff --git a/src/mumble/Plugins.cpp b/src/mumble/Plugins.cpp index 2daf85777..81ed3b26a 100644 --- a/src/mumble/Plugins.cpp +++ b/src/mumble/Plugins.cpp @@ -83,7 +83,7 @@ PluginFetchMeta::PluginFetchMeta(const QString &hash, const QString &path) : has PluginConfig::PluginConfig(Settings &st) : ConfigWidget(st) { setupUi(this); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qtwPlugins->header()->setSectionResizeMode(0, QHeaderView::Stretch); qtwPlugins->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents); #else @@ -518,7 +518,7 @@ void Plugins::checkUpdates() { #ifdef QT_NO_DEBUG -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QUrlQuery query; query.setQueryItems(queryItems); url.setQuery(query); diff --git a/src/mumble/RichTextEditor.cpp b/src/mumble/RichTextEditor.cpp index 73c30af5c..886996e47 100644 --- a/src/mumble/RichTextEditor.cpp +++ b/src/mumble/RichTextEditor.cpp @@ -145,7 +145,7 @@ void RichTextHtmlEdit::insertFromMimeData(const QMimeData *source) { if (! uri.isEmpty()) { if (title.isEmpty()) title = uri; -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 uri = uri.toHtmlEscaped(); title = title.toHtmlEscaped(); #else @@ -178,7 +178,7 @@ QString RichTextEditorLink::text() const { QUrl url(qleUrl->text(), QUrl::StrictMode); QString txt = qleText->text(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 txt = txt.toHtmlEscaped(); #else txt = Qt::escape(txt); diff --git a/src/mumble/RichTextEditor.h b/src/mumble/RichTextEditor.h index d57c872e1..c2d5b29e0 100644 --- a/src/mumble/RichTextEditor.h +++ b/src/mumble/RichTextEditor.h @@ -32,7 +32,7 @@ #define MUMBLE_MUMBLE_RICHTEXTEDITOR_H_ #include <QtCore/QtGlobal> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QTextEdit> #else # include <QtGui/QTextEdit> diff --git a/src/mumble/ServerHandler.cpp b/src/mumble/ServerHandler.cpp index 0c85996ee..53a46c51a 100644 --- a/src/mumble/ServerHandler.cpp +++ b/src/mumble/ServerHandler.cpp @@ -293,7 +293,7 @@ void ServerHandler::run() { bUdp = false; -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qtsSock->setProtocol(QSsl::TlsV1_0); #else qtsSock->setProtocol(QSsl::TlsV1); diff --git a/src/mumble/Settings.cpp b/src/mumble/Settings.cpp index fe6151c30..219697418 100644 --- a/src/mumble/Settings.cpp +++ b/src/mumble/Settings.cpp @@ -300,7 +300,7 @@ Settings::Settings() { bPluginCheck = true; #endif -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qsImagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); #else qsImagePath = QDesktopServices::storageLocation(QDesktopServices::PicturesLocation); @@ -375,7 +375,7 @@ Settings::Settings() { bHighContrast = false; // Recording -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qsRecordingPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); #else qsRecordingPath = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); diff --git a/src/mumble/SocketRPC.cpp b/src/mumble/SocketRPC.cpp index c29755841..60492d2d1 100644 --- a/src/mumble/SocketRPC.cpp +++ b/src/mumble/SocketRPC.cpp @@ -159,7 +159,7 @@ void SocketRPCClient::processXml() { u.setPort(port); u.setUserName(user); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QUrlQuery query; query.addQueryItem(QLatin1String("version"), QLatin1String("1.2.0")); u.setQuery(query); diff --git a/src/mumble/TaskList.cpp b/src/mumble/TaskList.cpp index 375d13c40..d5b6c258b 100644 --- a/src/mumble/TaskList.cpp +++ b/src/mumble/TaskList.cpp @@ -58,7 +58,7 @@ void TaskList::addToRecentList(QString name, QString user, QString host, int por url.setHost(host); url.setPort(port); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QUrlQuery query; query.addQueryItem(QLatin1String("title"), name); query.addQueryItem(QLatin1String("version"), QLatin1String("1.2.0")); diff --git a/src/mumble/UserEdit.cpp b/src/mumble/UserEdit.cpp index 9afbdcbac..49aaef77e 100644 --- a/src/mumble/UserEdit.cpp +++ b/src/mumble/UserEdit.cpp @@ -64,7 +64,7 @@ UserEdit::UserEdit(const MumbleProto::UserList &userList, QWidget *parent) qtvUserList->setFocus(); qtvUserList->setContextMenuPolicy(Qt::CustomContextMenu); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qtvUserList->header()->setSectionResizeMode(UserListModel::COL_NICK, QHeaderView::Stretch); qtvUserList->header()->setSectionResizeMode(UserListModel::COL_INACTIVEDAYS, QHeaderView::ResizeToContents); qtvUserList->header()->setSectionResizeMode(UserListModel::COL_LASTCHANNEL, QHeaderView::Stretch); diff --git a/src/mumble/UserInformation.cpp b/src/mumble/UserInformation.cpp index 0ceb01533..97f6a8ffa 100644 --- a/src/mumble/UserInformation.cpp +++ b/src/mumble/UserInformation.cpp @@ -137,7 +137,7 @@ void UserInformation::update(const MumbleProto::UserStats &msg) { const QSslCertificate &cert = qlCerts.last(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 const QMultiMap<QSsl::AlternativeNameEntryType, QString> &alts = cert.subjectAlternativeNames(); #else const QMultiMap<QSsl::AlternateNameEntryType, QString> &alts = cert.alternateSubjectNames(); diff --git a/src/mumble/UserView.cpp b/src/mumble/UserView.cpp index 42b40fe18..ef97dee68 100644 --- a/src/mumble/UserView.cpp +++ b/src/mumble/UserView.cpp @@ -385,7 +385,7 @@ void UserView::updateChannel(const QModelIndex &idx) { } } -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 void UserView::dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> &) #else void UserView::dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight) diff --git a/src/mumble/UserView.h b/src/mumble/UserView.h index 33d91bb30..bc2fa8036 100644 --- a/src/mumble/UserView.h +++ b/src/mumble/UserView.h @@ -32,7 +32,7 @@ #define MUMBLE_MUMBLE_USERVIEW_H_ #include <QtCore/QtGlobal> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QStyledItemDelegate> # include <QtWidgets/QTreeView> #else @@ -77,7 +77,7 @@ class UserView : public QTreeView { public: UserView(QWidget *); void keyboardSearch(const QString &search); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 void dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles = QVector<int> ()); #else void dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight); diff --git a/src/mumble/VersionCheck.cpp b/src/mumble/VersionCheck.cpp index d2456d38b..30a0bb6c8 100644 --- a/src/mumble/VersionCheck.cpp +++ b/src/mumble/VersionCheck.cpp @@ -82,7 +82,7 @@ VersionCheck::VersionCheck(bool autocheck, QObject *p, bool focus) : QObject(p) } } -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QUrlQuery query; query.setQueryItems(queryItems); url.setQuery(query); diff --git a/src/mumble/ViewCert.cpp b/src/mumble/ViewCert.cpp index 1689a6dfc..dc08f5ecc 100644 --- a/src/mumble/ViewCert.cpp +++ b/src/mumble/ViewCert.cpp @@ -100,7 +100,7 @@ void ViewCert::on_Chain_currentRowChanged(int idx) { l << tr("Public Key: %1 bits %2").arg(c.publicKey().length()).arg((c.publicKey().algorithm() == QSsl::Rsa) ? tr("RSA") : tr("DSA")); l << tr("Digest (SHA-1): %1").arg(QString::fromLatin1(c.digest(QCryptographicHash::Sha1).toHex())); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 const QMultiMap<QSsl::AlternativeNameEntryType, QString> &alts = c.subjectAlternativeNames(); QMultiMap<QSsl::AlternativeNameEntryType, QString>::const_iterator i; #else diff --git a/src/mumble/ViewCert.h b/src/mumble/ViewCert.h index d00c1da97..53d829a16 100644 --- a/src/mumble/ViewCert.h +++ b/src/mumble/ViewCert.h @@ -34,7 +34,7 @@ #include <QtCore/QtGlobal> #include <QtCore/QObject> #include <QtCore/QList> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QDialog> #else # include <QtGui/QDialog> diff --git a/src/mumble/main.cpp b/src/mumble/main.cpp index 9253f45b2..2581c780d 100644 --- a/src/mumble/main.cpp +++ b/src/mumble/main.cpp @@ -57,7 +57,7 @@ #include "SocketRPC.h" #include "MumbleApplication.h" -#if defined(USE_STATIC_QT_PLUGINS) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +#if defined(USE_STATIC_QT_PLUGINS) && QT_VERSION < 0x050000 Q_IMPORT_PLUGIN(qtaccessiblewidgets) Q_IMPORT_PLUGIN(qico) Q_IMPORT_PLUGIN(qsvg) @@ -102,7 +102,7 @@ int main(int argc, char **argv) { a.setOrganizationDomain(QLatin1String("mumble.sourceforge.net")); a.setQuitOnLastWindowClosed(false); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && defined(Q_OS_WIN) +#if QT_VERSION >= 0x050000 && defined(Q_OS_WIN) a.installNativeEventFilter(&a); #endif @@ -380,7 +380,7 @@ int main(int argc, char **argv) { g.s.uiUpdateCounter = 2; if (! CertWizard::validateCert(g.s.kpCertificate)) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QDir qd(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)); #else QDir qd(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)); diff --git a/src/mumble/mumble_pch.hpp b/src/mumble/mumble_pch.hpp index 6124d52e8..7ed7512ae 100644 --- a/src/mumble/mumble_pch.hpp +++ b/src/mumble/mumble_pch.hpp @@ -28,7 +28,7 @@ #include <QtCore/QtCore> #include <QtGui/QtGui> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include "Qt4Compat.h" # include <QtWidgets/QtWidgets> #endif diff --git a/src/mumble/os_macx.mm b/src/mumble/os_macx.mm index 710c5f328..10ed49a43 100644 --- a/src/mumble/os_macx.mm +++ b/src/mumble/os_macx.mm @@ -79,7 +79,7 @@ static void mumbleMessageOutput(QtMsgType type, const char *msg) { mumbleMessageOutputQString(type, QString::fromUtf8(msg)); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 static void mumbleMessageOutputWithContext(QtMsgType type, const QMessageLogContext &ctx, const QString &msg) { Q_UNUSED(ctx); mumbleMessageOutputQString(type, msg); @@ -164,7 +164,7 @@ void os_init() { strcat(buff, logpath); fConsole = fopen(buff, "a+"); if (fConsole) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qInstallMessageHandler(mumbleMessageOutputWithContext); #else qInstallMsgHandler(mumbleMessageOutput); diff --git a/src/mumble/os_win.cpp b/src/mumble/os_win.cpp index 92f9d8b07..50c1ecf9a 100644 --- a/src/mumble/os_win.cpp +++ b/src/mumble/os_win.cpp @@ -30,7 +30,7 @@ #include "mumble_pch.hpp" -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <qpa/qplatformnativeinterface.h> #endif @@ -88,7 +88,7 @@ static void mumbleMessageOutput(QtMsgType type, const char *msg) { mumbleMessageOutputQString(type, QString::fromUtf8(msg)); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 static void mumbleMessageOutputWithContext(QtMsgType type, const QMessageLogContext &ctx, const QString &msg) { Q_UNUSED(ctx); mumbleMessageOutputQString(type, msg); @@ -250,7 +250,7 @@ void os_init() { fConsole = _wfsopen(console.toStdWString().c_str(), L"a+", _SH_DENYWR); if (fConsole) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qInstallMessageHandler(mumbleMessageOutputWithContext); #else qInstallMsgHandler(mumbleMessageOutput); @@ -330,7 +330,7 @@ DWORD WinVerifySslCert(const QByteArray& cert) { } HWND MumbleHWNDForQWidget(QWidget *widget) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QWindow *window = widget->windowHandle(); if (window == NULL) { QWidget *npw = widget->nativeParentWidget(); diff --git a/src/murmur/Cert.cpp b/src/murmur/Cert.cpp index 2f2c36f74..cf08ebfb1 100644 --- a/src/murmur/Cert.cpp +++ b/src/murmur/Cert.cpp @@ -117,7 +117,7 @@ void Server::initializeCert() { } QString issuer; -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QStringList issuerNames = qscCert.issuerInfo(QSslCertificate::CommonName); if (! issuerNames.isEmpty()) { issuer = issuerNames.first(); diff --git a/src/murmur/Meta.cpp b/src/murmur/Meta.cpp index e15834c12..4bd0bbbe4 100644 --- a/src/murmur/Meta.cpp +++ b/src/murmur/Meta.cpp @@ -125,7 +125,7 @@ void MetaParams::read(QString fname) { QStringList datapaths; #if defined(Q_OS_WIN) -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 datapaths << QStandardPaths::writableLocation(QStandardPaths::DataLocation); #else datapaths << QDesktopServices::storageLocation(QDesktopServices::DataLocation); diff --git a/src/murmur/Server.cpp b/src/murmur/Server.cpp index dce502c11..3bdccdb1f 100644 --- a/src/murmur/Server.cpp +++ b/src/murmur/Server.cpp @@ -1148,7 +1148,7 @@ void Server::newClient() { u->setToS(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 sock->setProtocol(QSsl::TlsV1_0); #else sock->setProtocol(QSsl::TlsV1); @@ -1176,14 +1176,14 @@ void Server::encrypted() { QList<QSslCertificate> certs = uSource->peerCertificateChain(); if (!certs.isEmpty()) { const QSslCertificate &cert = certs.last(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 uSource->qslEmail = cert.subjectAlternativeNames().values(QSsl::EmailEntry); #else uSource->qslEmail = cert.alternateSubjectNames().values(QSsl::EmailEntry); #endif uSource->qsHash = cert.digest(QCryptographicHash::Sha1).toHex(); if (! uSource->qslEmail.isEmpty() && uSource->bVerified) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 QString subject; QString issuer; diff --git a/src/murmur/Tray.h b/src/murmur/Tray.h index 5ceb407d6..6dd4220dc 100644 --- a/src/murmur/Tray.h +++ b/src/murmur/Tray.h @@ -34,7 +34,7 @@ #include <QtCore/QStringList> #include <QtCore/QObject> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include <QtWidgets/QSystemTrayIcon> #else # include <QtGui/QSystemTrayIcon> diff --git a/src/murmur/main.cpp b/src/murmur/main.cpp index 5c31872af..a004399a4 100644 --- a/src/murmur/main.cpp +++ b/src/murmur/main.cpp @@ -154,7 +154,7 @@ static void murmurMessageOutput(QtMsgType type, const char *msg) { murmurMessageOutputQString(type, QString::fromUtf8(msg)); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 static void murmurMessageOutputWithContext(QtMsgType type, const QMessageLogContext &ctx, const QString &msg) { Q_UNUSED(ctx); murmurMessageOutputQString(type, msg); @@ -210,7 +210,7 @@ int main(int argc, char **argv) { a.setOrganizationDomain("mumble.sourceforge.net"); QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION < 0x050000 QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); #endif @@ -239,7 +239,7 @@ int main(int argc, char **argv) { #endif qsrand(QDateTime::currentDateTime().toTime_t()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qInstallMessageHandler(murmurMessageOutputWithContext); #else qInstallMsgHandler(murmurMessageOutput); @@ -530,7 +530,7 @@ int main(int argc, char **argv) { delete meta; -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 qInstallMessageHandler(NULL); #else qInstallMsgHandler(NULL); diff --git a/src/murmur/murmur_pch.h b/src/murmur/murmur_pch.h index 456e42b87..0eeaee205 100644 --- a/src/murmur/murmur_pch.h +++ b/src/murmur/murmur_pch.h @@ -26,7 +26,7 @@ #ifdef Q_OS_WIN #include <QtGui/QtGui> -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= 0x050000 # include "Qt4Compat.h" # include <QtWidgets/QtWidgets> #endif |