Commit 8fe0cb2b authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Warn when failing to restore .user-file settings

parent 5937f2cf
......@@ -126,14 +126,20 @@ bool BuildConfiguration::fromMap(const QVariantMap &map)
maxI = 0;
for (int i = 0; i < maxI; ++i) {
QVariantMap bsData(map.value(QString::fromLatin1(BUILD_STEPS_PREFIX) + QString::number(i)).toMap());
if (bsData.isEmpty())
if (bsData.isEmpty()) {
qWarning() << "No buildstep data found (continuing).";
continue;
}
IBuildStepFactory *factory(findRestoreFactory(this, bsData));
if (!factory)
if (!factory) {
qWarning() << "No factory for buildstep found (continuing).";
continue;
}
BuildStep *bs(factory->restore(this, bsData));
if (!bs)
if (!bs) {
qWarning() << "Restoration of buildstep failed (continuing).";
continue;
}
insertBuildStep(m_buildSteps.count(), bs);
}
......@@ -142,14 +148,20 @@ bool BuildConfiguration::fromMap(const QVariantMap &map)
maxI = 0;
for (int i = 0; i < maxI; ++i) {
QVariantMap bsData(map.value(QString::fromLatin1(CLEAN_STEPS_PREFIX) + QString::number(i)).toMap());
if (bsData.isEmpty())
if (bsData.isEmpty()) {
qWarning() << "No cleanstep data found for (continuing).";
continue;
}
IBuildStepFactory *factory(findRestoreFactory(this, bsData));
if (!factory)
if (!factory) {
qWarning() << "No factory for cleanstep found (continuing).";
continue;
}
BuildStep *bs(factory->restore(this, bsData));
if (!bs)
if (!bs) {
qWarning() << "Restoration of cleanstep failed (continuing).";
continue;
}
insertCleanStep(m_cleanSteps.count(), bs);
}
......
......@@ -40,6 +40,8 @@
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
#include <QtCore/QDebug>
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
......@@ -245,11 +247,15 @@ bool Project::fromMap(const QVariantMap &map)
for (int i = 0; i < maxI; ++i) {
const QString key(QString::fromLatin1(TARGET_KEY_PREFIX) + QString::number(i));
if (!map.contains(key))
if (!map.contains(key)) {
qWarning() << key << "was not found in data.";
return false;
}
Target *t(targetFactory()->restore(this, map.value(key).toMap()));
if (!t)
if (!t) {
qWarning() << "Restoration of a target failed! (Continuing)";
continue;
}
addTarget(t);
if (i == active)
setActiveTarget(t);
......
......@@ -277,8 +277,10 @@ bool Qt4Project::fromMap(const QVariantMap &map)
// This can happen esp. when updating from a old version of Qt Creator
QList<Target *>ts(targets());
foreach (Target *t, ts) {
if (t->buildConfigurations().isEmpty())
if (t->buildConfigurations().isEmpty()) {
qWarning() << "Removing" << t->id() << "since it has no buildconfigurations!";
removeTarget(t);
}
}
// Add buildconfigurations so we can parse the pro-files.
......
Supports Markdown
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