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:
@@ -156,7 +156,7 @@ void BuildDirManager::maybeForceReparseOnceReaderReady()
|
||||
const QByteArray CMAKE_CXX_COMPILER_KEY = "CMAKE_CXX_COMPILER";
|
||||
|
||||
const QByteArrayList criticalKeys
|
||||
= { GENERATOR_KEY, CMAKE_COMMAND_KEY, CMAKE_C_COMPILER_KEY, CMAKE_CXX_COMPILER_KEY };
|
||||
= {GENERATOR_KEY, CMAKE_COMMAND_KEY, CMAKE_C_COMPILER_KEY, CMAKE_CXX_COMPILER_KEY};
|
||||
|
||||
const CMakeConfig currentConfig = parsedConfiguration();
|
||||
|
||||
|
||||
@@ -598,22 +598,22 @@ CMakeBuildInfo *CMakeBuildConfigurationFactory::createBuildInfo(const ProjectExp
|
||||
info->typeName = tr("Build");
|
||||
break;
|
||||
case BuildTypeDebug:
|
||||
buildTypeItem = { CMakeConfigItem("CMAKE_BUILD_TYPE", "Debug") };
|
||||
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "Debug")};
|
||||
info->typeName = tr("Debug");
|
||||
info->buildType = BuildConfiguration::Debug;
|
||||
break;
|
||||
case BuildTypeRelease:
|
||||
buildTypeItem = { CMakeConfigItem("CMAKE_BUILD_TYPE", "Release") };
|
||||
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "Release")};
|
||||
info->typeName = tr("Release");
|
||||
info->buildType = BuildConfiguration::Release;
|
||||
break;
|
||||
case BuildTypeMinSizeRel:
|
||||
buildTypeItem = { CMakeConfigItem("CMAKE_BUILD_TYPE", "MinSizeRel") };
|
||||
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "MinSizeRel")};
|
||||
info->typeName = tr("Minimum Size Release");
|
||||
info->buildType = BuildConfiguration::Release;
|
||||
break;
|
||||
case BuildTypeRelWithDebInfo:
|
||||
buildTypeItem = { CMakeConfigItem("CMAKE_BUILD_TYPE", "RelWithDebInfo") };
|
||||
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "RelWithDebInfo")};
|
||||
info->typeName = tr("Release with Debug Information");
|
||||
info->buildType = BuildConfiguration::Profile;
|
||||
break;
|
||||
|
||||
@@ -526,8 +526,8 @@ QList<BuildStepInfo> CMakeBuildStepFactory::availableSteps(BuildStepList *parent
|
||||
if (parent->target()->project()->id() != Constants::CMAKEPROJECT_ID)
|
||||
return {};
|
||||
|
||||
return {{ Constants::CMAKE_BUILD_STEP_ID,
|
||||
tr("Build", "Display name for CMakeProjectManager::CMakeBuildStep id.") }};
|
||||
return {{Constants::CMAKE_BUILD_STEP_ID,
|
||||
tr("Build", "Display name for CMakeProjectManager::CMakeBuildStep id.")}};
|
||||
}
|
||||
|
||||
BuildStep *CMakeBuildStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Internal {
|
||||
namespace {
|
||||
int distance(const FileName &targetDirectory, const FileName &fileName)
|
||||
{
|
||||
const QString commonParent = commonPath(QStringList({ targetDirectory.toString(), fileName.toString() }));
|
||||
const QString commonParent = commonPath(QStringList({targetDirectory.toString(), fileName.toString()}));
|
||||
return targetDirectory.toString().mid(commonParent.size()).count('/')
|
||||
+ fileName.toString().mid(commonParent.size()).count('/');
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ CMakeConfigItem::CMakeConfigItem() = default;
|
||||
CMakeConfigItem::CMakeConfigItem(const CMakeConfigItem &other) :
|
||||
key(other.key), type(other.type), isAdvanced(other.isAdvanced),
|
||||
value(other.value), documentation(other.documentation), values(other.values)
|
||||
{ }
|
||||
{}
|
||||
|
||||
CMakeConfigItem::CMakeConfigItem(const QByteArray &k, Type t,
|
||||
const QByteArray &d, const QByteArray &v) :
|
||||
@@ -372,34 +372,34 @@ void CMakeProjectPlugin::testCMakeSplitValue_data()
|
||||
<< "" << true << QStringList();
|
||||
|
||||
QTest::newRow("single path")
|
||||
<< "C:/something" << false << QStringList({ "C:/something" });
|
||||
<< "C:/something" << false << QStringList({"C:/something"});
|
||||
QTest::newRow("single path, keep empty")
|
||||
<< "C:/something" << true << QStringList({ "C:/something" });
|
||||
<< "C:/something" << true << QStringList({"C:/something"});
|
||||
|
||||
QTest::newRow(";single path")
|
||||
<< ";C:/something" << false << QStringList({ "C:/something" });
|
||||
<< ";C:/something" << false << QStringList({"C:/something"});
|
||||
QTest::newRow(";single path, keep empty")
|
||||
<< ";C:/something" << true << QStringList({ "", "C:/something" });
|
||||
<< ";C:/something" << true << QStringList({"", "C:/something"});
|
||||
|
||||
QTest::newRow("single path;")
|
||||
<< "C:/something;" << false << QStringList({ "C:/something" });
|
||||
<< "C:/something;" << false << QStringList({"C:/something"});
|
||||
QTest::newRow("single path;, keep empty")
|
||||
<< "C:/something;" << true << QStringList({ "C:/something", "" });
|
||||
<< "C:/something;" << true << QStringList({"C:/something", ""});
|
||||
|
||||
QTest::newRow("single path\\;")
|
||||
<< "C:/something\\;" << false << QStringList({ "C:/something;" });
|
||||
<< "C:/something\\;" << false << QStringList({"C:/something;"});
|
||||
QTest::newRow("single path\\;, keep empty")
|
||||
<< "C:/something\\;" << true << QStringList({ "C:/something;" });
|
||||
<< "C:/something\\;" << true << QStringList({"C:/something;"});
|
||||
|
||||
QTest::newRow("single path\\;;second path")
|
||||
<< "C:/something\\;;/second/path" << false << QStringList({ "C:/something;", "/second/path" });
|
||||
<< "C:/something\\;;/second/path" << false << QStringList({"C:/something;", "/second/path"});
|
||||
QTest::newRow("single path\\;;second path, keep empty")
|
||||
<< "C:/something\\;;/second/path" << true << QStringList({ "C:/something;", "/second/path" });
|
||||
<< "C:/something\\;;/second/path" << true << QStringList({"C:/something;", "/second/path"});
|
||||
|
||||
QTest::newRow("single path;;second path")
|
||||
<< "C:/something;;/second/path" << false << QStringList({ "C:/something", "/second/path" });
|
||||
<< "C:/something;;/second/path" << false << QStringList({"C:/something", "/second/path"});
|
||||
QTest::newRow("single path;;second path, keep empty")
|
||||
<< "C:/something;;/second/path" << true << QStringList({ "C:/something", "", "/second/path" });
|
||||
<< "C:/something;;/second/path" << true << QStringList({"C:/something", "", "/second/path"});
|
||||
}
|
||||
|
||||
void CMakeProjectPlugin::testCMakeSplitValue()
|
||||
|
||||
@@ -267,7 +267,7 @@ void CMakeGeneratorKitInformation::set(Kit *k,
|
||||
const QString &generator, const QString &extraGenerator,
|
||||
const QString &platform, const QString &toolset)
|
||||
{
|
||||
GeneratorInfo info = { generator, extraGenerator, platform, toolset };
|
||||
GeneratorInfo info = {generator, extraGenerator, platform, toolset};
|
||||
setGeneratorInfo(k, info);
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ QVariant CMakeGeneratorKitInformation::defaultValue(const Kit *k) const
|
||||
k->addToEnvironment(env);
|
||||
const Utils::FileName ninjaExec = env.searchInPath(QLatin1String("ninja"));
|
||||
if (!ninjaExec.isEmpty())
|
||||
return GeneratorInfo({ QString("Ninja"), extraGenerator, QString(), QString() }).toVariant();
|
||||
return GeneratorInfo({QString("Ninja"), extraGenerator, QString(), QString()}).toVariant();
|
||||
}
|
||||
|
||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||
@@ -341,7 +341,7 @@ QVariant CMakeGeneratorKitInformation::defaultValue(const Kit *k) const
|
||||
if (it == known.constEnd())
|
||||
return QVariant();
|
||||
|
||||
return GeneratorInfo({ it->name, extraGenerator, QString(), QString() }).toVariant();
|
||||
return GeneratorInfo({it->name, extraGenerator, QString(), QString()}).toVariant();
|
||||
}
|
||||
|
||||
QList<Task> CMakeGeneratorKitInformation::validate(const Kit *k) const
|
||||
@@ -407,9 +407,9 @@ void CMakeGeneratorKitInformation::fix(Kit *k)
|
||||
dv.fromVariant(defaultValue(k));
|
||||
setGeneratorInfo(k, dv);
|
||||
} else {
|
||||
const GeneratorInfo dv = { info.generator, info.extraGenerator,
|
||||
it->supportsPlatform ? info.platform : QString(),
|
||||
it->supportsToolset ? info.toolset : QString() };
|
||||
const GeneratorInfo dv = {info.generator, info.extraGenerator,
|
||||
it->supportsPlatform ? info.platform : QString(),
|
||||
it->supportsToolset ? info.toolset : QString()};
|
||||
setGeneratorInfo(k, dv);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,8 +456,8 @@ QStringList CMakeProject::filesGeneratedFrom(const QString &sourceFile) const
|
||||
} else if (fi.suffix() == "scxml") {
|
||||
generatedFilePath += "/";
|
||||
generatedFilePath += QDir::cleanPath(fi.completeBaseName());
|
||||
return QStringList({ generatedFilePath + ".h",
|
||||
generatedFilePath + ".cpp" });
|
||||
return QStringList({generatedFilePath + ".h",
|
||||
generatedFilePath + ".cpp"});
|
||||
} else {
|
||||
// TODO: Other types will be added when adapters for their compilers become available.
|
||||
return QStringList();
|
||||
|
||||
@@ -226,7 +226,7 @@ QVector<CMakeToolChainData> extractToolChainsFromCache(const CMakeConfig &config
|
||||
if (!i.key.startsWith("CMAKE_") || !i.key.endsWith("_COMPILER"))
|
||||
continue;
|
||||
const QByteArray language = i.key.mid(6, i.key.count() - 6 - 9); // skip "CMAKE_" and "_COMPILER"
|
||||
result.append({ language, Utils::FileName::fromUtf8(i.value) });
|
||||
result.append({language, Utils::FileName::fromUtf8(i.value)});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -278,7 +278,7 @@ QList<void *> CMakeProjectImporter::examineDirectory(const Utils::FileName &impo
|
||||
data->toolChains = extractToolChainsFromCache(config);
|
||||
|
||||
qCInfo(cmInputLog()) << "Offering to import" << importPath.toUserOutput();
|
||||
return { static_cast<void *>(data.release()) };
|
||||
return {static_cast<void *>(data.release())};
|
||||
}
|
||||
|
||||
bool CMakeProjectImporter::matchKit(void *directoryData, const Kit *k) const
|
||||
@@ -442,7 +442,7 @@ void CMakeProjectPlugin::testCMakeProjectImporterQt_data()
|
||||
<< QStringList() << QString();
|
||||
|
||||
QTest::newRow("Qt4")
|
||||
<< QStringList({ QString::fromLatin1("QT_QMAKE_EXECUTABLE=/usr/bin/xxx/qmake") })
|
||||
<< QStringList({QString::fromLatin1("QT_QMAKE_EXECUTABLE=/usr/bin/xxx/qmake")})
|
||||
<< "/usr/bin/xxx/qmake";
|
||||
|
||||
// Everything else will require Qt installations!
|
||||
@@ -477,29 +477,29 @@ void CMakeProjectPlugin::testCMakeProjectImporterToolChain_data()
|
||||
QTest::newRow("Unrelated input")
|
||||
<< QStringList("CMAKE_SOMETHING_ELSE=/tmp") << QByteArrayList() << QStringList();
|
||||
QTest::newRow("CXX compiler")
|
||||
<< QStringList({ "CMAKE_CXX_COMPILER=/usr/bin/g++" })
|
||||
<< QByteArrayList({ "CXX" })
|
||||
<< QStringList({ "/usr/bin/g++" });
|
||||
<< QStringList({"CMAKE_CXX_COMPILER=/usr/bin/g++"})
|
||||
<< QByteArrayList({"CXX"})
|
||||
<< QStringList({"/usr/bin/g++"});
|
||||
QTest::newRow("CXX compiler, C compiler")
|
||||
<< QStringList({ "CMAKE_CXX_COMPILER=/usr/bin/g++", "CMAKE_C_COMPILER=/usr/bin/clang" })
|
||||
<< QByteArrayList({ "CXX", "C" })
|
||||
<< QStringList({ "/usr/bin/g++", "/usr/bin/clang" });
|
||||
<< QStringList({"CMAKE_CXX_COMPILER=/usr/bin/g++", "CMAKE_C_COMPILER=/usr/bin/clang"})
|
||||
<< QByteArrayList({"CXX", "C"})
|
||||
<< QStringList({"/usr/bin/g++", "/usr/bin/clang"});
|
||||
QTest::newRow("CXX compiler, C compiler, strange compiler")
|
||||
<< QStringList({ "CMAKE_CXX_COMPILER=/usr/bin/g++",
|
||||
<< QStringList({"CMAKE_CXX_COMPILER=/usr/bin/g++",
|
||||
"CMAKE_C_COMPILER=/usr/bin/clang",
|
||||
"CMAKE_STRANGE_LANGUAGE_COMPILER=/tmp/strange/compiler" })
|
||||
<< QByteArrayList({ "CXX", "C", "STRANGE_LANGUAGE" })
|
||||
<< QStringList({ "/usr/bin/g++", "/usr/bin/clang", "/tmp/strange/compiler" });
|
||||
"CMAKE_STRANGE_LANGUAGE_COMPILER=/tmp/strange/compiler"})
|
||||
<< QByteArrayList({"CXX", "C", "STRANGE_LANGUAGE"})
|
||||
<< QStringList({"/usr/bin/g++", "/usr/bin/clang", "/tmp/strange/compiler"});
|
||||
QTest::newRow("CXX compiler, C compiler, strange compiler (with junk)")
|
||||
<< QStringList({ "FOO=test",
|
||||
<< QStringList({"FOO=test",
|
||||
"CMAKE_CXX_COMPILER=/usr/bin/g++",
|
||||
"CMAKE_BUILD_TYPE=debug",
|
||||
"CMAKE_C_COMPILER=/usr/bin/clang",
|
||||
"SOMETHING_COMPILER=/usr/bin/something",
|
||||
"CMAKE_STRANGE_LANGUAGE_COMPILER=/tmp/strange/compiler",
|
||||
"BAR=more test" })
|
||||
<< QByteArrayList({ "CXX", "C", "STRANGE_LANGUAGE" })
|
||||
<< QStringList({ "/usr/bin/g++", "/usr/bin/clang", "/tmp/strange/compiler" });
|
||||
"BAR=more test"})
|
||||
<< QByteArrayList({"CXX", "C", "STRANGE_LANGUAGE"})
|
||||
<< QStringList({"/usr/bin/g++", "/usr/bin/clang", "/tmp/strange/compiler"});
|
||||
}
|
||||
|
||||
void CMakeProjectPlugin::testCMakeProjectImporterToolChain()
|
||||
|
||||
@@ -341,7 +341,7 @@ CMakeToolItemConfigWidget::CMakeToolItemConfigWidget(CMakeToolItemModel *model)
|
||||
m_binaryChooser->setExpectedKind(PathChooser::ExistingCommand);
|
||||
m_binaryChooser->setMinimumWidth(400);
|
||||
m_binaryChooser->setHistoryCompleter(QLatin1String("Cmake.Command.History"));
|
||||
m_binaryChooser->setCommandVersionArguments({ "--version" });
|
||||
m_binaryChooser->setCommandVersionArguments({"--version"});
|
||||
|
||||
m_autoRunCheckBox = new QCheckBox;
|
||||
m_autoRunCheckBox->setText(tr("Autorun CMake"));
|
||||
|
||||
@@ -172,19 +172,19 @@ TextEditor::Keywords CMakeTool::keywords()
|
||||
{
|
||||
if (m_functions.isEmpty()) {
|
||||
Utils::SynchronousProcessResponse response;
|
||||
response = run({ "--help-command-list" });
|
||||
response = run({"--help-command-list"});
|
||||
if (response.result == Utils::SynchronousProcessResponse::Finished)
|
||||
m_functions = response.stdOut().split('\n');
|
||||
|
||||
response = run({ "--help-commands" });
|
||||
response = run({"--help-commands"});
|
||||
if (response.result == Utils::SynchronousProcessResponse::Finished)
|
||||
parseFunctionDetailsOutput(response.stdOut());
|
||||
|
||||
response = run({ "--help-property-list" });
|
||||
response = run({"--help-property-list"});
|
||||
if (response.result == Utils::SynchronousProcessResponse::Finished)
|
||||
m_variables = parseVariableOutput(response.stdOut());
|
||||
|
||||
response = run({ "--help-variable-list" });
|
||||
response = run({"--help-variable-list"});
|
||||
if (response.result == Utils::SynchronousProcessResponse::Finished) {
|
||||
m_variables.append(parseVariableOutput(response.stdOut()));
|
||||
m_variables = Utils::filteredUnique(m_variables);
|
||||
@@ -354,7 +354,7 @@ QStringList CMakeTool::parseVariableOutput(const QString &output)
|
||||
|
||||
void CMakeTool::fetchGeneratorsFromHelp() const
|
||||
{
|
||||
Utils::SynchronousProcessResponse response = run({ "--help" });
|
||||
Utils::SynchronousProcessResponse response = run({"--help"});
|
||||
if (response.result != Utils::SynchronousProcessResponse::Finished)
|
||||
return;
|
||||
|
||||
@@ -406,7 +406,7 @@ void CMakeTool::fetchGeneratorsFromHelp() const
|
||||
|
||||
void CMakeTool::fetchVersionFromVersionOutput() const
|
||||
{
|
||||
Utils::SynchronousProcessResponse response = run({ "--version" });
|
||||
Utils::SynchronousProcessResponse response = run({"--version" });
|
||||
if (response.result != Utils::SynchronousProcessResponse::Finished)
|
||||
return;
|
||||
|
||||
@@ -427,7 +427,7 @@ void CMakeTool::fetchVersionFromVersionOutput() const
|
||||
|
||||
void CMakeTool::fetchFromCapabilities() const
|
||||
{
|
||||
Utils::SynchronousProcessResponse response = run({ "-E", "capabilities" }, true);
|
||||
Utils::SynchronousProcessResponse response = run({"-E", "capabilities" }, true);
|
||||
if (response.result != Utils::SynchronousProcessResponse::Finished)
|
||||
return;
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ ServerMode::ServerMode(const Environment &env,
|
||||
m_socketName = QString::fromLatin1("\\\\.\\pipe\\") + QUuid::createUuid().toString();
|
||||
#endif
|
||||
|
||||
const QStringList args = QStringList({ "-E", "server", "--pipe=" + m_socketName });
|
||||
const QStringList args = QStringList({"-E", "server", "--pipe=" + m_socketName});
|
||||
|
||||
connect(m_cmakeProcess.get(), &QtcProcess::started, this, [this]() { m_connectionTimer.start(); });
|
||||
connect(m_cmakeProcess.get(),
|
||||
@@ -168,7 +168,7 @@ void ServerMode::sendRequest(const QString &type, const QVariantMap &extra, cons
|
||||
data.insert(TYPE_KEY, type);
|
||||
const QVariant realCookie = cookie.isNull() ? QVariant(m_requestCounter) : cookie;
|
||||
data.insert(COOKIE_KEY, realCookie);
|
||||
m_expectedReplies.push_back({ type, realCookie });
|
||||
m_expectedReplies.push_back({type, realCookie});
|
||||
|
||||
QJsonObject object = QJsonObject::fromVariantMap(data);
|
||||
QJsonDocument document;
|
||||
|
||||
Reference in New Issue
Block a user