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