Commit 5ca34bd3 authored by Tim Jenssen's avatar Tim Jenssen

CppDocument: use initializer_list for keys

Change-Id: Ib2c407b642599cbe9da416647188e2457ec16906
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent 7ed0385e
......@@ -1670,24 +1670,16 @@ void CppCodeModelInspectorDialog::updateDocumentData(const Document::Ptr &docume
QTC_ASSERT(document, return);
// General
KeyValueModel::Table table = KeyValueModel::Table()
<< qMakePair(QString::fromLatin1("File Path"),
QDir::toNativeSeparators(document->fileName()))
<< qMakePair(QString::fromLatin1("Last Modified"),
CMI::Utils::toString(document->lastModified()))
<< qMakePair(QString::fromLatin1("Revision"),
CMI::Utils::toString(document->revision()))
<< qMakePair(QString::fromLatin1("Editor Revision"),
CMI::Utils::toString(document->editorRevision()))
<< qMakePair(QString::fromLatin1("Check Mode"),
CMI::Utils::toString(document->checkMode()))
<< qMakePair(QString::fromLatin1("Tokenized"),
CMI::Utils::toString(document->isTokenized()))
<< qMakePair(QString::fromLatin1("Parsed"),
CMI::Utils::toString(document->isParsed()))
<< qMakePair(QString::fromLatin1("Project Parts"),
CMI::Utils::partsForFile(document->fileName()))
;
const KeyValueModel::Table table = {
{QString::fromLatin1("File Path"), QDir::toNativeSeparators(document->fileName())},
{QString::fromLatin1("Last Modified"), CMI::Utils::toString(document->lastModified())},
{QString::fromLatin1("Revision"), CMI::Utils::toString(document->revision())},
{QString::fromLatin1("Editor Revision"), CMI::Utils::toString(document->editorRevision())},
{QString::fromLatin1("Check Mode"), CMI::Utils::toString(document->checkMode())},
{QString::fromLatin1("Tokenized"), CMI::Utils::toString(document->isTokenized())},
{QString::fromLatin1("Parsed"), CMI::Utils::toString(document->isParsed())},
{QString::fromLatin1("Project Parts"), CMI::Utils::partsForFile(document->fileName())}
};
m_docGenericInfoModel->configure(table);
resizeColumns<KeyValueModel>(m_ui->docGeneralView);
......@@ -1783,25 +1775,20 @@ void CppCodeModelInspectorDialog::updateProjectPartData(const ProjectPart::Ptr &
= part->buildSystemTarget.isEmpty() ? QString::fromLatin1("<None>")
: part->buildSystemTarget;
KeyValueModel::Table table = KeyValueModel::Table()
<< qMakePair(QString::fromLatin1("Project Part Name"), part->displayName)
<< qMakePair(QString::fromLatin1("Project Part File"), part->projectFileLocation())
<< qMakePair(QString::fromLatin1("Project Name"), projectName)
<< qMakePair(QString::fromLatin1("Project File"), projectFilePath)
<< qMakePair(QString::fromLatin1("Buildsystem Target"), buildSystemTarget)
<< qMakePair(QString::fromLatin1("Callgroup Id"), callGroupId)
<< qMakePair(QString::fromLatin1("Selected For Building"),
CMI::Utils::toString(part->selectedForBuilding))
<< qMakePair(QString::fromLatin1("Language Version"),
CMI::Utils::toString(part->languageVersion))
<< qMakePair(QString::fromLatin1("Language Extensions"),
CMI::Utils::toString(part->languageExtensions))
<< qMakePair(QString::fromLatin1("Qt Version"),
CMI::Utils::toString(part->qtVersion))
;
KeyValueModel::Table table = {
{QString::fromLatin1("Project Part Name"), part->displayName},
{QString::fromLatin1("Project Part File"), part->projectFileLocation()},
{QString::fromLatin1("Project Name"), projectName},
{QString::fromLatin1("Project File"), projectFilePath},
{QString::fromLatin1("Buildsystem Target"), buildSystemTarget},
{QString::fromLatin1("Callgroup Id"), callGroupId},
{QString::fromLatin1("Selected For Building"), CMI::Utils::toString(part->selectedForBuilding)},
{QString::fromLatin1("Language Version"), CMI::Utils::toString(part->languageVersion)},
{QString::fromLatin1("Language Extensions"), CMI::Utils::toString(part->languageExtensions)},
{QString::fromLatin1("Qt Version"), CMI::Utils::toString(part->qtVersion)}
};
if (!part->projectConfigFile.isEmpty())
table.prepend(qMakePair(QString::fromLatin1("Project Config File"),
part->projectConfigFile));
table.prepend({QString::fromLatin1("Project Config File"), part->projectConfigFile});
m_partGenericInfoModel->configure(table);
resizeColumns<KeyValueModel>(m_ui->partGeneralView);
......
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