JsonWizard: Make enabled/disabled more consistent

Wizards have a "disabled" flag, everything else can be "enabled". Make
that more consistent by having the "enabled" for the wizard, too.
Wizards default to "enabled" now, just as they did default to "not
disabled" before.

Change-Id: Ic91f60196137daf353f7995b10ade19673d66f4e
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-05-27 15:03:57 +02:00
parent 154b3e52b2
commit b70d63952a

View File

@@ -65,7 +65,7 @@ static const char WIZARD_PATH[] = "templates/wizards";
static const char WIZARD_FILE[] = "wizard.json";
static const char VERSION_KEY[] = "version";
static const char DISABLED_KEY[] = "disabled";
static const char ENABLED_EXPRESSION_KEY[] = "enabled";
static const char KIND_KEY[] = "kind";
static const char ID_KEY[] = "id";
@@ -84,7 +84,6 @@ static const char DATA_KEY[] = "data";
static const char PAGE_SUB_TITLE_KEY[] = "trSubTitle";
static const char PAGE_SHORT_TITLE_KEY[] = "trShortTitle";
static const char PAGE_INDEX_KEY[] = "index";
static const char PAGE_ENABLED_EXPRESSION_KEY[] = "enabled";
static const char OPTIONS_KEY[] = "options";
static const char PLATFORM_INDEPENDENT_KEY[] = "platformIndependent";
@@ -188,7 +187,7 @@ static JsonWizardFactory::Page parsePage(const QVariant &value, QString *errorMe
return p;
}
QVariant enabled = data.value(QLatin1String(PAGE_ENABLED_EXPRESSION_KEY), true);
QVariant enabled = data.value(QLatin1String(ENABLED_EXPRESSION_KEY), true);
QVariant subData = data.value(QLatin1String(DATA_KEY));
if (!factory->validateData(typeId, subData, errorMessage))
@@ -278,8 +277,7 @@ QList<Core::IWizardFactory *> JsonWizardFactory::createWizardFactories()
continue;
}
bool isDisabled = data.value(QLatin1String(DISABLED_KEY), false).toBool();
if (isDisabled) {
if (!data.value(QLatin1String(ENABLED_EXPRESSION_KEY), true).toBool()) {
verboseLog.append(tr("* Wizard is disabled.\n"));
continue;
}