Allow loading of projects even with no valid Qt

This patch marks up invalid Qt versions as Desktop.

Make sure we add a the always existing invalid Qt version in the path
available in the targetselectionpage if no valid Qt versions could be found.

This way a project can be set up and loaded without a valid Qt version set up.
Trying to build this will fail of course. This is basically how we handled
this situation before we had targets, too.

Task-number: QTCREATORBUG-1066
Reviewed-by: dt
This commit is contained in:
Tobias Hunger
2010-04-08 15:33:28 +02:00
parent ef46c31d35
commit e89c4775fa
2 changed files with 6 additions and 1 deletions

View File

@@ -1155,8 +1155,10 @@ void QtVersion::updateToolChainAndMkspec() const
m_toolChains.clear(); m_toolChains.clear();
m_targetIds.clear(); m_targetIds.clear();
if (!isValid()) if (!isValid()) {
m_targetIds.insert(Constants::DESKTOP_TARGET_ID);
return; return;
}
// qDebug()<<"Finding mkspec for"<<qmakeCommand(); // qDebug()<<"Finding mkspec for"<<qmakeCommand();

View File

@@ -280,6 +280,9 @@ TargetSetupPage::importInfosForKnownQtVersions(Qt4ProjectManager::Qt4Project *pr
QList<ImportInfo> results; QList<ImportInfo> results;
QtVersionManager * vm = QtVersionManager::instance(); QtVersionManager * vm = QtVersionManager::instance();
QList<QtVersion *> validVersions = vm->validVersions(); QList<QtVersion *> validVersions = vm->validVersions();
// Fallback in case no valid versions are found:
if (validVersions.isEmpty())
validVersions.append(vm->versions().at(0)); // there is always one!
foreach (QtVersion *v, validVersions) { foreach (QtVersion *v, validVersions) {
ImportInfo info; ImportInfo info;
// ToDo: Check whether shadowbuilding is possible and use sourcedir if not: // ToDo: Check whether shadowbuilding is possible and use sourcedir if not: