Skip to content
Snippets Groups Projects
Commit a064280c authored by Tobias Hunger's avatar Tobias Hunger
Browse files

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
No related branches found
No related tags found
No related merge requests found
...@@ -181,7 +181,7 @@ Utils::WizardPage *ProjectPageFactory::create(JsonWizard *wizard, Core::Id typeI ...@@ -181,7 +181,7 @@ Utils::WizardPage *ProjectPageFactory::create(JsonWizard *wizard, Core::Id typeI
JsonProjectPage *page = new JsonProjectPage; JsonProjectPage *page = new JsonProjectPage;
QVariantMap tmp = data.toMap(); QVariantMap tmp = data.isNull() ? QVariantMap() : data.toMap();
QString description = tmp.value(QLatin1String("trDescription")).toString(); QString description = tmp.value(QLatin1String("trDescription")).toString();
page->setDescription(description); page->setDescription(description);
...@@ -193,12 +193,11 @@ bool ProjectPageFactory::validateData(Core::Id typeId, const QVariant &data, QSt ...@@ -193,12 +193,11 @@ bool ProjectPageFactory::validateData(Core::Id typeId, const QVariant &data, QSt
Q_UNUSED(errorMessage); Q_UNUSED(errorMessage);
QTC_ASSERT(canCreate(typeId), return false); 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", *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 false;
} }
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment