Commit a064280c authored by Tobias Hunger's avatar Tobias Hunger

JsonWizard: Allow for better compatibility with QtC 3.3 project wizards

Support for a description was added in 3.4. Keep wizards without that
working.

Change-Id: I13b4506ea154018cac6f337196846a881439628d
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 9a798af1
......@@ -181,7 +181,7 @@ Utils::WizardPage *ProjectPageFactory::create(JsonWizard *wizard, Core::Id typeI
JsonProjectPage *page = new JsonProjectPage;
QVariantMap tmp = data.toMap();
QVariantMap tmp = data.isNull() ? QVariantMap() : data.toMap();
QString description = tmp.value(QLatin1String("trDescription")).toString();
page->setDescription(description);
......@@ -193,12 +193,11 @@ bool ProjectPageFactory::validateData(Core::Id typeId, const QVariant &data, QSt
Q_UNUSED(errorMessage);
QTC_ASSERT(canCreate(typeId), return false);
if (data.isNull() || data.type() != QVariant::Map) {
if (!data.isNull() && data.type() != QVariant::Map) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizard",
"\"data\" must be a JSON object for \"Project\" pages.");
"\"data\" must be empty or a JSON object for \"Project\" pages.");
return false;
}
return true;
}
......
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