From 9f3777bbdec04d0aec0b40bcb6915ad24e9a0760 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Sat, 17 Dec 2011 15:56:24 +0100 Subject: [PATCH] Check Qt build date and build key. --- src/Config.h | 2 +- src/Global.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Config.h b/src/Config.h index 35dd8892..d7128fdc 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 4 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 9 -#define VER_LAMEXP_BUILD 810 +#define VER_LAMEXP_BUILD 811 /////////////////////////////////////////////////////////////////////////////// // Tool versions (minimum expected versions!) diff --git a/src/Global.cpp b/src/Global.cpp index 4d0088a7..758a2f60 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -43,6 +43,7 @@ #include #include #include +#include //LameXP includes #include "Resource.h" @@ -780,12 +781,18 @@ bool lamexp_init_qt(int argc, char* argv[]) } //Check Qt version - qDebug("Using Qt Framework v%s (%s), compiled with Qt v%s [%s]", qVersion(), (qSharedBuild() ? "DLL" : "Static"), QT_VERSION_STR, QT_PACKAGEDATE_STR); + qDebug("Using Qt v%s (%s), %s, built on %s", qVersion(), (qSharedBuild() ? "DLL" : "Static"), QLibraryInfo::buildKey().toLatin1().constData(), QLibraryInfo::buildDate().toString(Qt::ISODate).toLatin1().constData()); + qDebug("Compiled with Qt v%s [%s], %s\n", QT_VERSION_STR, QT_PACKAGEDATE_STR, QT_BUILD_KEY); if(_stricmp(qVersion(), QT_VERSION_STR)) { qFatal("%s", QApplication::tr("Executable '%1' requires Qt v%2, but found Qt v%3.").arg(QString::fromLatin1(executableName), QString::fromLatin1(QT_VERSION_STR), QString::fromLatin1(qVersion())).toLatin1().constData()); return false; } + if(QLibraryInfo::buildKey().compare(QString::fromLatin1(QT_BUILD_KEY), Qt::CaseInsensitive)) + { + qFatal("%s", QApplication::tr("Executable '%1' was built for Qt '%2', but found Qt '%3'.").arg(QString::fromLatin1(executableName), QString::fromLatin1(QT_BUILD_KEY), QLibraryInfo::buildKey()).toLatin1().constData()); + return false; + } //Check the Windows version switch(QSysInfo::windowsVersion() & QSysInfo::WV_NT_based)