forked from qt-creator/qt-creator
CMakePM: Fix registering CMake as version 0.0.0
When importing a CMake build, the CMake version that's used in the build could be registered as "CMake 0.0.0". This is obviously wrong. Fixes: QTCREATORBUG-26999 Change-Id: I1401106806c4356516e8235a3767d9615e4d428d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -91,6 +91,9 @@ static QStringList scanDirectory(const FilePath &path, const QString &prefix)
|
||||
|
||||
static QString baseCMakeToolDisplayName(CMakeTool &tool)
|
||||
{
|
||||
if (!tool.isValid())
|
||||
return QString("CMake");
|
||||
|
||||
CMakeTool::Version version = tool.version();
|
||||
return QString("CMake %1.%2.%3").arg(version.major).arg(version.minor).arg(version.patch);
|
||||
}
|
||||
|
||||
@@ -310,12 +310,12 @@ bool CMakeTool::hasFileApi() const
|
||||
|
||||
CMakeTool::Version CMakeTool::version() const
|
||||
{
|
||||
return m_introspection ? m_introspection->m_version : CMakeTool::Version();
|
||||
return isValid() ? m_introspection->m_version : CMakeTool::Version();
|
||||
}
|
||||
|
||||
QString CMakeTool::versionDisplay() const
|
||||
{
|
||||
if (!m_introspection)
|
||||
if (!isValid())
|
||||
return CMakeToolManager::tr("Version not parseable");
|
||||
|
||||
const Version &version = m_introspection->m_version;
|
||||
|
||||
Reference in New Issue
Block a user