Commit bddf21c5 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

qWarning when failing to create default target settings

parent 175b43ec
...@@ -130,6 +130,8 @@ void ProjectLoadWizard::done(int result) ...@@ -130,6 +130,8 @@ void ProjectLoadWizard::done(int result)
continue; continue;
m_project->addTarget(t); m_project->addTarget(t);
} }
if (m_project->targets().isEmpty())
qWarning() << "Failed to populate project with default targets for imported Qt" << m_importVersion->displayName();
} else { } else {
// Not importing // Not importing
if (m_temporaryVersion) if (m_temporaryVersion)
...@@ -138,13 +140,13 @@ void ProjectLoadWizard::done(int result) ...@@ -138,13 +140,13 @@ void ProjectLoadWizard::done(int result)
// Find a Qt version: // Find a Qt version:
QList<QtVersion *> candidates = vm->versions(); QList<QtVersion *> candidates = vm->versions();
QtVersion *defaultVersion = candidates.at(0); // always there and always valid! QtVersion *defaultVersion = candidates.at(0); // always there and always valid!
// Check for the first valid desktop-Qt, fall back to any valid Qt if no desktop
// flavour is available.
foreach (QtVersion *v, candidates) { foreach (QtVersion *v, candidates) {
if (v->isValid()) if (v->isValid())
defaultVersion = v; defaultVersion = v;
if (v->supportsTargetId(DESKTOP_TARGET_ID) && v->isValid()) { if (v->supportsTargetId(DESKTOP_TARGET_ID) && v->isValid())
defaultVersion = v;
break; break;
}
} }
foreach (const QString &id, defaultVersion->supportedTargetIds()) { foreach (const QString &id, defaultVersion->supportedTargetIds()) {
...@@ -153,6 +155,8 @@ void ProjectLoadWizard::done(int result) ...@@ -153,6 +155,8 @@ void ProjectLoadWizard::done(int result)
continue; continue;
m_project->addTarget(t); m_project->addTarget(t);
} }
if (m_project->targets().isEmpty())
qWarning() << "Failed to populate project with default targets for default Qt" << m_importVersion->displayName();
} }
} }
......
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