aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2014-10-15 15:08:15 +0200
committerTobias Hunger <tobias.hunger@theqtcompany.com>2014-10-23 17:05:14 +0200
commit06d7d58c88cd5fb5d539549ee038b9163f91a5dd (patch)
treeceda7d207959dde8d89f58e11ee106c20d679eee /src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp
parent72f0b52555d40d83b1f795ceccdd59cbf4493ec6 (diff)
JsonWizard: Clean up page factories
Improve error reporting and remove useless setup code. Change-Id: I97e9fba0aa1cf6bb2cba26f70d46d1ba87bbd192 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Diffstat (limited to 'src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp')
-rw-r--r--src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp
index 4be83b743e5..8499a10cf09 100644
--- a/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp
+++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardpagefactory_p.cpp
@@ -134,11 +134,11 @@ ProjectPageFactory::ProjectPageFactory()
Utils::WizardPage *ProjectPageFactory::create(JsonWizard *wizard, Core::Id typeId, const QVariant &data)
{
+ Q_UNUSED(wizard);
Q_UNUSED(data);
QTC_ASSERT(canCreate(typeId), return 0);
JsonProjectPage *page = new JsonProjectPage;
- page->setPath(wizard->value(QStringLiteral("GivenPath")).toString());
return page;
}
@@ -148,7 +148,13 @@ bool ProjectPageFactory::validateData(Core::Id typeId, const QVariant &data, QSt
Q_UNUSED(errorMessage);
QTC_ASSERT(canCreate(typeId), return false);
- return data.isNull();
+ if (!data.isNull() && (data.type() != QVariant::Map || !data.toMap().isEmpty())) {
+ *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizard",
+ "\"data\" for a \"Project\" page needs to be unset or an empty object.");
+ return false;
+ }
+
+ return true;
}
// --------------------------------------------------------------------