Commit ddd2f23f authored by Tobias Hunger's avatar Tobias Hunger

KitsPage: Use constant for data keys

Change-Id: I4915976a5a5e1843fd35934d167875255401fdb7
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@theqtcompany.com>
parent 274f1c0e
......@@ -128,6 +128,8 @@ bool FilePageFactory::validateData(Core::Id typeId, const QVariant &data, QStrin
// KitsPageFactory:
// --------------------------------------------------------------------
static const char KEY_PROJECT_FILE[] = "projectFilePath";
KitsPageFactory::KitsPageFactory()
{
setTypeIdsSuffix(QLatin1String("Kits"));
......@@ -139,7 +141,7 @@ Utils::WizardPage *KitsPageFactory::create(JsonWizard *wizard, Core::Id typeId,
QTC_ASSERT(canCreate(typeId), return 0);
JsonKitsPage *page = new JsonKitsPage;
page->setUnexpandedProjectPath(data.toMap().value(QLatin1String("projectFilePath")).toString());
page->setUnexpandedProjectPath(data.toMap().value(QLatin1String(KEY_PROJECT_FILE)).toString());
return page;
}
......@@ -155,9 +157,10 @@ bool KitsPageFactory::validateData(Core::Id typeId, const QVariant &data, QStrin
}
QVariantMap tmp = data.toMap();
if (tmp.value(QLatin1String("projectFilePath")).toString().isEmpty()) {
if (tmp.value(QLatin1String(KEY_PROJECT_FILE)).toString().isEmpty()) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizard",
"\"Kits\" page requires a \"projectFilePath\" set.");
"\"Kits\" page requires a \"%1\" set.")
.arg(QLatin1String(KEY_PROJECT_FILE));
return false;
}
......
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