forked from qt-creator/qt-creator
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: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user