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

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) ...@@ -121,10 +121,23 @@ int QtKitInformation::qtVersionId(const ProjectExplorer::Kit *k)
{ {
if (!k) if (!k)
return -1; return -1;
bool ok = false;
int id = k->value(Core::Id(Internal::QT_INFORMATION), -1).toInt(&ok); int id = -1;
if (!ok) QVariant data = k->value(Core::Id(Internal::QT_INFORMATION), -1);
id = -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; 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