forked from qt-creator/qt-creator
Remove spaces in initializer lists
Format initializer lists code style like. Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -343,7 +343,7 @@ static QStringList languageFeatureMacros()
|
||||
// Collected with:
|
||||
// $ CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
|
||||
// $ D:\usr\llvm-3.8.0\bin\clang++.exe -fms-compatibility-version=19 -std=c++1y -dM -E D:\empty.cpp | grep __cpp_
|
||||
static QStringList macros {
|
||||
static QStringList macros{
|
||||
QLatin1String("__cpp_aggregate_nsdmi"),
|
||||
QLatin1String("__cpp_alias_templates"),
|
||||
QLatin1String("__cpp_attributes"),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -43,13 +43,13 @@ namespace CppTools {
|
||||
CppCompletionAssistProcessor::CppCompletionAssistProcessor(int snippetItemOrder)
|
||||
: m_positionForProposal(-1)
|
||||
, m_preprocessorCompletions(
|
||||
QStringList({ "define", "error", "include", "line", "pragma", "pragma once",
|
||||
"pragma omp atomic", "pragma omp parallel", "pragma omp for",
|
||||
"pragma omp ordered", "pragma omp parallel for", "pragma omp section",
|
||||
"pragma omp sections", "pragma omp parallel sections", "pragma omp single",
|
||||
"pragma omp master", "pragma omp critical", "pragma omp barrier",
|
||||
"pragma omp flush", "pragma omp threadprivate", "undef", "if", "ifdef",
|
||||
"ifndef", "elif", "else", "endif" }))
|
||||
QStringList({"define", "error", "include", "line", "pragma", "pragma once",
|
||||
"pragma omp atomic", "pragma omp parallel", "pragma omp for",
|
||||
"pragma omp ordered", "pragma omp parallel for", "pragma omp section",
|
||||
"pragma omp sections", "pragma omp parallel sections", "pragma omp single",
|
||||
"pragma omp master", "pragma omp critical", "pragma omp barrier",
|
||||
"pragma omp flush", "pragma omp threadprivate", "undef", "if", "ifdef",
|
||||
"ifndef", "elif", "else", "endif"}))
|
||||
, m_hintProposal(0)
|
||||
, m_snippetCollector(QLatin1String(CppEditor::Constants::CPP_SNIPPETS_GROUP_ID),
|
||||
QIcon(QLatin1String(":/texteditor/images/snippet.png")),
|
||||
|
||||
@@ -88,11 +88,11 @@ void CppFileSettings::toSettings(QSettings *s) const
|
||||
void CppFileSettings::fromSettings(QSettings *s)
|
||||
{
|
||||
const QStringList defaultHeaderSearchPaths
|
||||
= QStringList({ "include", "Include", QDir::toNativeSeparators("../include"),
|
||||
QDir::toNativeSeparators("../Include") });
|
||||
= QStringList({"include", "Include", QDir::toNativeSeparators("../include"),
|
||||
QDir::toNativeSeparators("../Include")});
|
||||
const QStringList defaultSourceSearchPaths
|
||||
= QStringList({ QDir::toNativeSeparators("../src"), QDir::toNativeSeparators("../Src"),
|
||||
".." });
|
||||
= QStringList({QDir::toNativeSeparators("../src"), QDir::toNativeSeparators("../Src"),
|
||||
".."});
|
||||
s->beginGroup(QLatin1String(Constants::CPPTOOLS_SETTINGSGROUP));
|
||||
headerPrefixes = s->value(QLatin1String(headerPrefixesKeyC)).toStringList();
|
||||
sourcePrefixes = s->value(QLatin1String(sourcePrefixesKeyC)).toStringList();
|
||||
|
||||
@@ -276,7 +276,7 @@ static void find_helper(QFutureInterface<Usage> &future,
|
||||
|
||||
const Utils::FileName sourceFile = Utils::FileName::fromUtf8(symbol->fileName(),
|
||||
symbol->fileNameLength());
|
||||
Utils::FileNameList files {sourceFile};
|
||||
Utils::FileNameList files{sourceFile};
|
||||
|
||||
if (symbol->isClass()
|
||||
|| symbol->isForwardClassDeclaration()
|
||||
@@ -578,7 +578,7 @@ static void findMacroUses_helper(QFutureInterface<Usage> &future,
|
||||
const Macro macro)
|
||||
{
|
||||
const Utils::FileName sourceFile = Utils::FileName::fromString(macro.fileName());
|
||||
Utils::FileNameList files {sourceFile};
|
||||
Utils::FileNameList files{sourceFile};
|
||||
files = Utils::filteredUnique(files + snapshot.filesDependingOn(sourceFile));
|
||||
|
||||
future.setProgressRange(0, files.size());
|
||||
|
||||
@@ -188,8 +188,8 @@ void CppToolsPlugin::test_modelmanager_paths_are_clean()
|
||||
ProjectPart::Ptr part(new ProjectPart);
|
||||
part->qtVersion = ProjectPart::Qt5;
|
||||
part->projectDefines = QByteArray("#define OH_BEHAVE -1\n");
|
||||
part->headerPaths = { HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath),
|
||||
HeaderPath(testDataDir.frameworksDir(false), HeaderPath::FrameworkPath) };
|
||||
part->headerPaths = {HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath),
|
||||
HeaderPath(testDataDir.frameworksDir(false), HeaderPath::FrameworkPath)};
|
||||
pi.appendProjectPart(part);
|
||||
|
||||
mm->updateProjectInfo(pi);
|
||||
@@ -220,8 +220,8 @@ void CppToolsPlugin::test_modelmanager_framework_headers()
|
||||
ProjectPart::Ptr part(new ProjectPart);
|
||||
part->qtVersion = ProjectPart::Qt5;
|
||||
part->projectDefines = QByteArray("#define OH_BEHAVE -1\n");
|
||||
part->headerPaths = { HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath),
|
||||
HeaderPath(testDataDir.frameworksDir(false), HeaderPath::FrameworkPath) };
|
||||
part->headerPaths = {HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath),
|
||||
HeaderPath(testDataDir.frameworksDir(false), HeaderPath::FrameworkPath)};
|
||||
const QString &source = testDataDir.fileFromSourcesDir(
|
||||
_("test_modelmanager_framework_headers.cpp"));
|
||||
part->files << ProjectFile(source, ProjectFile::CXXSource);
|
||||
@@ -269,7 +269,7 @@ void CppToolsPlugin::test_modelmanager_refresh_also_includes_of_project_files()
|
||||
ProjectPart::Ptr part(new ProjectPart);
|
||||
part->qtVersion = ProjectPart::Qt5;
|
||||
part->projectDefines = QByteArray("#define OH_BEHAVE -1\n");
|
||||
part->headerPaths = { HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath) };
|
||||
part->headerPaths = {HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath)};
|
||||
part->files.append(ProjectFile(testCpp, ProjectFile::CXXSource));
|
||||
pi.appendProjectPart(part);
|
||||
|
||||
@@ -545,8 +545,8 @@ void CppToolsPlugin::test_modelmanager_refresh_timeStampModified_if_sourcefiles_
|
||||
const QString testCpp2 = QLatin1String("source2.cpp");
|
||||
|
||||
const QString fileToChange = testCpp;
|
||||
const QStringList projectFiles1 = { testCpp };
|
||||
const QStringList projectFiles2 = { testCpp, testCpp2 };
|
||||
const QStringList projectFiles1 = {testCpp};
|
||||
const QStringList projectFiles2 = {testCpp, testCpp2};
|
||||
|
||||
// Add a file
|
||||
QTest::newRow("case: add project file") << fileToChange << projectFiles1 << projectFiles2;
|
||||
@@ -568,7 +568,7 @@ void CppToolsPlugin::test_modelmanager_snapshot_after_two_projects()
|
||||
// Project 1
|
||||
project1.create(_("test_modelmanager_snapshot_after_two_projects.1"),
|
||||
_("testdata_project1"),
|
||||
{ "foo.h", "foo.cpp", "main.cpp" });
|
||||
{"foo.h", "foo.cpp", "main.cpp"});
|
||||
|
||||
refreshedFiles = helper.updateProjectInfo(project1.projectInfo);
|
||||
QCOMPARE(refreshedFiles, project1.projectFiles.toSet());
|
||||
@@ -580,7 +580,7 @@ void CppToolsPlugin::test_modelmanager_snapshot_after_two_projects()
|
||||
// Project 2
|
||||
project2.create(_("test_modelmanager_snapshot_after_two_projects.2"),
|
||||
_("testdata_project2"),
|
||||
{ "bar.h", "bar.cpp", "main.cpp" });
|
||||
{"bar.h", "bar.cpp", "main.cpp"});
|
||||
|
||||
refreshedFiles = helper.updateProjectInfo(project2.projectInfo);
|
||||
QCOMPARE(refreshedFiles, project2.projectFiles.toSet());
|
||||
@@ -762,7 +762,7 @@ void CppToolsPlugin::test_modelmanager_defines_per_project()
|
||||
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part1->qtVersion = ProjectPart::NoQt;
|
||||
part1->projectDefines = QByteArray("#define SUB1\n");
|
||||
part1->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
||||
part1->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||
|
||||
ProjectPart::Ptr part2(new ProjectPart);
|
||||
part2->projectFile = QLatin1String("project1.projectfile");
|
||||
@@ -770,7 +770,7 @@ void CppToolsPlugin::test_modelmanager_defines_per_project()
|
||||
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part2->qtVersion = ProjectPart::NoQt;
|
||||
part2->projectDefines = QByteArray("#define SUB2\n");
|
||||
part2->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
||||
part2->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||
|
||||
ProjectInfo pi = ProjectInfo(project);
|
||||
pi.appendProjectPart(part1);
|
||||
@@ -786,8 +786,8 @@ void CppToolsPlugin::test_modelmanager_defines_per_project()
|
||||
QString firstDeclarationName;
|
||||
QString fileName;
|
||||
} d[] = {
|
||||
{ _("one"), main1File },
|
||||
{ _("two"), main2File }
|
||||
{_("one"), main1File},
|
||||
{_("two"), main2File}
|
||||
};
|
||||
const int size = sizeof(d) / sizeof(d[0]);
|
||||
for (int i = 0; i < size; ++i) {
|
||||
@@ -828,7 +828,7 @@ void CppToolsPlugin::test_modelmanager_precompiled_headers()
|
||||
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part1->qtVersion = ProjectPart::NoQt;
|
||||
part1->precompiledHeaders.append(pch1File);
|
||||
part1->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
||||
part1->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||
part1->updateLanguageFeatures();
|
||||
|
||||
ProjectPart::Ptr part2(new ProjectPart);
|
||||
@@ -837,7 +837,7 @@ void CppToolsPlugin::test_modelmanager_precompiled_headers()
|
||||
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part2->qtVersion = ProjectPart::NoQt;
|
||||
part2->precompiledHeaders.append(pch2File);
|
||||
part2->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
||||
part2->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||
part2->updateLanguageFeatures();
|
||||
|
||||
ProjectInfo pi = ProjectInfo(project);
|
||||
@@ -855,8 +855,8 @@ void CppToolsPlugin::test_modelmanager_precompiled_headers()
|
||||
QString firstClassInPchFile;
|
||||
QString fileName;
|
||||
} d[] = {
|
||||
{ _("one"), _("ClassInPch1"), main1File },
|
||||
{ _("two"), _("ClassInPch2"), main2File }
|
||||
{_("one"), _("ClassInPch1"), main1File},
|
||||
{_("two"), _("ClassInPch2"), main2File}
|
||||
};
|
||||
const int size = sizeof(d) / sizeof(d[0]);
|
||||
for (int i = 0; i < size; ++i) {
|
||||
@@ -911,13 +911,13 @@ void CppToolsPlugin::test_modelmanager_defines_per_editor()
|
||||
part1->files.append(ProjectFile(main1File, ProjectFile::CXXSource));
|
||||
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part1->qtVersion = ProjectPart::NoQt;
|
||||
part1->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
||||
part1->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||
|
||||
ProjectPart::Ptr part2(new ProjectPart);
|
||||
part2->files.append(ProjectFile(main2File, ProjectFile::CXXSource));
|
||||
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part2->qtVersion = ProjectPart::NoQt;
|
||||
part2->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
||||
part2->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||
|
||||
ProjectInfo pi = ProjectInfo(project);
|
||||
pi.appendProjectPart(part1);
|
||||
@@ -934,8 +934,8 @@ void CppToolsPlugin::test_modelmanager_defines_per_editor()
|
||||
QString editorDefines;
|
||||
QString firstDeclarationName;
|
||||
} d[] = {
|
||||
{ _("#define SUB1\n"), _("one") },
|
||||
{ _("#define SUB2\n"), _("two") }
|
||||
{_("#define SUB1\n"), _("one")},
|
||||
{_("#define SUB2\n"), _("two")}
|
||||
};
|
||||
const int size = sizeof(d) / sizeof(d[0]);
|
||||
for (int i = 0; i < size; ++i) {
|
||||
@@ -1025,7 +1025,7 @@ void CppToolsPlugin::test_modelmanager_renameIncludes()
|
||||
QVERIFY(tmpDir.isValid());
|
||||
|
||||
const QDir workingDir(tmpDir.path());
|
||||
const QStringList fileNames = { "foo.h", "foo.cpp", "main.cpp" };
|
||||
const QStringList fileNames = {"foo.h", "foo.cpp", "main.cpp"};
|
||||
const QString oldHeader(workingDir.filePath(_("foo.h")));
|
||||
const QString newHeader(workingDir.filePath(_("bar.h")));
|
||||
CppModelManager *modelManager = CppModelManager::instance();
|
||||
@@ -1071,7 +1071,7 @@ void CppToolsPlugin::test_modelmanager_renameIncludesInEditor()
|
||||
QVERIFY(tmpDir.isValid());
|
||||
|
||||
const QDir workingDir(tmpDir.path());
|
||||
const QStringList fileNames = { "foo.h", "foo.cpp", "main.cpp" };
|
||||
const QStringList fileNames = {"foo.h", "foo.cpp", "main.cpp"};
|
||||
const QString oldHeader(workingDir.filePath(_("foo.h")));
|
||||
const QString newHeader(workingDir.filePath(_("bar.h")));
|
||||
const QString mainFile(workingDir.filePath(_("main.cpp")));
|
||||
|
||||
Reference in New Issue
Block a user