Commit 7e74c9b4 authored by Tobias Hunger's avatar Tobias Hunger

Handle autodetection sources as identifiers for Qt versions

Change-Id: I9ac0988cd312e032e4d5e2ad03aba309ff7cbef9
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 93fb2928
......@@ -121,10 +121,23 @@ int QtKitInformation::qtVersionId(const ProjectExplorer::Kit *k)
{
if (!k)
return -1;
bool ok = false;
int id = k->value(Core::Id(Internal::QT_INFORMATION), -1).toInt(&ok);
if (!ok)
id = -1;
int id = -1;
QVariant data = k->value(Core::Id(Internal::QT_INFORMATION), -1);
if (data.type() == QVariant::Int) {
bool ok;
id = data.toInt(&ok);
if (!ok)
id = -1;
} else {
QString source = data.toString();
foreach (BaseQtVersion *v, QtVersionManager::instance()->versions()) {
if (v->autodetectionSource() != source)
continue;
id = v->uniqueId();
break;
}
}
return id;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment