forked from qt-creator/qt-creator
DebuggingHelpers: Check for Qt version instead checking private files
The location private includes might still change with 4.7.1 . Better check the qt version string. Reviewed-by: Lasse Holmstedt
This commit is contained in:
@@ -101,6 +101,33 @@ QString BuildableHelperLibrary::qtVersionForQMake(const QString &qmakePath)
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool BuildableHelperLibrary::checkMinimumQtVersion(const QString &qtVersionString, int majorVersion, int minorVersion, int patchVersion)
|
||||
{
|
||||
int major = -1;
|
||||
int minor = -1;
|
||||
int patch = -1;
|
||||
|
||||
// check format
|
||||
QRegExp qtVersionRegex(QLatin1String("^\\d+\\.\\d+\\.\\d+$"));
|
||||
if (!qtVersionRegex.exactMatch(qtVersionString))
|
||||
return false;
|
||||
|
||||
QStringList parts = qtVersionString.split(QLatin1Char('.'));
|
||||
major = parts.at(0).toInt();
|
||||
minor = parts.at(1).toInt();
|
||||
patch = parts.at(2).toInt();
|
||||
|
||||
if (major == majorVersion) {
|
||||
if (minor == minorVersion) {
|
||||
if (patch >= patchVersion)
|
||||
return true;
|
||||
} else if (minor > minorVersion)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
QStringList BuildableHelperLibrary::possibleQMakeCommands()
|
||||
{
|
||||
// On windows no one has renamed qmake, right?
|
||||
|
||||
Reference in New Issue
Block a user