forked from qt-creator/qt-creator
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:
@@ -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();
|
||||||
|
|
||||||
|
@@ -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:
|
||||||
|
Reference in New Issue
Block a user