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:
Tim Jenssen
2017-02-22 15:09:35 +01:00
parent 005ca71cac
commit 2631ffabd5
207 changed files with 1689 additions and 1689 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ static bool insertQuote(const QChar ch, const BackwardsScanner &tk)
return tk.text(index) == "operator";
// Insert matching quote after identifier when identifier is a known literal prefixes
static const QStringList stringLiteralPrefixes = { "L", "U", "u", "u8", "R"};
static const QStringList stringLiteralPrefixes = {"L", "U", "u", "u8", "R"};
return token.kind() == CPlusPlus::T_IDENTIFIER
&& stringLiteralPrefixes.contains(tk.text(index));
}
+1 -1
View File
@@ -840,7 +840,7 @@ void Preprocessor::handleDefined(PPToken *tk)
void Preprocessor::pushToken(Preprocessor::PPToken *tk)
{
const PPToken currentTokenBuffer[] = { *tk };
const PPToken currentTokenBuffer[] = {*tk};
m_state.pushTokenBuffer(currentTokenBuffer, currentTokenBuffer + 1, 0);
}
@@ -313,19 +313,19 @@ void DiagramSceneController::dropNewElement(const QString &newElementId, const Q
auto package = new MPackage();
newName = tr("New Package");
if (!stereotype.isEmpty())
package->setStereotypes({ stereotype });
package->setStereotypes({stereotype});
newObject = package;
} else if (newElementId == QLatin1String(ELEMENT_TYPE_COMPONENT)) {
auto component = new MComponent();
newName = tr("New Component");
if (!stereotype.isEmpty())
component->setStereotypes({ stereotype });
component->setStereotypes({stereotype});
newObject = component;
} else if (newElementId == QLatin1String(ELEMENT_TYPE_CLASS)) {
auto klass = new MClass();
newName = tr("New Class");
if (!stereotype.isEmpty())
klass->setStereotypes({ stereotype });
klass->setStereotypes({stereotype});
newObject = klass;
} else if (newElementId == QLatin1String(ELEMENT_TYPE_ITEM)) {
auto item = new MItem();
+49 -49
View File
@@ -492,34 +492,34 @@ private:
class IdsThatShouldNotBeUsedInDesigner : public QStringList
{
public:
IdsThatShouldNotBeUsedInDesigner() : QStringList({ "top",
"bottom",
"left",
"right",
"width",
"height",
"x",
"y",
"opacity",
"parent",
"item",
"flow",
"color",
"margin",
"padding",
"border",
"font",
"text",
"source",
"state",
"visible",
"focus",
"data",
"clip",
"layer",
"scale",
"enabled",
"anchors"})
IdsThatShouldNotBeUsedInDesigner() : QStringList({"top",
"bottom",
"left",
"right",
"width",
"height",
"x",
"y",
"opacity",
"parent",
"item",
"flow",
"color",
"margin",
"padding",
"border",
"font",
"text",
"source",
"state",
"visible",
"focus",
"data",
"clip",
"layer",
"scale",
"enabled",
"anchors"})
{
}
@@ -550,13 +550,13 @@ class UnsupportedTypesByVisualDesigner : public QStringList
{
public:
UnsupportedTypesByVisualDesigner() : QStringList({"Transform",
"Timer",
"Rotation",
"Scale",
"Translate",
"Package",
"Particles",
"Dialog"})
"Timer",
"Rotation",
"Scale",
"Translate",
"Package",
"Particles",
"Dialog"})
{
}
@@ -566,18 +566,18 @@ class UnsupportedTypesByQmlUi : public QStringList
{
public:
UnsupportedTypesByQmlUi() : QStringList({"Binding",
"ShaderEffect",
"ShaderEffectSource",
"Component",
"Loader",
"Transition",
"PropertyAnimation",
"SequentialAnimation",
"PropertyAnimation",
"SequentialAnimation",
"ParallelAnimation",
"NumberAnimation",
"Drawer"})
"ShaderEffect",
"ShaderEffectSource",
"Component",
"Loader",
"Transition",
"PropertyAnimation",
"SequentialAnimation",
"PropertyAnimation",
"SequentialAnimation",
"ParallelAnimation",
"NumberAnimation",
"Drawer"})
{
append(UnsupportedTypesByVisualDesigner());
}
@@ -1627,8 +1627,8 @@ bool Check::visit(CallExpression *ast)
// We have to allow the translation functions
const QStringList translationFunctions = { "qsTr", "qsTrId", "qsTranslate",
"qsTrNoOp", "qsTrIdNoOp", "qsTranslateNoOp" };
const QStringList translationFunctions = {"qsTr", "qsTrId", "qsTranslate",
"qsTrNoOp", "qsTrIdNoOp", "qsTranslateNoOp"};
const bool isTranslationFunction = translationFunctions.contains(name);
+2 -2
View File
@@ -647,10 +647,10 @@ QString PluginDumper::resolvePlugin(const QDir &qmldirPath, const QString &qmldi
QString prefix;
if (Utils::HostOsInfo::isWindowsHost()) {
// try a qmake-style debug build first
validSuffixList = QStringList({ "d.dll", ".dll" });
validSuffixList = QStringList({"d.dll", ".dll"});
} else if (Utils::HostOsInfo::isMacHost()) {
// try a qmake-style debug build first
validSuffixList = QStringList({ "_debug.dylib", ".dylib", ".so", ".bundle", "lib" });
validSuffixList = QStringList({"_debug.dylib", ".dylib", ".so", ".bundle", "lib"});
} else {
// Examples of valid library names:
// libfoo.so
+7 -7
View File
@@ -58,13 +58,13 @@ const struct {
SshRemoteProcess::Signal signalEnum;
const char * const signalString;
} signalMap[] = {
{ SshRemoteProcess::AbrtSignal, "ABRT" }, { SshRemoteProcess::AlrmSignal, "ALRM" },
{ SshRemoteProcess::FpeSignal, "FPE" }, { SshRemoteProcess::HupSignal, "HUP" },
{ SshRemoteProcess::IllSignal, "ILL" }, { SshRemoteProcess::IntSignal, "INT" },
{ SshRemoteProcess::KillSignal, "KILL" }, { SshRemoteProcess::PipeSignal, "PIPE" },
{ SshRemoteProcess::QuitSignal, "QUIT" }, { SshRemoteProcess::SegvSignal, "SEGV" },
{ SshRemoteProcess::TermSignal, "TERM" }, { SshRemoteProcess::Usr1Signal, "USR1" },
{ SshRemoteProcess::Usr2Signal, "USR2" }
{SshRemoteProcess::AbrtSignal, "ABRT"}, {SshRemoteProcess::AlrmSignal, "ALRM"},
{SshRemoteProcess::FpeSignal, "FPE"}, {SshRemoteProcess::HupSignal, "HUP"},
{SshRemoteProcess::IllSignal, "ILL"}, {SshRemoteProcess::IntSignal, "INT"},
{SshRemoteProcess::KillSignal, "KILL"}, {SshRemoteProcess::PipeSignal, "PIPE"},
{SshRemoteProcess::QuitSignal, "QUIT"}, {SshRemoteProcess::SegvSignal, "SEGV"},
{SshRemoteProcess::TermSignal, "TERM"}, {SshRemoteProcess::Usr1Signal, "USR1"},
{SshRemoteProcess::Usr2Signal, "USR2"}
};
SshRemoteProcess::SshRemoteProcess(const QByteArray &command, quint32 channelId,
+1 -1
View File
@@ -137,7 +137,7 @@ int TimelineNotesModel::add(int modelId, int timelineIndex, const QString &text)
Q_D(TimelineNotesModel);
const TimelineModel *model = d->timelineModels.value(modelId);
int typeId = model->typeId(timelineIndex);
TimelineNotesModelPrivate::Note note = { text, modelId, timelineIndex };
TimelineNotesModelPrivate::Note note = {text, modelId, timelineIndex};
d->data << note;
d->modified = true;
emit changed(typeId, modelId, timelineIndex);
+1 -1
View File
@@ -101,7 +101,7 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
}
pcmd = QLatin1String("/bin/sh");
pargs = QtcProcess::Arguments::createUnixArgs(
QStringList({ "-c", (QtcProcess::quoteArg(program) + ' ' + args) }));
QStringList({"-c", (QtcProcess::quoteArg(program) + ' ' + args)}));
}
QtcProcess::SplitError qerr;
+3 -3
View File
@@ -475,9 +475,9 @@ FileSaver::FileSaver(const QString &filename, QIODevice::OpenMode mode)
if (HostOsInfo::isWindowsHost()) {
// Taken from: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
static const QStringList reservedNames
= { "CON", "PRN", "AUX", "NUL",
"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
"LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" };
= {"CON", "PRN", "AUX", "NUL",
"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
"LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"};
const QString fn = QFileInfo(filename).baseName().toUpper();
for (const QString &rn : reservedNames) {
if (fn == rn) {
+4 -4
View File
@@ -660,7 +660,7 @@ bool QtcProcess::prepareCommand(const QString &command, const QString &arguments
return false;
*outCmd = QLatin1String("/bin/sh");
*outArgs = Arguments::createUnixArgs(
QStringList({ "-c", (quoteArg(command) + ' ' + arguments) }));
QStringList({"-c", (quoteArg(command) + ' ' + arguments)}));
}
}
return true;
@@ -1039,7 +1039,7 @@ bool QtcProcess::expandMacros(QString *cmd, AbstractMacroExpander *mx, OsType os
}
} else {
// !Windows
MxState state = { MxBasic, false };
MxState state = {MxBasic, false};
QStack<MxState> sstack;
QStack<MxSave> ostack;
@@ -1085,7 +1085,7 @@ bool QtcProcess::expandMacros(QString *cmd, AbstractMacroExpander *mx, OsType os
if (str.unicode()[pos + 1].unicode() == '(') {
// $(( starts a math expression. This may also be a $( ( in fact,
// so we push the current string and offset on a stack so we can retry.
MxSave sav = { str, pos + 2, varPos };
MxSave sav = {str, pos + 2, varPos};
ostack.push(sav);
state.current = MxMath;
pos += 2;
@@ -1315,7 +1315,7 @@ bool QtcProcess::ArgIterator::next()
}
}
} else {
MxState state = { MxBasic, false };
MxState state = {MxBasic, false};
QStack<MxState> sstack;
QStack<int> ostack;
bool hadWord = false;
+1 -1
View File
@@ -700,7 +700,7 @@ static QString checkBinary(const QDir &dir, const QString &binary)
case OsTypeOther:
break;
case OsTypeWindows: {
static const char *windowsExtensions[] = {".cmd", ".bat", ".exe", ".com" };
static const char *windowsExtensions[] = {".cmd", ".bat", ".exe", ".com"};
// Check the Windows extensions using the order
const int windowsExtensionCount = sizeof(windowsExtensions)/sizeof(const char*);
for (int e = 0; e < windowsExtensionCount; e ++) {
+38 -38
View File
@@ -272,44 +272,44 @@ QPalette Theme::palette() const
QPalette::ColorGroup paletteColorGroup;
bool setColorRoleAsBrush;
} mapping[] = {
{ PaletteWindow, QPalette::Window, QPalette::All, false},
{ PaletteWindowDisabled, QPalette::Window, QPalette::Disabled, false},
{ PaletteWindowText, QPalette::WindowText, QPalette::All, true},
{ PaletteWindowTextDisabled, QPalette::WindowText, QPalette::Disabled, true},
{ PaletteBase, QPalette::Base, QPalette::All, false},
{ PaletteBaseDisabled, QPalette::Base, QPalette::Disabled, false},
{ PaletteAlternateBase, QPalette::AlternateBase, QPalette::All, false},
{ PaletteAlternateBaseDisabled, QPalette::AlternateBase, QPalette::Disabled, false},
{ PaletteToolTipBase, QPalette::ToolTipBase, QPalette::All, true},
{ PaletteToolTipBaseDisabled, QPalette::ToolTipBase, QPalette::Disabled, true},
{ PaletteToolTipText, QPalette::ToolTipText, QPalette::All, false},
{ PaletteToolTipTextDisabled, QPalette::ToolTipText, QPalette::Disabled, false},
{ PaletteText, QPalette::Text, QPalette::All, true},
{ PaletteTextDisabled, QPalette::Text, QPalette::Disabled, true},
{ PaletteButton, QPalette::Button, QPalette::All, false},
{ PaletteButtonDisabled, QPalette::Button, QPalette::Disabled, false},
{ PaletteButtonText, QPalette::ButtonText, QPalette::All, true},
{ PaletteButtonTextDisabled, QPalette::ButtonText, QPalette::Disabled, true},
{ PaletteBrightText, QPalette::BrightText, QPalette::All, false},
{ PaletteBrightTextDisabled, QPalette::BrightText, QPalette::Disabled, false},
{ PaletteHighlight, QPalette::Highlight, QPalette::All, true},
{ PaletteHighlightDisabled, QPalette::Highlight, QPalette::Disabled, true},
{ PaletteHighlightedText, QPalette::HighlightedText, QPalette::All, true},
{ PaletteHighlightedTextDisabled, QPalette::HighlightedText, QPalette::Disabled, true},
{ PaletteLink, QPalette::Link, QPalette::All, false},
{ PaletteLinkDisabled, QPalette::Link, QPalette::Disabled, false},
{ PaletteLinkVisited, QPalette::LinkVisited, QPalette::All, false},
{ PaletteLinkVisitedDisabled, QPalette::LinkVisited, QPalette::Disabled, false},
{ PaletteLight, QPalette::Light, QPalette::All, false},
{ PaletteLightDisabled, QPalette::Light, QPalette::Disabled, false},
{ PaletteMidlight, QPalette::Midlight, QPalette::All, false},
{ PaletteMidlightDisabled, QPalette::Midlight, QPalette::Disabled, false},
{ PaletteDark, QPalette::Dark, QPalette::All, false},
{ PaletteDarkDisabled, QPalette::Dark, QPalette::Disabled, false},
{ PaletteMid, QPalette::Mid, QPalette::All, false},
{ PaletteMidDisabled, QPalette::Mid, QPalette::Disabled, false},
{ PaletteShadow, QPalette::Shadow, QPalette::All, false},
{ PaletteShadowDisabled, QPalette::Shadow, QPalette::Disabled, false}
{PaletteWindow, QPalette::Window, QPalette::All, false},
{PaletteWindowDisabled, QPalette::Window, QPalette::Disabled, false},
{PaletteWindowText, QPalette::WindowText, QPalette::All, true},
{PaletteWindowTextDisabled, QPalette::WindowText, QPalette::Disabled, true},
{PaletteBase, QPalette::Base, QPalette::All, false},
{PaletteBaseDisabled, QPalette::Base, QPalette::Disabled, false},
{PaletteAlternateBase, QPalette::AlternateBase, QPalette::All, false},
{PaletteAlternateBaseDisabled, QPalette::AlternateBase, QPalette::Disabled, false},
{PaletteToolTipBase, QPalette::ToolTipBase, QPalette::All, true},
{PaletteToolTipBaseDisabled, QPalette::ToolTipBase, QPalette::Disabled, true},
{PaletteToolTipText, QPalette::ToolTipText, QPalette::All, false},
{PaletteToolTipTextDisabled, QPalette::ToolTipText, QPalette::Disabled, false},
{PaletteText, QPalette::Text, QPalette::All, true},
{PaletteTextDisabled, QPalette::Text, QPalette::Disabled, true},
{PaletteButton, QPalette::Button, QPalette::All, false},
{PaletteButtonDisabled, QPalette::Button, QPalette::Disabled, false},
{PaletteButtonText, QPalette::ButtonText, QPalette::All, true},
{PaletteButtonTextDisabled, QPalette::ButtonText, QPalette::Disabled, true},
{PaletteBrightText, QPalette::BrightText, QPalette::All, false},
{PaletteBrightTextDisabled, QPalette::BrightText, QPalette::Disabled, false},
{PaletteHighlight, QPalette::Highlight, QPalette::All, true},
{PaletteHighlightDisabled, QPalette::Highlight, QPalette::Disabled, true},
{PaletteHighlightedText, QPalette::HighlightedText, QPalette::All, true},
{PaletteHighlightedTextDisabled, QPalette::HighlightedText, QPalette::Disabled, true},
{PaletteLink, QPalette::Link, QPalette::All, false},
{PaletteLinkDisabled, QPalette::Link, QPalette::Disabled, false},
{PaletteLinkVisited, QPalette::LinkVisited, QPalette::All, false},
{PaletteLinkVisitedDisabled, QPalette::LinkVisited, QPalette::Disabled, false},
{PaletteLight, QPalette::Light, QPalette::All, false},
{PaletteLightDisabled, QPalette::Light, QPalette::Disabled, false},
{PaletteMidlight, QPalette::Midlight, QPalette::All, false},
{PaletteMidlightDisabled, QPalette::Midlight, QPalette::Disabled, false},
{PaletteDark, QPalette::Dark, QPalette::All, false},
{PaletteDarkDisabled, QPalette::Dark, QPalette::Disabled, false},
{PaletteMid, QPalette::Mid, QPalette::All, false},
{PaletteMidDisabled, QPalette::Mid, QPalette::Disabled, false},
{PaletteShadow, QPalette::Shadow, QPalette::All, false},
{PaletteShadowDisabled, QPalette::Shadow, QPalette::Disabled, false}
};
for (auto entry: mapping) {
+2 -2
View File
@@ -355,8 +355,8 @@ QAbstractItemModel *AndroidBuildApkStep::keystoreCertificates()
CertificatesModel *model = nullptr;
QStringList params
= { QLatin1String("-list"), QLatin1String("-v"), QLatin1String("-keystore"),
m_keystorePath.toUserOutput(), QLatin1String("-storepass") };
= {QLatin1String("-list"), QLatin1String("-v"), QLatin1String("-keystore"),
m_keystorePath.toUserOutput(), QLatin1String("-storepass")};
params << m_keystorePasswd;
params << QLatin1String("-J-Duser.language=en");
@@ -378,7 +378,7 @@ void AndroidConfig::updateAvailableSdkPlatforms() const
proc.setProcessEnvironment(androidToolEnvironment().toProcessEnvironment());
SynchronousProcessResponse response
= proc.runBlocking(androidToolPath().toString(),
QStringList({ "list", "target" })); // list available AVDs
QStringList({"list", "target"})); // list available AVDs
if (response.result != SynchronousProcessResponse::Finished)
return;
@@ -668,7 +668,7 @@ bool AndroidConfig::removeAVD(const QString &name) const
proc.setTimeoutS(5);
proc.setProcessEnvironment(androidToolEnvironment().toProcessEnvironment());
SynchronousProcessResponse response
= proc.runBlocking(androidToolPath().toString(), QStringList({ "delete", "avd", "-n", name }));
= proc.runBlocking(androidToolPath().toString(), QStringList({"delete", "avd", "-n", name}));
return response.result == SynchronousProcessResponse::Finished && response.exitCode == 0;
}
@@ -684,7 +684,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::androidVirtualDevices(const QString &a
SynchronousProcess proc;
proc.setTimeoutS(20);
proc.setProcessEnvironment(environment.toProcessEnvironment());
SynchronousProcessResponse response = proc.run(androidTool, { "list", "avd" }); // list available AVDs
SynchronousProcessResponse response = proc.run(androidTool, {"list", "avd"}); // list available AVDs
if (response.result != SynchronousProcessResponse::Finished)
return devices;
@@ -1350,7 +1350,7 @@ QStringList AndroidDeviceInfo::adbSelector(const QString &serialNumber)
{
if (serialNumber.startsWith(QLatin1String("????")))
return QStringList("-d");
return QStringList({ "-s", serialNumber });
return QStringList({"-s", serialNumber});
}
const AndroidConfig &AndroidConfigurations::currentConfig()
+1 -1
View File
@@ -83,7 +83,7 @@ QList<BuildStepInfo> AndroidDeployQtStepFactory::availableSteps(BuildStepList *p
|| parent->contains(AndroidDeployQtStep::Id))
return {};
return {{ AndroidDeployQtStep::Id, tr("Deploy to Android device or emulator") }};
return {{AndroidDeployQtStep::Id, tr("Deploy to Android device or emulator")}};
}
ProjectExplorer::BuildStep *AndroidDeployQtStepFactory::create(ProjectExplorer::BuildStepList *parent, Core::Id id)
+2 -2
View File
@@ -408,8 +408,8 @@ bool AndroidManager::checkKeystorePassword(const QString &keystorePath, const QS
bool AndroidManager::checkCertificatePassword(const QString &keystorePath, const QString &keystorePasswd, const QString &alias, const QString &certificatePasswd)
{
// assumes that the keystore password is correct
QStringList arguments = { "-certreq", "-keystore", keystorePath,
"--storepass", keystorePasswd, "-alias", alias, "-keypass" };
QStringList arguments = {"-certreq", "-keystore", keystorePath,
"--storepass", keystorePasswd, "-alias", alias, "-keypass"};
if (certificatePasswd.isEmpty())
arguments << keystorePasswd;
else
@@ -977,8 +977,8 @@ void AndroidManifestEditorWidget::parseApplication(QXmlStreamReader &reader, QXm
writer.writeStartElement(reader.name().toString());
QXmlStreamAttributes attributes = reader.attributes();
QStringList keys = { QLatin1String("android:label") };
QStringList values = { m_appNameLineEdit->text() };
QStringList keys = {QLatin1String("android:label")};
QStringList values = {m_appNameLineEdit->text()};
bool ensureIconAttribute = !m_lIconPath.isEmpty()
|| !m_mIconPath.isEmpty()
|| !m_hIconPath.isEmpty();
+1 -1
View File
@@ -140,5 +140,5 @@ QSet<Core::Id> AndroidQtVersion::availableFeatures() const
QSet<Core::Id> AndroidQtVersion::targetDeviceTypes() const
{
return { Constants::ANDROID_DEVICE_TYPE };
return {Constants::ANDROID_DEVICE_TYPE};
}
@@ -68,9 +68,9 @@ void Android::Internal::AndroidSignalOperation::adbFindRunAsFinished(int exitCod
this, &AndroidSignalOperation::adbKillFinished);
m_state = Kill;
m_timeout->start();
m_adbProcess->start(m_adbPath, QStringList({ "shell", "run-as", runAs, "kill",
QString("-%1").arg(m_signal),
QString::number(m_pid) }));
m_adbProcess->start(m_adbPath, QStringList({"shell", "run-as", runAs, "kill",
QString("-%1").arg(m_signal),
QString::number(m_pid)}));
}
}
+4 -4
View File
@@ -266,7 +266,7 @@ AndroidToolChainFactory::AndroidToolChainFactory()
QSet<Core::Id> Android::Internal::AndroidToolChainFactory::supportedLanguages() const
{
return { ProjectExplorer::Constants::CXX_LANGUAGE_ID };
return {ProjectExplorer::Constants::CXX_LANGUAGE_ID};
}
QList<ToolChain *> AndroidToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
@@ -303,8 +303,8 @@ QList<AndroidToolChainFactory::AndroidToolChainInformation> AndroidToolChainFact
int idx = versionRegExp.indexIn(fileName);
if (idx == -1)
continue;
for (const Core::Id lang : { ProjectExplorer::Constants::CXX_LANGUAGE_ID,
ProjectExplorer::Constants::C_LANGUAGE_ID }) {
for (const Core::Id lang : {ProjectExplorer::Constants::CXX_LANGUAGE_ID,
ProjectExplorer::Constants::C_LANGUAGE_ID}) {
AndroidToolChainInformation ati;
ati.language = lang;
ati.version = fileName.mid(idx + 1);
@@ -401,7 +401,7 @@ AndroidToolChainFactory::autodetectToolChainsForNdk(const FileName &ndkPath,
if (abi.architecture() == Abi::UnknownArchitecture) // e.g. mipsel which is not yet supported
continue;
QList<AndroidToolChain *> toolChainBundle;
for (Core::Id lang : { ProjectExplorer::Constants::CXX_LANGUAGE_ID, ProjectExplorer::Constants::C_LANGUAGE_ID }) {
for (Core::Id lang : {ProjectExplorer::Constants::CXX_LANGUAGE_ID, ProjectExplorer::Constants::C_LANGUAGE_ID}) {
FileName compilerPath = AndroidConfigurations::currentConfig().gccPath(abi, lang, version);
AndroidToolChain *tc = findToolChain(compilerPath, lang, alreadyKnown);
+1 -1
View File
@@ -45,7 +45,7 @@ AvdDialog::AvdDialog(int minApiLevel, const QString &targetArch, const AndroidCo
m_hideTipTimer.setSingleShot(true);
if (targetArch.isEmpty())
m_avdDialog.abiComboBox->addItems(QStringList({ "armeabi-v7a", "armeabi", "x86", "mips" }));
m_avdDialog.abiComboBox->addItems(QStringList({"armeabi-v7a", "armeabi", "x86", "mips"}));
else
m_avdDialog.abiComboBox->addItems(QStringList(targetArch));
+2 -2
View File
@@ -167,10 +167,10 @@ void AutoTestUnitTests::testCodeParserSwitchStartup_data()
QTest::addColumn<QList<int> >("expectedUnnamedQuickTestsCount");
QTest::addColumn<QList<int> >("expectedDataTagsCount");
QStringList projects = QStringList({ m_tmpDir->path() + "/plain/plain.pro",
QStringList projects = QStringList({m_tmpDir->path() + "/plain/plain.pro",
m_tmpDir->path() + "/mixed_atp/mixed_atp.pro",
m_tmpDir->path() + "/plain/plain.qbs",
m_tmpDir->path() + "/mixed_atp/mixed_atp.qbs" });
m_tmpDir->path() + "/mixed_atp/mixed_atp.qbs"});
QList<int> expectedAutoTests = QList<int>() << 1 << 4 << 1 << 4;
QList<int> expectedNamedQuickTests = QList<int>() << 0 << 5 << 0 << 5;
+2 -2
View File
@@ -311,8 +311,8 @@ TestTreeItem *GTestTreeItem::findChildByNameStateAndFile(const QString &name,
QString GTestTreeItem::nameSuffix() const
{
static QString markups[] = { QCoreApplication::translate("GTestTreeItem", "parameterized"),
QCoreApplication::translate("GTestTreeItem", "typed") };
static QString markups[] = {QCoreApplication::translate("GTestTreeItem", "parameterized"),
QCoreApplication::translate("GTestTreeItem", "typed")};
QString suffix;
if (m_state & Parameterized)
suffix = QString(" [") + markups[0];
@@ -135,12 +135,12 @@ QtTestOutputReader::QtTestOutputReader(const QFutureInterface<TestResultPtr> &fu
void QtTestOutputReader::processOutput(const QByteArray &outputLine)
{
static QStringList validEndTags = { QStringLiteral("Incident"),
QStringLiteral("Message"),
QStringLiteral("BenchmarkResult"),
QStringLiteral("QtVersion"),
QStringLiteral("QtBuild"),
QStringLiteral("QTestVersion") };
static QStringList validEndTags = {QStringLiteral("Incident"),
QStringLiteral("Message"),
QStringLiteral("BenchmarkResult"),
QStringLiteral("QtVersion"),
QStringLiteral("QtBuild"),
QStringLiteral("QTestVersion")};
if (m_className.isEmpty() && outputLine.trimmed().isEmpty())
return;
+1 -1
View File
@@ -55,7 +55,7 @@ static bool includesQtTest(const CPlusPlus::Document::Ptr &doc, const CPlusPlus:
{
static QStringList expectedHeaderPrefixes
= Utils::HostOsInfo::isMacHost()
? QStringList({ "QtTest.framework/Headers", "QtTest" }) : QStringList({ "QtTest" });
? QStringList({"QtTest.framework/Headers", "QtTest"}) : QStringList({"QtTest"});
const QList<CPlusPlus::Document::Include> includes = doc->resolvedIncludes();
@@ -35,7 +35,7 @@
namespace Autotest {
namespace Internal {
static QStringList specialFunctions({ "initTestCase", "cleanupTestCase", "init", "cleanup" });
static QStringList specialFunctions({"initTestCase", "cleanupTestCase", "init", "cleanup"});
/************************** Cpp Test Symbol Visitor ***************************/
@@ -57,8 +57,8 @@ static bool includesQtQuickTest(const CPlusPlus::Document::Ptr &doc,
{
static QStringList expectedHeaderPrefixes
= Utils::HostOsInfo::isMacHost()
? QStringList({ "QtQuickTest.framework/Headers", "QtQuickTest" })
: QStringList({ "QtQuickTest" });
? QStringList({"QtQuickTest.framework/Headers", "QtQuickTest"})
: QStringList({"QtQuickTest"});
const QList<CPlusPlus::Document::Include> includes = doc->resolvedIncludes();
@@ -30,7 +30,7 @@
namespace Autotest {
namespace Internal {
static QStringList specialFunctions({ "initTestCase", "cleanupTestCase", "init", "cleanup" });
static QStringList specialFunctions({"initTestCase", "cleanupTestCase", "init", "cleanup"});
TestQmlVisitor::TestQmlVisitor(QmlJS::Document::Ptr doc)
: m_currentDoc(doc)
@@ -317,7 +317,7 @@ void TestNavigationWidget::onRunThisTestTriggered(TestRunner::Mode runMode)
if (configuration) {
TestRunner *runner = TestRunner::instance();
runner->setSelectedTests( {configuration} );
runner->setSelectedTests({configuration});
runner->prepareToRunTests(runMode);
}
}
+1 -1
View File
@@ -229,7 +229,7 @@ QWidget *TestResultsPane::outputWidget(QWidget *parent)
QList<QWidget *> TestResultsPane::toolBarWidgets() const
{
return { m_expandCollapse, m_runAll, m_runSelected, m_stopTestRun, m_filterButton };
return {m_expandCollapse, m_runAll, m_runSelected, m_stopTestRun, m_filterButton};
}
QString TestResultsPane::displayName() const
@@ -63,7 +63,7 @@ QList<BuildStepInfo> AutogenStepFactory::availableSteps(BuildStepList *parent) c
return {};
QString display = tr("Autogen", "Display name for AutotoolsProjectManager::AutogenStep id.");
return {{ AUTOGEN_STEP_ID, display }};
return {{AUTOGEN_STEP_ID, display}};
}
BuildStep *AutogenStepFactory::create(BuildStepList *parent, Core::Id id)
@@ -62,7 +62,7 @@ QList<BuildStepInfo> AutoreconfStepFactory::availableSteps(BuildStepList *parent
return {};
QString display = tr("Autoreconf", "Display name for AutotoolsProjectManager::AutoreconfStep id.");
return {{ AUTORECONF_STEP_ID, display }};
return {{AUTORECONF_STEP_ID, display}};
}
BuildStep *AutoreconfStepFactory::create(BuildStepList *parent, Core::Id id)
@@ -77,7 +77,7 @@ QList<BuildStepInfo> ConfigureStepFactory::availableSteps(BuildStepList *parent)
return {};
QString display = tr("Configure", "Display name for AutotoolsProjectManager::ConfigureStep id.");
return {{ CONFIGURE_STEP_ID, display }};
return {{CONFIGURE_STEP_ID, display}};
}
BuildStep *ConfigureStepFactory::create(BuildStepList *parent, Core::Id id)
@@ -400,7 +400,7 @@ QStringList MakefileParser::targetValues(bool *hasVariables)
void MakefileParser::appendHeader(QStringList &list, const QDir &dir, const QString &fileName)
{
const char *const headerExtensions[] = { ".h", ".hh", ".hg", ".hxx", ".hpp", 0 };
const char *const headerExtensions[] = {".h", ".hh", ".hg", ".hxx", ".hpp", 0};
int i = 0;
while (headerExtensions[i] != 0) {
const QString headerFile = fileName + QLatin1String(headerExtensions[i]);
@@ -67,7 +67,7 @@ QList<BuildStepInfo> MakeStepFactory::availableSteps(BuildStepList *parent) cons
if (parent->target()->project()->id() != AUTOTOOLS_PROJECT_ID)
return {};
return {{ MAKE_STEP_ID, tr("Make", "Display name for AutotoolsProjectManager::MakeStep id.") }};
return {{MAKE_STEP_ID, tr("Make", "Display name for AutotoolsProjectManager::MakeStep id.")}};
}
BuildStep *MakeStepFactory::create(BuildStepList *parent, Core::Id id)
+5 -5
View File
@@ -155,11 +155,11 @@ bool GdbServerProvider::operator==(const GdbServerProvider &other) const
QVariantMap GdbServerProvider::toMap() const
{
return {
{ QLatin1String(idKeyC), m_id },
{ QLatin1String(displayNameKeyC), m_displayName },
{ QLatin1String(startupModeKeyC), m_startupMode },
{ QLatin1String(initCommandsKeyC), m_initCommands },
{ QLatin1String(resetCommandsKeyC), m_resetCommands }
{QLatin1String(idKeyC), m_id},
{QLatin1String(displayNameKeyC), m_displayName},
{QLatin1String(startupModeKeyC), m_startupMode},
{QLatin1String(initCommandsKeyC), m_initCommands},
{QLatin1String(resetCommandsKeyC), m_resetCommands}
};
}
@@ -59,9 +59,9 @@ static GdbServerProviderManager *m_instance = 0;
GdbServerProviderManager::GdbServerProviderManager(QObject *parent)
: QObject(parent)
, m_configFile(settingsFileName(QLatin1String(fileNameKeyC)))
, m_factories({ new DefaultGdbServerProviderFactory,
new OpenOcdGdbServerProviderFactory,
new StLinkUtilGdbServerProviderFactory })
, m_factories({new DefaultGdbServerProviderFactory,
new OpenOcdGdbServerProviderFactory,
new StLinkUtilGdbServerProviderFactory})
{
m_writer = new Utils::PersistentSettingsWriter(
m_configFile, QLatin1String("QtCreatorGdbServerProviders"));
+1 -1
View File
@@ -817,7 +817,7 @@ void BinEditorWidget::paintEvent(QPaintEvent *e)
QString itemString(m_bytesPerLine*3, QLatin1Char(' '));
QChar *itemStringData = itemString.data();
char changedString[160] = { false };
char changedString[160] = {false};
QTC_ASSERT((size_t)m_bytesPerLine < sizeof(changedString), return);
const char *hex = "0123456789abcdef";
@@ -48,7 +48,7 @@ bool isWarningOrNote(ClangBackEnd::DiagnosticSeverity severity)
bool isBlackListedDiagnostic(const ClangBackEnd::DiagnosticContainer &diagnostic,
bool isHeaderFile)
{
static const Utf8StringVector blackList {
static const Utf8StringVector blackList{
Utf8StringLiteral("warning: #pragma once in main file"),
Utf8StringLiteral("warning: #include_next in primary source file")
};
@@ -68,7 +68,7 @@ private:
ClangStaticAnalyzerDiagnosticModel::ClangStaticAnalyzerDiagnosticModel(QObject *parent)
: Utils::TreeModel<>(parent)
{
setHeader({ tr("Issue"), tr("Location") });
setHeader({tr("Issue"), tr("Location")});
}
void ClangStaticAnalyzerDiagnosticModel::addDiagnostics(const QList<Diagnostic> &diagnostics)
@@ -140,7 +140,7 @@ ClangStaticAnalyzerTool::ClangStaticAnalyzerTool(QObject *parent)
Debugger::registerPerspective(ClangStaticAnalyzerPerspectiveId, new Perspective(
tr("Clang Static Analyzer"),
{{ ClangStaticAnalyzerDockId, m_diagnosticView, {}, Perspective::SplitVertical }}
{{ClangStaticAnalyzerDockId, m_diagnosticView, {}, Perspective::SplitVertical}}
));
ActionDescription desc;
+2 -2
View File
@@ -1795,7 +1795,7 @@ static QString baseName(const QString &fileName)
bool ClearCasePlugin::vcsAdd(const QString &workingDir, const QString &fileName)
{
return ccFileOp(workingDir, tr("ClearCase Add File %1").arg(baseName(fileName)),
QStringList({ "mkelem", "-ci" }), fileName);
QStringList({"mkelem", "-ci"}), fileName);
}
bool ClearCasePlugin::vcsDelete(const QString &workingDir, const QString &fileName)
@@ -1806,7 +1806,7 @@ bool ClearCasePlugin::vcsDelete(const QString &workingDir, const QString &fileNa
return true;
return ccFileOp(workingDir, tr("ClearCase Remove File %1").arg(baseName(fileName)),
QStringList({ "rmname", "-force" }), fileName);
QStringList({"rmname", "-force"}), fileName);
}
bool ClearCasePlugin::vcsMove(const QString &workingDir, const QString &from, const QString &to)
@@ -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;
@@ -151,7 +151,7 @@ void CommandMappings::setPageTitle(const QString &s)
void CommandMappings::setTargetHeader(const QString &s)
{
d->commandList->setHeaderLabels({ tr("Command"), tr("Label"), s});
d->commandList->setHeaderLabels({tr("Command"), tr("Label"), s});
}
void CommandMappings::filterChanged(const QString &f)
@@ -110,7 +110,7 @@ namespace Internal {
ShortcutButton::ShortcutButton(QWidget *parent)
: QPushButton(parent)
, m_key({{ 0, 0, 0, 0 }})
, m_key({{0, 0, 0, 0}})
{
// Using ShortcutButton::tr() as workaround for QTBUG-34128
setToolTip(ShortcutButton::tr("Click and type the new key sequence."));
+1 -1
View File
@@ -116,7 +116,7 @@ static QVector<QString> splitInTwoLines(const QString &text, const QFontMetrics
if (splitPos < 0) {
splitLines[0] = fontMetrics.elidedText(text, Qt::ElideRight,
availableWidth);
QString common = Utils::commonPrefix(QStringList({ splitLines[0], text }));
QString common = Utils::commonPrefix(QStringList({splitLines[0], text}));
splitLines[1] = text.mid(common.length());
// elide the second line even if it fits, since it is cut off in mid-word
while (fontMetrics.width(QChar(0x2026) /*'...'*/ + splitLines[1]) > availableWidth
@@ -340,8 +340,8 @@ QWidget *SearchResultWindow::outputWidget(QWidget *)
*/
QList<QWidget*> SearchResultWindow::toolBarWidgets() const
{
return { d->m_expandCollapseButton, d->m_spacer,
d->m_historyLabel, d->m_spacer2, d->m_recentSearchesBox };
return {d->m_expandCollapseButton, d->m_spacer,
d->m_historyLabel, d->m_spacer2, d->m_recentSearchesBox};
}
/*!
@@ -94,9 +94,9 @@ void Core::Internal::CorePlugin::test_basefilefilter_data()
const QChar pathSeparator = QDir::separator();
const MyTestDataDir testDir(QLatin1String("testdata_basic"));
const QStringList testFiles({ QDir::fromNativeSeparators(testDir.file("file.cpp")),
QDir::fromNativeSeparators(testDir.file("main.cpp")),
QDir::fromNativeSeparators(testDir.file("subdir/main.cpp")) });
const QStringList testFiles({QDir::fromNativeSeparators(testDir.file("file.cpp")),
QDir::fromNativeSeparators(testDir.file("main.cpp")),
QDir::fromNativeSeparators(testDir.file("subdir/main.cpp"))});
QStringList testFilesShort;
foreach (const QString &file, testFiles)
testFilesShort << Utils::FileUtils::shortNativePath(Utils::FileName::fromString(file));
@@ -281,7 +281,7 @@ void LocatorSettingsPage::restoreFilterStates()
void LocatorSettingsPage::initializeModel()
{
m_model->setHeader(QStringList({ tr("Name"), tr("Prefix"), tr("Default") }));
m_model->setHeader(QStringList({tr("Name"), tr("Prefix"), tr("Default")}));
m_model->setHeaderToolTip(QStringList({
QString(),
ILocatorFilter::msgPrefixToolTip(),
+1 -1
View File
@@ -190,7 +190,7 @@ static void addThemesFromPath(const QString &path, QList<ThemeEntry> *themes)
{
static const QLatin1String extension("*.creatortheme");
QDir themeDir(path);
themeDir.setNameFilters({ extension });
themeDir.setNameFilters({extension});
themeDir.setFilter(QDir::Files);
const QStringList themeList = themeDir.entryList();
foreach (const QString &fileName, themeList) {
+36 -36
View File
@@ -550,46 +550,46 @@ void CorePlugin::testVcsManager_data()
QTest::addColumn<QStringList>("results");
QTest::newRow("A and B next to each other")
<< QStringList({ "a:a", "a/1:a", "a/2:a", "a/2/5:a", "a/2/5/6:a" })
<< QStringList({ "b:b", "b/3:b", "b/4:b" })
<< QStringList({ ":::-", // empty directory to look up
"c:::*", // Neither in A nor B
"a:a:A:*", // in A
"b:b:B:*", // in B
"b/3:b:B:*", // in B
"b/4:b:B:*", // in B
"a/1:a:A:*", // in A
"a/2:a:A:*", // in A
":::-", // empty directory to look up
"a/2/5/6:a:A:*", // in A
"a/2/5:a:A:-", // in A (cached from before!)
// repeat: These need to come from the cache now:
"c:::-", // Neither in A nor B
"a:a:A:-", // in A
"b:b:B:-", // in B
"b/3:b:B:-", // in B
"b/4:b:B:-", // in B
"a/1:a:A:-", // in A
"a/2:a:A:-", // in A
"a/2/5/6:a:A:-", // in A
"a/2/5:a:A:-" // in A
<< QStringList({"a:a", "a/1:a", "a/2:a", "a/2/5:a", "a/2/5/6:a"})
<< QStringList({"b:b", "b/3:b", "b/4:b"})
<< QStringList({":::-", // empty directory to look up
"c:::*", // Neither in A nor B
"a:a:A:*", // in A
"b:b:B:*", // in B
"b/3:b:B:*", // in B
"b/4:b:B:*", // in B
"a/1:a:A:*", // in A
"a/2:a:A:*", // in A
":::-", // empty directory to look up
"a/2/5/6:a:A:*", // in A
"a/2/5:a:A:-", // in A (cached from before!)
// repeat: These need to come from the cache now:
"c:::-", // Neither in A nor B
"a:a:A:-", // in A
"b:b:B:-", // in B
"b/3:b:B:-", // in B
"b/4:b:B:-", // in B
"a/1:a:A:-", // in A
"a/2:a:A:-", // in A
"a/2/5/6:a:A:-", // in A
"a/2/5:a:A:-" // in A
});
QTest::newRow("B in A")
<< QStringList({ "a:a", "a/1:a", "a/2:a", "a/2/5:a", "a/2/5/6:a" })
<< QStringList({ "a/1/b:a/1/b", "a/1/b/3:a/1/b", "a/1/b/4:a/1/b", "a/1/b/3/5:a/1/b",
"a/1/b/3/5/6:a/1/b" })
<< QStringList({ "a:a:A:*", // in A
"c:::*", // Neither in A nor B
"a/3:::*", // Neither in A nor B
"a/1/b/x:::*", // Neither in A nor B
"a/1/b:a/1/b:B:*", // in B
"a/1:a:A:*", // in A
"a/1/b/../../2:a:A:*" // in A
<< QStringList({"a:a", "a/1:a", "a/2:a", "a/2/5:a", "a/2/5/6:a"})
<< QStringList({"a/1/b:a/1/b", "a/1/b/3:a/1/b", "a/1/b/4:a/1/b", "a/1/b/3/5:a/1/b",
"a/1/b/3/5/6:a/1/b"})
<< QStringList({"a:a:A:*", // in A
"c:::*", // Neither in A nor B
"a/3:::*", // Neither in A nor B
"a/1/b/x:::*", // Neither in A nor B
"a/1/b:a/1/b:B:*", // in B
"a/1:a:A:*", // in A
"a/1/b/../../2:a:A:*" // in A
});
QTest::newRow("A and B") // first one wins...
<< QStringList({ "a:a", "a/1:a", "a/2:a" })
<< QStringList({ "a:a", "a/1:a", "a/2:a" })
<< QStringList({ "a/2:a:A:*" });
<< QStringList({"a:a", "a/1:a", "a/2:a"})
<< QStringList({"a:a", "a/1:a", "a/2:a"})
<< QStringList({"a/2:a:A:*"});
}
void CorePlugin::testVcsManager()
+5 -5
View File
@@ -120,11 +120,11 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe
addAutoReleasedObject(settingsPage);
// Create the protocols and append them to the Settings
Protocol *protos[] = { new PasteBinDotComProtocol,
new PasteBinDotCaProtocol,
new KdePasteProtocol,
new FileShareProtocol
};
Protocol *protos[] = {new PasteBinDotComProtocol,
new PasteBinDotCaProtocol,
new KdePasteProtocol,
new FileShareProtocol
};
const int count = sizeof(protos) / sizeof(Protocol *);
for (int i = 0; i < count; ++i) {
connect(protos[i], &Protocol::pasteDone, this, &CodepasterPlugin::finishPost);
+3 -3
View File
@@ -91,9 +91,9 @@ int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
const QStringList protocols = { KdePasteProtocol::protocolName().toLower(),
PasteBinDotCaProtocol::protocolName().toLower(),
PasteBinDotComProtocol::protocolName().toLower() };
const QStringList protocols = {KdePasteProtocol::protocolName().toLower(),
PasteBinDotCaProtocol::protocolName().toLower(),
PasteBinDotComProtocol::protocolName().toLower()};
ArgumentsCollector argsCollector(protocols);
QStringList arguments = QCoreApplication::arguments();
arguments.removeFirst();
+1 -1
View File
@@ -318,7 +318,7 @@ void DoxygenTest::testWithMacroFromHeaderBeforeFunction()
const TestDocument headerDocumentDefiningMacro("header.h", "#define API\n");
runTest(given, expected, /*settings=*/ 0, { headerDocumentDefiningMacro });
runTest(given, expected, /*settings=*/ 0, {headerDocumentDefiningMacro});
}
void DoxygenTest::testNoLeadingAsterisks_data()
@@ -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")),
+4 -4
View File
@@ -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();
+2 -2
View File
@@ -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());
+23 -23
View File
@@ -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")));
+3 -3
View File
@@ -902,8 +902,8 @@ BreakHandler::BreakHandler()
#if USE_BREAK_MODEL_TEST
new ModelTest(this, 0);
#endif
setHeader(QStringList({ tr("Number"), tr("Function"), tr("File"), tr("Line"), tr("Address"),
tr("Condition"), tr("Ignore"), tr("Threads") }));
setHeader(QStringList({tr("Number"), tr("Function"), tr("File"), tr("Line"), tr("Address"),
tr("Condition"), tr("Ignore"), tr("Threads")}));
}
static inline bool fileNameMatch(const QString &f1, const QString &f2)
@@ -1936,7 +1936,7 @@ bool BreakHandler::setData(const QModelIndex &idx, const QVariant &value, int ro
if (ev.as<QMouseEvent>(QEvent::MouseButtonDblClick)) {
if (Breakpoint b = findBreakpointByIndex(idx)) {
if (idx.column() >= BreakpointAddressColumn)
editBreakpoints({ b }, ev.view());
editBreakpoints({b}, ev.view());
else
b.gotoLocation();
} else {
+2 -2
View File
@@ -164,8 +164,8 @@ QWidget *Console::outputWidget(QWidget *)
QList<QWidget *> Console::toolBarWidgets() const
{
return { m_showDebugButton, m_showWarningButton, m_showErrorButton,
m_spacer, m_statusLabel };
return {m_showDebugButton, m_showWarningButton, m_showErrorButton,
m_spacer, m_statusLabel};
}
int Console::priorityInStatusBar() const
+1 -1
View File
@@ -123,7 +123,7 @@ void DebuggerItem::reinitializeFromFile()
SynchronousProcess proc;
SynchronousProcessResponse response
= proc.runBlocking(m_command.toString(), QStringList({ QLatin1String(version) }));
= proc.runBlocking(m_command.toString(), QStringList({QLatin1String(version)}));
if (response.result != SynchronousProcessResponse::Finished) {
m_engineType = NoEngineType;
return;
+4 -4
View File
@@ -220,7 +220,7 @@ const DebuggerItem *findDebugger(const Predicate &pred)
DebuggerItemModel::DebuggerItemModel()
{
setHeader({ tr("Name"), tr("Location"), tr("Type") });
setHeader({tr("Name"), tr("Location"), tr("Type")});
rootItem()->appendChild(new StaticTreeItem(tr("Auto-detected")));
rootItem()->appendChild(new StaticTreeItem(tr("Manual")));
}
@@ -702,8 +702,8 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
{
const QStringList filters = { "gdb-i686-pc-mingw32", "gdb-i686-pc-mingw32.exe", "gdb",
"gdb.exe", "lldb", "lldb.exe", "lldb-*" };
const QStringList filters = {"gdb-i686-pc-mingw32", "gdb-i686-pc-mingw32.exe", "gdb",
"gdb.exe", "lldb", "lldb.exe", "lldb-*"};
// DebuggerItem result;
// result.setAutoDetected(true);
@@ -731,7 +731,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
SynchronousProcess lldbInfo;
lldbInfo.setTimeoutS(2);
SynchronousProcessResponse response
= lldbInfo.runBlocking(QLatin1String("xcrun"), { "--find", "lldb" });
= lldbInfo.runBlocking(QLatin1String("xcrun"), {"--find", "lldb"});
if (response.result == Utils::SynchronousProcessResponse::Finished) {
QString lPath = response.allOutput().trimmed();
if (!lPath.isEmpty()) {
+17 -17
View File
@@ -1848,22 +1848,22 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
// qmlToolbar.addWidget(new StyledSeparator);
auto createBasePerspective = [this] { return new Perspective({}, {
{ DOCKWIDGET_STACK, m_stackWindow, {}, Perspective::SplitVertical },
{ DOCKWIDGET_BREAK, m_breakWindow, DOCKWIDGET_STACK, Perspective::SplitHorizontal },
{ DOCKWIDGET_THREADS, m_threadsWindow, DOCKWIDGET_BREAK, Perspective::AddToTab, false },
{ DOCKWIDGET_MODULES, m_modulesWindow, DOCKWIDGET_THREADS, Perspective::AddToTab, false },
{ DOCKWIDGET_SOURCE_FILES, m_sourceFilesWindow, DOCKWIDGET_MODULES, Perspective::AddToTab, false },
{ DOCKWIDGET_SNAPSHOTS, m_snapshotWindow, DOCKWIDGET_SOURCE_FILES, Perspective::AddToTab, false },
{ DOCKWIDGET_WATCHERS, m_localsAndExpressionsWindow, {}, Perspective::AddToTab, true,
Qt::RightDockWidgetArea },
{ DOCKWIDGET_OUTPUT, m_logWindow, {}, Perspective::AddToTab, false, Qt::TopDockWidgetArea },
{ DOCKWIDGET_BREAK, 0, {}, Perspective::Raise }
{DOCKWIDGET_STACK, m_stackWindow, {}, Perspective::SplitVertical},
{DOCKWIDGET_BREAK, m_breakWindow, DOCKWIDGET_STACK, Perspective::SplitHorizontal},
{DOCKWIDGET_THREADS, m_threadsWindow, DOCKWIDGET_BREAK, Perspective::AddToTab, false},
{DOCKWIDGET_MODULES, m_modulesWindow, DOCKWIDGET_THREADS, Perspective::AddToTab, false},
{DOCKWIDGET_SOURCE_FILES, m_sourceFilesWindow, DOCKWIDGET_MODULES, Perspective::AddToTab, false},
{DOCKWIDGET_SNAPSHOTS, m_snapshotWindow, DOCKWIDGET_SOURCE_FILES, Perspective::AddToTab, false},
{DOCKWIDGET_WATCHERS, m_localsAndExpressionsWindow, {}, Perspective::AddToTab, true,
Qt::RightDockWidgetArea},
{DOCKWIDGET_OUTPUT, m_logWindow, {}, Perspective::AddToTab, false, Qt::TopDockWidgetArea},
{DOCKWIDGET_BREAK, 0, {}, Perspective::Raise}
}); };
Perspective *cppPerspective = createBasePerspective();
cppPerspective->setName(tr("Debugger"));
cppPerspective->addOperation({ DOCKWIDGET_REGISTER, m_registerWindow, DOCKWIDGET_SNAPSHOTS,
Perspective::AddToTab, false });
cppPerspective->addOperation({DOCKWIDGET_REGISTER, m_registerWindow, DOCKWIDGET_SNAPSHOTS,
Perspective::AddToTab, false});
Debugger::registerToolbar(CppPerspectiveId, toolbar);
Debugger::registerPerspective(CppPerspectiveId, cppPerspective);
@@ -2142,16 +2142,16 @@ void DebuggerPlugin::getEnginesState(QByteArray *json) const
{
QTC_ASSERT(json, return);
QVariantMap result {
{ "version", 1 }
{"version", 1}
};
QVariantMap states;
for (int i = 0; i < dd->m_snapshotHandler->size(); ++i) {
const DebuggerEngine *engine = dd->m_snapshotHandler->at(i);
states[QString::number(i)] = QVariantMap({
{ "current", dd->m_snapshotHandler->currentIndex() == i },
{ "pid", engine->inferiorPid() },
{ "state", engine->state() }
{"current", dd->m_snapshotHandler->currentIndex() == i},
{"pid", engine->inferiorPid()},
{"state", engine->state()}
});
}
@@ -3873,7 +3873,7 @@ void DebuggerUnitTests::testDebuggerMatching()
QList<QObject *> DebuggerPlugin::createTestObjects() const
{
return { new DebuggerUnitTests };
return {new DebuggerUnitTests};
}
#else // ^-- if WITH_TESTS else --v
+2 -2
View File
@@ -646,11 +646,11 @@ QString decodeData(const QString &ba, const QString &encoding)
case DebuggerEncoding::HexEncodedFloat: {
const QByteArray s = QByteArray::fromHex(ba.toUtf8());
if (enc.size == 4) {
union { char c[4]; float f; } u = { { s[3], s[2], s[1], s[0] } };
union { char c[4]; float f; } u = {{s[3], s[2], s[1], s[0]}};
return QString::number(u.f);
}
if (enc.size == 8) {
union { char c[8]; double d; } u = { { s[7], s[6], s[5], s[4], s[3], s[2], s[1], s[0] } };
union { char c[8]; double d; } u = {{s[7], s[6], s[5], s[4], s[3], s[2], s[1], s[0]}};
return QString::number(u.d);
}
}
@@ -236,9 +236,9 @@ class ToolTipModel : public TreeModel<ToolTipWatchItem>
public:
ToolTipModel()
{
setHeader({ DebuggerToolTipManager::tr("Name"),
DebuggerToolTipManager::tr("Value"),
DebuggerToolTipManager::tr("Type") });
setHeader({DebuggerToolTipManager::tr("Name"),
DebuggerToolTipManager::tr("Value"),
DebuggerToolTipManager::tr("Type")});
m_enabled = true;
auto item = new ToolTipWatchItem;
item->expandable = true;
+2 -2
View File
@@ -161,8 +161,8 @@ QString registerViewTitle(const QString &registerName, quint64 addr)
QList<MemoryMarkup> registerViewMarkup(quint64 a, const QString &regName)
{
return { MemoryMarkup(a, 1, QColor(Qt::blue).lighter(),
MemoryAgent::tr("Register \"%1\"").arg(regName)) };
return {MemoryMarkup(a, 1, QColor(Qt::blue).lighter(),
MemoryAgent::tr("Register \"%1\"").arg(regName))};
}
///////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -196,7 +196,7 @@ bool ModulesModel::contextMenuEvent(const ItemViewEvent &ev)
addAction(menu, tr("Show Dependencies of \"%1\"").arg(moduleName),
tr("Show Dependencies"),
moduleNameValid && !moduleName.isEmpty() && HostOsInfo::isWindowsHost(),
[this, modulePath] { QProcess::startDetached("depends", { modulePath }); });
[this, modulePath] { QProcess::startDetached("depends", {modulePath}); });
addAction(menu, tr("Load Symbols for All Modules"),
enabled && canLoadSymbols,
+1 -1
View File
@@ -136,7 +136,7 @@ void PdbEngine::setupEngine()
notifyEngineSetupFailed();
}
QStringList args = { bridge, scriptFile.fileName() };
QStringList args = {bridge, scriptFile.fileName()};
args.append(Utils::QtcProcess::splitArgs(runParameters().inferior.workingDirectory));
showMessage("STARTING " + m_interpreter + QLatin1Char(' ') + args.join(QLatin1Char(' ')));
m_proc.setEnvironment(runParameters().debugger.environment.toStringList());
+2 -2
View File
@@ -466,7 +466,7 @@ WatchModel::WatchModel(WatchHandler *handler, DebuggerEngine *engine)
m_contentsValid = true;
setHeader({ tr("Name"), tr("Value"), tr("Type") });
setHeader({tr("Name"), tr("Value"), tr("Type")});
m_localsRoot = new WatchItem;
m_localsRoot->iname = "local";
m_localsRoot->name = tr("Locals");
@@ -2070,7 +2070,7 @@ void WatchHandler::notifyUpdateStarted(const UpdateParameters &updateParameters)
{
QStringList inames = updateParameters.partialVariables();
if (inames.isEmpty())
inames = QStringList({ "local", "return" });
inames = QStringList({"local", "return"});
auto marker = [](WatchItem *item) { item->outdated = true; };
+1 -1
View File
@@ -38,7 +38,7 @@ namespace Internal {
FormClassWizard::FormClassWizard()
{
setRequiredFeatures({ QtSupport::Constants::FEATURE_QWIDGETS });
setRequiredFeatures({QtSupport::Constants::FEATURE_QWIDGETS});
}
QString FormClassWizard::headerSuffix() const
+12 -12
View File
@@ -165,7 +165,7 @@ public:
const QString hFile = files.at(1);
QCOMPARE(DocumentModel::openedDocuments().size(), files.size());
waitForFilesInGlobalSnapshot({ cppFile, hFile });
waitForFilesInGlobalSnapshot({cppFile, hFile});
// Execute "Go To Slot"
QDesignerIntegrationInterface *integration = FormEditorW::designerEditor()->integration();
@@ -214,8 +214,8 @@ public:
// Since no project is opened and the ui_*.h is not generated,
// the following diagnostic messages will be ignored.
const QStringList ignoreList = QStringList({ "ui_form.h: No such file or directory",
"QWidget: No such file or directory" });
const QStringList ignoreList = QStringList({"ui_form.h: No such file or directory",
"QWidget: No such file or directory"});
QList<Document::DiagnosticMessage> cleanedDiagnosticMessages;
foreach (const Document::DiagnosticMessage &message, document->diagnosticMessages()) {
if (!ignoreList.contains(message.text()))
@@ -246,9 +246,9 @@ void FormEditorPlugin::test_gotoslot_data()
MyTestDataDir testDataDirWithoutProject(_("gotoslot_withoutProject"));
QTest::newRow("withoutProject")
<< QStringList({ testDataDirWithoutProject.file(_("form.cpp")),
testDataDirWithoutProject.file(_("form.h")),
testDataDirWithoutProject.file(_("form.ui")) });
<< QStringList({testDataDirWithoutProject.file(_("form.cpp")),
testDataDirWithoutProject.file(_("form.h")),
testDataDirWithoutProject.file(_("form.ui"))});
// Finding the right class for inserting definitions/declarations is based on
// finding a class with a member whose type is the class from the "ui_xxx.h" header.
@@ -259,18 +259,18 @@ void FormEditorPlugin::test_gotoslot_data()
testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_pointer"));
QTest::newRow("insertIntoCorrectClass_pointer")
<< QStringList({ testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
testDataDirWithoutProject.file(_("form.ui")) }); // reuse
<< QStringList({testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
testDataDirWithoutProject.file(_("form.ui"))}); // reuse
testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_non-pointer"));
QTest::newRow("insertIntoCorrectClass_non-pointer")
<< QStringList({ testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
testDataDirWithoutProject.file(_("form.ui")) }); // reuse
<< QStringList({testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
testDataDirWithoutProject.file(_("form.ui"))}); // reuse
testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_pointer_ns_using"));
QTest::newRow("insertIntoCorrectClass_pointer_ns_using")
<< QStringList({ testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
testDataDir.file(_("form.ui")) });
<< QStringList({testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
testDataDir.file(_("form.ui"))});
}
} // namespace Internal
@@ -353,9 +353,9 @@ static QString addConstRefIfNeeded(const QString &argument)
return argument;
// for those types we don't want to add "const &"
static const QStringList nonConstRefs = QStringList({ "bool", "int", "uint", "float", "double",
"long", "short", "char", "signed",
"unsigned", "qint64", "quint64" });
static const QStringList nonConstRefs = QStringList({"bool", "int", "uint", "float", "double",
"long", "short", "char", "signed",
"unsigned", "qint64", "quint64"});
for (int i = 0; i < nonConstRefs.count(); i++) {
const QString nonConstRef = nonConstRefs.at(i);
+76 -76
View File
@@ -788,91 +788,91 @@ static const QMap<QString, int> &vimKeyNames()
{
static const QMap<QString, int> k = {
// FIXME: Should be value of mapleader.
{ "LEADER", Key_Backslash },
{"LEADER", Key_Backslash},
{ "SPACE", Key_Space },
{ "TAB", Key_Tab },
{ "NL", Key_Return },
{ "NEWLINE", Key_Return },
{ "LINEFEED", Key_Return },
{ "LF", Key_Return },
{ "CR", Key_Return },
{ "RETURN", Key_Return },
{ "ENTER", Key_Return },
{ "BS", Key_Backspace },
{ "BACKSPACE", Key_Backspace },
{ "ESC", Key_Escape },
{ "BAR", Key_Bar },
{ "BSLASH", Key_Backslash },
{ "DEL", Key_Delete },
{ "DELETE", Key_Delete },
{ "KDEL", Key_Delete },
{ "UP", Key_Up },
{ "DOWN", Key_Down },
{ "LEFT", Key_Left },
{ "RIGHT", Key_Right },
{"SPACE", Key_Space},
{"TAB", Key_Tab},
{"NL", Key_Return},
{"NEWLINE", Key_Return},
{"LINEFEED", Key_Return},
{"LF", Key_Return},
{"CR", Key_Return},
{"RETURN", Key_Return},
{"ENTER", Key_Return},
{"BS", Key_Backspace},
{"BACKSPACE", Key_Backspace},
{"ESC", Key_Escape},
{"BAR", Key_Bar},
{"BSLASH", Key_Backslash},
{"DEL", Key_Delete},
{"DELETE", Key_Delete},
{"KDEL", Key_Delete},
{"UP", Key_Up},
{"DOWN", Key_Down},
{"LEFT", Key_Left},
{"RIGHT", Key_Right},
{ "LT", Key_Less },
{ "GT", Key_Greater },
{"LT", Key_Less},
{"GT", Key_Greater},
{ "F1", Key_F1 },
{ "F2", Key_F2 },
{ "F3", Key_F3 },
{ "F4", Key_F4 },
{ "F5", Key_F5 },
{ "F6", Key_F6 },
{ "F7", Key_F7 },
{ "F8", Key_F8 },
{ "F9", Key_F9 },
{ "F10", Key_F10 },
{"F1", Key_F1},
{"F2", Key_F2},
{"F3", Key_F3},
{"F4", Key_F4},
{"F5", Key_F5},
{"F6", Key_F6},
{"F7", Key_F7},
{"F8", Key_F8},
{"F9", Key_F9},
{"F10", Key_F10},
{ "F11", Key_F11 },
{ "F12", Key_F12 },
{ "F13", Key_F13 },
{ "F14", Key_F14 },
{ "F15", Key_F15 },
{ "F16", Key_F16 },
{ "F17", Key_F17 },
{ "F18", Key_F18 },
{ "F19", Key_F19 },
{ "F20", Key_F20 },
{"F11", Key_F11},
{"F12", Key_F12},
{"F13", Key_F13},
{"F14", Key_F14},
{"F15", Key_F15},
{"F16", Key_F16},
{"F17", Key_F17},
{"F18", Key_F18},
{"F19", Key_F19},
{"F20", Key_F20},
{ "F21", Key_F21 },
{ "F22", Key_F22 },
{ "F23", Key_F23 },
{ "F24", Key_F24 },
{ "F25", Key_F25 },
{ "F26", Key_F26 },
{ "F27", Key_F27 },
{ "F28", Key_F28 },
{ "F29", Key_F29 },
{ "F30", Key_F30 },
{"F21", Key_F21},
{"F22", Key_F22},
{"F23", Key_F23},
{"F24", Key_F24},
{"F25", Key_F25},
{"F26", Key_F26},
{"F27", Key_F27},
{"F28", Key_F28},
{"F29", Key_F29},
{"F30", Key_F30},
{ "F31", Key_F31 },
{ "F32", Key_F32 },
{ "F33", Key_F33 },
{ "F34", Key_F34 },
{ "F35", Key_F35 },
{"F31", Key_F31},
{"F32", Key_F32},
{"F33", Key_F33},
{"F34", Key_F34},
{"F35", Key_F35},
{ "INSERT", Key_Insert },
{ "INS", Key_Insert },
{ "KINSERT", Key_Insert },
{ "HOME", Key_Home },
{ "END", Key_End },
{ "PAGEUP", Key_PageUp },
{ "PAGEDOWN", Key_PageDown },
{"INSERT", Key_Insert},
{"INS", Key_Insert},
{"KINSERT", Key_Insert},
{"HOME", Key_Home},
{"END", Key_End},
{"PAGEUP", Key_PageUp},
{"PAGEDOWN", Key_PageDown},
{ "KPLUS", Key_Plus },
{ "KMINUS", Key_Minus },
{ "KDIVIDE", Key_Slash },
{ "KMULTIPLY", Key_Asterisk },
{ "KENTER", Key_Enter },
{ "KPOINT", Key_Period },
{"KPLUS", Key_Plus},
{"KMINUS", Key_Minus},
{"KDIVIDE", Key_Slash},
{"KMULTIPLY", Key_Asterisk},
{"KENTER", Key_Enter},
{"KPOINT", Key_Period},
{ "CAPS", Key_CapsLock },
{ "NUM", Key_NumLock },
{ "SCROLL", Key_ScrollLock },
{ "ALTGR", Key_AltGr }
{"CAPS", Key_CapsLock},
{"NUM", Key_NumLock},
{"SCROLL", Key_ScrollLock},
{"ALTGR", Key_AltGr}
};
return k;
@@ -326,9 +326,9 @@ QList<BuildStepInfo> GenericMakeStepFactory::availableSteps(BuildStepList *paren
if (parent->target()->project()->id() != Constants::GENERICPROJECT_ID)
return {};
return {{ GENERIC_MS_ID,
QCoreApplication::translate("GenericProjectManager::Internal::GenericMakeStep",
GENERIC_MS_DISPLAY_NAME) }};
return {{GENERIC_MS_ID,
QCoreApplication::translate("GenericProjectManager::Internal::GenericMakeStep",
GENERIC_MS_DISPLAY_NAME)}};
}
BuildStep *GenericMakeStepFactory::create(BuildStepList *parent, const Id id)
@@ -110,7 +110,7 @@ QString GenericProjectWizardDialog::projectName() const
GenericProjectWizard::GenericProjectWizard()
{
setSupportedProjectTypes({ Constants::GENERICPROJECT_ID });
setSupportedProjectTypes({Constants::GENERICPROJECT_ID});
// TODO do something about the ugliness of standard icons in sizes different than 16, 32, 64, 128
{
QPixmap icon(22, 22);
+1 -1
View File
@@ -336,7 +336,7 @@ void BranchDialog::log()
QString branchName = m_model->fullName(selectedIndex(), true);
if (branchName.isEmpty())
return;
GitPlugin::client()->log(m_repository, QString(), false, { branchName });
GitPlugin::client()->log(m_repository, QString(), false, {branchName});
}
void BranchDialog::reset()
+11 -11
View File
@@ -174,7 +174,7 @@ public:
}
return names;
}
return { fullName().join('/') };
return {fullName().join('/')};
}
int rowOf(BranchNode *node)
@@ -318,7 +318,7 @@ bool BranchModel::setData(const QModelIndex &index, const QVariant &value, int r
QString output;
QString errorMessage;
if (!m_client->synchronousBranchCmd(m_workingDirectory,
{ "-m", oldFullName.last(), newFullName.last() },
{"-m", oldFullName.last(), newFullName.last()},
&output, &errorMessage)) {
node->name = oldFullName.last();
VcsOutputWindow::appendError(errorMessage);
@@ -363,8 +363,8 @@ bool BranchModel::refresh(const QString &workingDirectory, QString *errorMessage
}
m_currentSha = m_client->synchronousTopRevision(workingDirectory);
const QStringList args = { "--format=%(objectname)\t%(refname)\t%(upstream:short)\t"
"%(*objectname)\t%(committerdate:raw)\t%(*committerdate:raw)" };
const QStringList args = {"--format=%(objectname)\t%(refname)\t%(upstream:short)\t"
"%(*objectname)\t%(committerdate:raw)\t%(*committerdate:raw)"};
QString output;
if (!m_client->synchronousForEachRefCmd(workingDirectory, args, &output, errorMessage))
VcsOutputWindow::appendError(*errorMessage);
@@ -403,7 +403,7 @@ void BranchModel::renameBranch(const QString &oldName, const QString &newName)
{
QString errorMessage;
QString output;
if (!m_client->synchronousBranchCmd(m_workingDirectory, { "-m", oldName, newName },
if (!m_client->synchronousBranchCmd(m_workingDirectory, {"-m", oldName, newName},
&output, &errorMessage))
VcsOutputWindow::appendError(errorMessage);
else
@@ -414,9 +414,9 @@ void BranchModel::renameTag(const QString &oldName, const QString &newName)
{
QString errorMessage;
QString output;
if (!m_client->synchronousTagCmd(m_workingDirectory, { newName, oldName },
if (!m_client->synchronousTagCmd(m_workingDirectory, {newName, oldName},
&output, &errorMessage)
|| !m_client->synchronousTagCmd(m_workingDirectory, { "-d", oldName },
|| !m_client->synchronousTagCmd(m_workingDirectory, {"-d", oldName},
&output, &errorMessage)) {
VcsOutputWindow::appendError(errorMessage);
} else {
@@ -513,7 +513,7 @@ void BranchModel::removeBranch(const QModelIndex &idx)
QString errorMessage;
QString output;
if (!m_client->synchronousBranchCmd(m_workingDirectory, { "-D", branch }, &output, &errorMessage)) {
if (!m_client->synchronousBranchCmd(m_workingDirectory, {"-D", branch}, &output, &errorMessage)) {
VcsOutputWindow::appendError(errorMessage);
return;
}
@@ -529,7 +529,7 @@ void BranchModel::removeTag(const QModelIndex &idx)
QString errorMessage;
QString output;
if (!m_client->synchronousTagCmd(m_workingDirectory, { "-d", tag }, &output, &errorMessage)) {
if (!m_client->synchronousTagCmd(m_workingDirectory, {"-d", tag}, &output, &errorMessage)) {
VcsOutputWindow::appendError(errorMessage);
return;
}
@@ -556,7 +556,7 @@ bool BranchModel::branchIsMerged(const QModelIndex &idx)
QString errorMessage;
QString output;
if (!m_client->synchronousBranchCmd(m_workingDirectory, { "-a", "--contains", sha(idx) },
if (!m_client->synchronousBranchCmd(m_workingDirectory, {"-a", "--contains", sha(idx)},
&output, &errorMessage)) {
VcsOutputWindow::appendError(errorMessage);
}
@@ -594,7 +594,7 @@ QModelIndex BranchModel::addBranch(const QString &name, bool track, const QModel
QString errorMessage;
QDateTime branchDateTime;
QStringList args = { QLatin1String(track ? "--track" : "--no-track"), name };
QStringList args = {QLatin1String(track ? "--track" : "--no-track"), name};
if (!fullTrackedBranch.isEmpty()) {
args << fullTrackedBranch;
startSha = sha(startPoint);
+2 -2
View File
@@ -220,7 +220,7 @@ void ChangeSelectionDialog::recalculateCompletion()
GitClient *client = GitPlugin::client();
VcsBase::VcsCommand *command = client->asyncForEachRefCmd(
workingDir, { "--format=%(refname:short)" });
workingDir, {"--format=%(refname:short)"});
connect(this, &QObject::destroyed, command, &VcsBase::VcsCommand::abort);
connect(command, &VcsBase::VcsCommand::stdOutText, [this](const QString &output) {
m_changeModel->setStringList(output.split('\n'));
@@ -251,7 +251,7 @@ void ChangeSelectionDialog::recalculateDetails()
connect(m_process, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
this, &ChangeSelectionDialog::setDetails);
m_process->start(m_gitExecutable.toString(), { "show", "--stat=80", ref });
m_process->start(m_gitExecutable.toString(), {"show", "--stat=80", ref});
m_process->closeWriteChannel();
if (!m_process->waitForStarted())
m_ui->detailsText->setPlainText(tr("Error: Could not start Git."));
+1 -1
View File
@@ -45,7 +45,7 @@ void BranchComboBox::init(const QString &repository)
QString output;
const QString branchPrefix("refs/heads/");
if (!GitPlugin::client()->synchronousForEachRefCmd(
m_repository, { "--format=%(refname)", branchPrefix }, &output)) {
m_repository, {"--format=%(refname)", branchPrefix}, &output)) {
return;
}
const QStringList branches = output.trimmed().split('\n');
+1 -1
View File
@@ -200,7 +200,7 @@ QString GerritChange::filterString() const
QStringList GerritChange::gitFetchArguments(const GerritServer &server) const
{
return { "fetch", server.url() + '/' + project, currentPatchSet.ref };
return {"fetch", server.url() + '/' + project, currentPatchSet.ref};
}
QString GerritChange::fullTitle() const
+1 -1
View File
@@ -93,7 +93,7 @@ GerritOptionsWidget::GerritOptionsWidget(QWidget *parent)
formLayout->addRow(tr("&Host:"), m_hostLineEdit);
formLayout->addRow(tr("&User:"), m_userLineEdit);
m_sshChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_sshChooser->setCommandVersionArguments({ "-V" });
m_sshChooser->setCommandVersionArguments({"-V"});
m_sshChooser->setHistoryCompleter("Git.SshCommand.History");
formLayout->addRow(tr("&ssh:"), m_sshChooser);
m_portSpinBox->setMinimum(1);
+1 -1
View File
@@ -91,7 +91,7 @@ void GerritParameters::setPortFlagBySshType()
{
bool isPlink = false;
if (!ssh.isEmpty()) {
const QString version = Utils::PathChooser::toolVersion(ssh, { "-V" });
const QString version = Utils::PathChooser::toolVersion(ssh, {"-V"});
isPlink = version.contains("plink", Qt::CaseInsensitive);
}
portFlag = QLatin1String(isPlink ? "-P" : defaultPortFlag);
+1 -1
View File
@@ -346,7 +346,7 @@ void GerritPlugin::push(const QString &topLevel)
if (!options.isEmpty())
target += '%' + options.join(',');
GitPlugin::client()->push(topLevel, { dialog.selectedRemoteName(), target });
GitPlugin::client()->push(topLevel, {dialog.selectedRemoteName(), target});
}
// Open or raise the Gerrit dialog window.
+2 -2
View File
@@ -66,7 +66,7 @@ QString GerritPushDialog::determineRemoteBranch(const QString &localBranch)
QString error;
if (!GitPlugin::client()->synchronousBranchCmd(
m_workingDir, { "-r", "--contains", earliestCommit + '^' }, &output, &error)) {
m_workingDir, {"-r", "--contains", earliestCommit + '^'}, &output, &error)) {
return QString();
}
const QString head = "/HEAD";
@@ -99,7 +99,7 @@ void GerritPushDialog::initRemoteBranches()
QString remotesPrefix("refs/remotes/");
if (!GitPlugin::client()->synchronousForEachRefCmd(
m_workingDir, { "--format=%(refname)\t%(committerdate:raw)", remotesPrefix }, &output)) {
m_workingDir, {"--format=%(refname)\t%(committerdate:raw)", remotesPrefix}, &output)) {
return;
}
+80 -80
View File
@@ -207,7 +207,7 @@ QStringList BaseController::addHeadWhenCommandInProgress() const
// instead of showing unsupported combined diff format.
GitClient::CommandInProgress commandInProgress = GitPlugin::client()->checkCommandInProgress(m_directory);
if (commandInProgress != GitClient::NoCommand)
return { HEAD };
return {HEAD};
return QStringList();
}
@@ -224,7 +224,7 @@ public:
void RepositoryDiffController::reload()
{
QStringList args = { "diff" };
QStringList args = {"diff"};
args.append(addHeadWhenCommandInProgress());
runCommand(QList<QStringList>() << addConfigurationArguments(args));
}
@@ -246,7 +246,7 @@ private:
void FileDiffController::reload()
{
QStringList args = { "diff" };
QStringList args = {"diff"};
args.append(addHeadWhenCommandInProgress());
args << "--" << m_fileName;
@@ -275,13 +275,13 @@ void FileListDiffController::reload()
{
QList<QStringList> argLists;
if (!m_stagedFiles.isEmpty()) {
QStringList stagedArgs = { "diff", "--cached", "--" };
QStringList stagedArgs = {"diff", "--cached", "--"};
stagedArgs << m_stagedFiles;
argLists << addConfigurationArguments(stagedArgs);
}
if (!m_unstagedFiles.isEmpty()) {
QStringList unstagedArgs = { "diff" };
QStringList unstagedArgs = {"diff"};
unstagedArgs << addHeadWhenCommandInProgress() << "--" << m_unstagedFiles;
argLists << addConfigurationArguments(unstagedArgs);
}
@@ -308,7 +308,7 @@ private:
void ProjectDiffController::reload()
{
QStringList args = { "diff" };
QStringList args = {"diff"};
args << addHeadWhenCommandInProgress() << "--" << m_projectPaths;
runCommand(QList<QStringList>() << addConfigurationArguments(args));
}
@@ -331,7 +331,7 @@ private:
void BranchDiffController::reload()
{
QStringList args = { "diff" };
QStringList args = {"diff"};
args << addHeadWhenCommandInProgress() << m_branch;
runCommand(QList<QStringList>() << addConfigurationArguments(args));
}
@@ -358,7 +358,7 @@ private:
void ShowController::reload()
{
const QStringList args = { "show", "-s", noColorOption, decorateOption, showFormatC, m_id };
const QStringList args = {"show", "-s", noColorOption, decorateOption, showFormatC, m_id};
m_state = GettingDescription;
runCommand(QList<QStringList>() << args, GitPlugin::client()->encoding(m_directory, "i18n.commitEncoding"));
}
@@ -377,8 +377,8 @@ void ShowController::reloadFinished(bool success)
QTC_ASSERT(m_state != Idle, return);
if (m_state == GettingDescription && success) {
const QStringList args = { "show", "--format=format:", // omit header, already generated
noColorOption, decorateOption, m_id };
const QStringList args = {"show", "--format=format:", // omit header, already generated
noColorOption, decorateOption, m_id};
m_state = GettingDiff;
runCommand(QList<QStringList>() << addConfigurationArguments(args));
return;
@@ -446,7 +446,7 @@ public:
m_patienceButton->setVisible(diffButton->isChecked());
m_ignoreWSButton->setVisible(diffButton->isChecked());
QAction *firstParentButton =
addToggleButton({ "-m", "--first-parent" },
addToggleButton({"-m", "--first-parent"},
tr("First Parent"),
tr("Follow only the first parent on merge commits."));
mapSetting(firstParentButton, settings.boolPointer(GitSettings::firstParentKey));
@@ -631,7 +631,7 @@ QString GitClient::findGitDirForRepository(const QString &repositoryDir) const
bool GitClient::managesFile(const QString &workingDirectory, const QString &fileName) const
{
return vcsFullySynchronousExec(workingDirectory, { "ls-files", "--error-unmatch", fileName }).result
return vcsFullySynchronousExec(workingDirectory, {"ls-files", "--error-unmatch", fileName}).result
== SynchronousProcessResponse::Finished;
}
@@ -699,7 +699,7 @@ void GitClient::stage(const QString &patch, bool revert)
patchFile.write(patchData);
patchFile.close();
QStringList args = { "--cached" };
QStringList args = {"--cached"};
if (revert)
args << "--reverse";
QString errorMessage;
@@ -767,7 +767,7 @@ void GitClient::diffProject(const QString &workingDirectory, const QString &proj
workingDirectory, tr("Git Diff Project"),
[this, workingDirectory, projectDirectory]
(IDocument *doc) -> DiffEditorController* {
return new ProjectDiffController(doc, workingDirectory, { projectDirectory });
return new ProjectDiffController(doc, workingDirectory, {projectDirectory});
});
}
@@ -819,7 +819,7 @@ void GitClient::merge(const QString &workingDirectory,
void GitClient::status(const QString &workingDirectory)
{
VcsOutputWindow::setRepository(workingDirectory);
VcsCommand *command = vcsExec(workingDirectory, { "status", "-u" }, nullptr, true);
VcsCommand *command = vcsExec(workingDirectory, {"status", "-u"}, nullptr, true);
connect(command, &VcsCommand::finished, VcsOutputWindow::instance(), &VcsOutputWindow::clearRepository,
Qt::QueuedConnection);
}
@@ -853,7 +853,7 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName,
editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu);
editor->setWorkingDirectory(workingDir);
QStringList arguments = { "log", noColorOption, decorateOption };
QStringList arguments = {"log", noColorOption, decorateOption};
int logCount = settings().intValue(GitSettings::logCountKey);
if (logCount > 0)
arguments << "-n" << QString::number(logCount);
@@ -874,7 +874,7 @@ void GitClient::reflog(const QString &workingDirectory)
"reflogRepository", workingDirectory);
editor->setWorkingDirectory(workingDirectory);
QStringList arguments = { "reflog", noColorOption, decorateOption };
QStringList arguments = {"reflog", noColorOption, decorateOption};
int logCount = settings().intValue(GitSettings::logCountKey);
if (logCount > 0)
arguments << "-n" << QString::number(logCount);
@@ -921,7 +921,7 @@ VcsBaseEditorWidget *GitClient::annotate(
int lineNumber, const QStringList &extraOptions)
{
const Id editorId = Git::Constants::GIT_BLAME_EDITOR_ID;
const QString id = VcsBaseEditor::getTitleId(workingDir, { file }, revision);
const QString id = VcsBaseEditor::getTitleId(workingDir, {file}, revision);
const QString title = tr("Git Blame \"%1\"").arg(id);
const QString sourceFile = VcsBaseEditor::getSource(workingDir, file);
@@ -942,7 +942,7 @@ VcsBaseEditorWidget *GitClient::annotate(
}
editor->setWorkingDirectory(workingDir);
QStringList arguments = { "blame", "--root" };
QStringList arguments = {"blame", "--root"};
arguments << effectiveArgs << "--" << file;
if (!revision.isEmpty())
arguments << revision;
@@ -971,7 +971,7 @@ bool GitClient::synchronousCheckout(const QString &workingDirectory,
QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory,
const QString &ref)
{
QStringList arguments = { "checkout", ref };
QStringList arguments = {"checkout", ref};
QStringList localBranches = synchronousRepositoryBranches(workingDirectory);
if (localBranches.contains(ref))
@@ -996,7 +996,7 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory,
return arguments;
QString output;
const QStringList forEachRefArgs = { "refs/remotes/", "--format=%(objectname) %(refname:short)" };
const QStringList forEachRefArgs = {"refs/remotes/", "--format=%(objectname) %(refname:short)"};
if (!synchronousForEachRefCmd(workingDirectory, forEachRefArgs, &output))
return arguments;
@@ -1033,7 +1033,7 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory,
void GitClient::reset(const QString &workingDirectory, const QString &argument, const QString &commit)
{
QStringList arguments = { "reset", argument };
QStringList arguments = {"reset", argument};
if (!commit.isEmpty())
arguments << commit;
@@ -1055,13 +1055,13 @@ void GitClient::reset(const QString &workingDirectory, const QString &argument,
void GitClient::addFile(const QString &workingDirectory, const QString &fileName)
{
vcsExec(workingDirectory, { "add", fileName });
vcsExec(workingDirectory, {"add", fileName});
}
bool GitClient::synchronousLog(const QString &workingDirectory, const QStringList &arguments,
QString *output, QString *errorMessageIn, unsigned flags)
{
QStringList allArguments = { "log", noColorOption };
QStringList allArguments = {"log", noColorOption};
allArguments.append(arguments);
@@ -1080,7 +1080,7 @@ bool GitClient::synchronousLog(const QString &workingDirectory, const QStringLis
bool GitClient::synchronousAdd(const QString &workingDirectory, const QStringList &files)
{
return vcsFullySynchronousExec(workingDirectory, QStringList({ "add" }) + files).result
return vcsFullySynchronousExec(workingDirectory, QStringList({"add"}) + files).result
== SynchronousProcessResponse::Finished;
}
@@ -1088,7 +1088,7 @@ bool GitClient::synchronousDelete(const QString &workingDirectory,
bool force,
const QStringList &files)
{
QStringList arguments = { "rm" };
QStringList arguments = {"rm"};
if (force)
arguments << "--force";
arguments.append(files);
@@ -1100,7 +1100,7 @@ bool GitClient::synchronousMove(const QString &workingDirectory,
const QString &from,
const QString &to)
{
return vcsFullySynchronousExec(workingDirectory, { "mv", from, to }).result
return vcsFullySynchronousExec(workingDirectory, {"mv", from, to}).result
== SynchronousProcessResponse::Finished;
}
@@ -1108,7 +1108,7 @@ bool GitClient::synchronousReset(const QString &workingDirectory,
const QStringList &files,
QString *errorMessage)
{
QStringList arguments = { "reset" };
QStringList arguments = {"reset"};
if (files.isEmpty())
arguments << "--hard";
else
@@ -1137,7 +1137,7 @@ bool GitClient::synchronousReset(const QString &workingDirectory,
// Initialize repository
bool GitClient::synchronousInit(const QString &workingDirectory)
{
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, { "init" });
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, {"init"});
// '[Re]Initialized...'
VcsOutputWindow::append(resp.stdOut());
if (resp.result == SynchronousProcessResponse::Finished) {
@@ -1160,7 +1160,7 @@ bool GitClient::synchronousCheckoutFiles(const QString &workingDirectory, QStrin
revision = HEAD;
if (files.isEmpty())
files = QStringList(".");
QStringList arguments = { "checkout" };
QStringList arguments = {"checkout"};
if (revertStaging)
arguments << revision;
arguments << "--" << files;
@@ -1224,7 +1224,7 @@ static inline bool splitCommitParents(const QString &line,
bool GitClient::synchronousRevListCmd(const QString &workingDirectory, const QStringList &extraArguments,
QString *output, QString *errorMessage) const
{
const QStringList arguments = QStringList({ "rev-list", noColorOption }) + extraArguments;
const QStringList arguments = QStringList({"rev-list", noColorOption}) + extraArguments;
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
workingDirectory, arguments, silentFlags);
if (resp.result != SynchronousProcessResponse::Finished) {
@@ -1248,7 +1248,7 @@ bool GitClient::synchronousParentRevisions(const QString &workingDirectory,
}
QString outputText;
QString errorText;
if (!synchronousRevListCmd(workingDirectory, { "--parents", "--max-count=1", revision },
if (!synchronousRevListCmd(workingDirectory, {"--parents", "--max-count=1", revision},
&outputText, &errorText)) {
*errorMessage = msgParentRevisionFailed(workingDirectory, revision, errorText);
return false;
@@ -1285,7 +1285,7 @@ QString GitClient::synchronousCurrentLocalBranch(const QString &workingDirectory
{
QString branch;
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
workingDirectory, { "symbolic-ref", HEAD }, silentFlags);
workingDirectory, {"symbolic-ref", HEAD}, silentFlags);
if (resp.result == SynchronousProcessResponse::Finished) {
branch = resp.stdOut().trimmed();
} else {
@@ -1308,7 +1308,7 @@ QString GitClient::synchronousCurrentLocalBranch(const QString &workingDirectory
bool GitClient::synchronousHeadRefs(const QString &workingDirectory, QStringList *output,
QString *errorMessage) const
{
const QStringList arguments = { "show-ref", "--head", "--abbrev=10", "--dereference" };
const QStringList arguments = {"show-ref", "--head", "--abbrev=10", "--dereference"};
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
workingDirectory, arguments, silentFlags);
if (resp.result != SynchronousProcessResponse::Finished) {
@@ -1359,7 +1359,7 @@ QString GitClient::synchronousTopic(const QString &workingDirectory) const
// No tag or remote branch - try git describe
const SynchronousProcessResponse resp =
vcsFullySynchronousExec(workingDirectory, { "describe" }, VcsCommand::NoOutput);
vcsFullySynchronousExec(workingDirectory, {"describe"}, VcsCommand::NoOutput);
if (resp.result == SynchronousProcessResponse::Finished) {
const QString stdOut = resp.stdOut().trimmed();
if (!stdOut.isEmpty())
@@ -1371,7 +1371,7 @@ QString GitClient::synchronousTopic(const QString &workingDirectory) const
bool GitClient::synchronousRevParseCmd(const QString &workingDirectory, const QString &ref,
QString *output, QString *errorMessage) const
{
const QStringList arguments = { "rev-parse", ref };
const QStringList arguments = {"rev-parse", ref};
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
workingDirectory, arguments, silentFlags);
*output = resp.stdOut().trimmed();
@@ -1397,7 +1397,7 @@ void GitClient::synchronousTagsForCommit(const QString &workingDirectory, const
QString &precedes, QString &follows) const
{
const SynchronousProcessResponse resp1 = vcsFullySynchronousExec(
workingDirectory, { "describe", "--contains", revision }, silentFlags);
workingDirectory, {"describe", "--contains", revision}, silentFlags);
precedes = resp1.stdOut();
int tilde = precedes.indexOf('~');
if (tilde != -1)
@@ -1410,7 +1410,7 @@ void GitClient::synchronousTagsForCommit(const QString &workingDirectory, const
synchronousParentRevisions(workingDirectory, revision, &parents, &errorMessage);
for (const QString &p : Utils::asConst(parents)) {
const SynchronousProcessResponse resp2 = vcsFullySynchronousExec(
workingDirectory, { "describe", "--tags", "--abbrev=0", p }, silentFlags);
workingDirectory, {"describe", "--tags", "--abbrev=0", p}, silentFlags);
QString pf = resp2.stdOut();
pf.truncate(pf.lastIndexOf('\n'));
if (!pf.isEmpty()) {
@@ -1426,7 +1426,7 @@ void GitClient::branchesForCommit(const QString &revision)
auto controller = qobject_cast<DiffEditorController *>(sender());
QString workingDirectory = controller->baseDirectory();
VcsCommand *command = vcsExec(
workingDirectory, { "branch", noColorOption, "-a", "--contains", revision}, nullptr,
workingDirectory, {"branch", noColorOption, "-a", "--contains", revision}, nullptr,
false, 0, workingDirectory);
connect(command, &VcsCommand::stdOutText, controller,
&DiffEditorController::informationForCommitReceived);
@@ -1435,13 +1435,13 @@ void GitClient::branchesForCommit(const QString &revision)
bool GitClient::isRemoteCommit(const QString &workingDirectory, const QString &commit)
{
return !vcsFullySynchronousExec(
workingDirectory, { "branch", "-r", "--contains", commit }, silentFlags).rawStdOut.isEmpty();
workingDirectory, {"branch", "-r", "--contains", commit}, silentFlags).rawStdOut.isEmpty();
}
bool GitClient::isFastForwardMerge(const QString &workingDirectory, const QString &branch)
{
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
workingDirectory, { "merge-base", HEAD, branch }, silentFlags);
workingDirectory, {"merge-base", HEAD, branch}, silentFlags);
return resp.stdOut().trimmed() == synchronousTopRevision(workingDirectory);
}
@@ -1449,8 +1449,8 @@ bool GitClient::isFastForwardMerge(const QString &workingDirectory, const QStrin
QString GitClient::synchronousShortDescription(const QString &workingDirectory, const QString &revision,
const QString &format) const
{
const QStringList arguments = { "log", noColorOption, ("--pretty=format:" + format),
"--max-count=1", revision };
const QStringList arguments = {"log", noColorOption, ("--pretty=format:" + format),
"--max-count=1", revision};
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
workingDirectory, arguments, silentFlags);
if (resp.result != SynchronousProcessResponse::Finished) {
@@ -1524,7 +1524,7 @@ bool GitClient::executeSynchronousStash(const QString &workingDirectory,
bool unstagedOnly,
QString *errorMessage) const
{
QStringList arguments = { "stash", "save" };
QStringList arguments = {"stash", "save"};
if (unstagedOnly)
arguments << "--keep-index";
if (!message.isEmpty())
@@ -1638,7 +1638,7 @@ QMap<QString,QString> GitClient::synchronousRemotesList(const QString &workingDi
QString output;
QString error;
if (!synchronousRemoteCmd(workingDirectory, { "-v" }, &output, &error, true)) {
if (!synchronousRemoteCmd(workingDirectory, {"-v"}, &output, &error, true)) {
msgCannotRun(error, errorMessage);
return result;
}
@@ -1662,7 +1662,7 @@ QStringList GitClient::synchronousSubmoduleStatus(const QString &workingDirector
{
// get submodule status
const SynchronousProcessResponse resp =
vcsFullySynchronousExec(workingDirectory, { "submodule", "status" }, silentFlags);
vcsFullySynchronousExec(workingDirectory, {"submodule", "status"}, silentFlags);
if (resp.result != SynchronousProcessResponse::Finished) {
msgCannotRun(tr("Cannot retrieve submodule status of \"%1\": %2")
@@ -1741,7 +1741,7 @@ bool GitClient::synchronousShow(const QString &workingDirectory, const QString &
*errorMessage = msgCannotShow(id);
return false;
}
const QStringList arguments = { "show", decorateOption, noColorOption, id };
const QStringList arguments = {"show", decorateOption, noColorOption, id};
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, arguments);
if (resp.result != SynchronousProcessResponse::Finished) {
msgCannotRun(arguments, workingDirectory, resp.stdErr(), errorMessage);
@@ -1756,7 +1756,7 @@ bool GitClient::cleanList(const QString &workingDirectory, const QString &module
const QString &flag, QStringList *files, QString *errorMessage)
{
const QString directory = workingDirectory + '/' + modulePath;
const QStringList arguments = { "clean", "--dry-run", flag };
const QStringList arguments = {"clean", "--dry-run", flag};
const SynchronousProcessResponse resp = vcsFullySynchronousExec(directory, arguments);
if (resp.result != SynchronousProcessResponse::Finished) {
@@ -1801,7 +1801,7 @@ bool GitClient::synchronousApplyPatch(const QString &workingDirectory,
const QString &file, QString *errorMessage,
const QStringList &extraArguments)
{
QStringList arguments = { "apply", "--whitespace=fix" };
QStringList arguments = {"apply", "--whitespace=fix"};
arguments << extraArguments << file;
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, arguments);
@@ -1913,7 +1913,7 @@ void GitClient::updateSubmodulesIfNeeded(const QString &workingDirectory, bool p
}
}
VcsCommand *cmd = vcsExec(workingDirectory, { "submodule", "update" }, nullptr, true,
VcsCommand *cmd = vcsExec(workingDirectory, {"submodule", "update"}, nullptr, true,
VcsCommand::ExpectRepoChanges);
connect(cmd, &VcsCommand::finished, this, &GitClient::finishSubmoduleUpdate);
}
@@ -1929,7 +1929,7 @@ GitClient::StatusResult GitClient::gitStatus(const QString &workingDirectory, St
QString *output, QString *errorMessage) const
{
// Run 'status'. Note that git returns exitcode 1 if there are no added files.
QStringList arguments = { "status" };
QStringList arguments = {"status"};
if (mode & NoUntracked)
arguments << "--untracked-files=no";
else
@@ -2107,7 +2107,7 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
| VcsCommand::SuppressStdErr
| VcsCommand::SuppressFailMessage;
const SynchronousProcessResponse resp = vcsSynchronousExec(
workingDirectory, { "ls-remote", repositoryURL, HEAD, "refs/heads/*" }, flags);
workingDirectory, {"ls-remote", repositoryURL, HEAD, "refs/heads/*"}, flags);
QStringList branches;
branches << tr("<Detached HEAD>");
QString headSha;
@@ -2177,7 +2177,7 @@ void GitClient::launchRepositoryBrowser(const QString &workingDirectory)
{
const QString repBrowserBinary = settings().stringValue(GitSettings::repositoryBrowserCmd);
if (!repBrowserBinary.isEmpty())
QProcess::startDetached(repBrowserBinary, { workingDirectory }, workingDirectory);
QProcess::startDetached(repBrowserBinary, {workingDirectory}, workingDirectory);
}
bool GitClient::tryLauchingGitK(const QProcessEnvironment &env,
@@ -2228,7 +2228,7 @@ bool GitClient::launchGitGui(const QString &workingDirectory) {
if (gitBinary.isEmpty()) {
success = false;
} else {
success = QProcess::startDetached(gitBinary.toString(), { "gui" },
success = QProcess::startDetached(gitBinary.toString(), {"gui"},
workingDirectory);
}
@@ -2289,7 +2289,7 @@ bool GitClient::readDataFromCommit(const QString &repoDirectory, const QString &
QString *commitTemplate)
{
// Get commit data as "SHA1<lf>author<lf>email<lf>message".
const QStringList arguments = { "log", "--max-count=1", "--pretty=format:%h\n%an\n%ae\n%B", commit };
const QStringList arguments = {"log", "--max-count=1", "--pretty=format:%h\n%an\n%ae\n%B", commit};
const SynchronousProcessResponse resp = vcsFullySynchronousExec(repoDirectory, arguments, silentFlags);
if (resp.result != SynchronousProcessResponse::Finished) {
@@ -2337,7 +2337,7 @@ bool GitClient::getCommitData(const QString &workingDirectory,
// Run status. Note that it has exitcode 1 if there are no added files.
QString output;
if (commitData.commitType == FixupCommit) {
synchronousLog(repoDirectory, { HEAD, "--not", "--remotes", "-n1" }, &output, errorMessage);
synchronousLog(repoDirectory, {HEAD, "--not", "--remotes", "-n1"}, &output, errorMessage);
if (output.isEmpty()) {
*errorMessage = msgNoCommits(false);
return false;
@@ -2529,7 +2529,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
return false;
// Do the final commit
QStringList arguments = { "commit" };
QStringList arguments = {"commit"};
if (commitType == FixupCommit) {
arguments << "--fixup" << amendSHA1;
} else {
@@ -2668,7 +2668,7 @@ void GitClient::revert(const QStringList &files, bool revertStaging)
void GitClient::fetch(const QString &workingDirectory, const QString &remote)
{
QStringList const arguments = { "fetch", (remote.isEmpty() ? "--all" : remote) };
QStringList const arguments = {"fetch", (remote.isEmpty() ? "--all" : remote)};
VcsCommand *command = vcsExec(workingDirectory, arguments, nullptr, true,
VcsCommand::ShowSuccessMessage);
connect(command, &VcsCommand::success,
@@ -2693,7 +2693,7 @@ bool GitClient::executeAndHandleConflicts(const QString &workingDirectory,
bool GitClient::synchronousPull(const QString &workingDirectory, bool rebase)
{
QString abortCommand;
QStringList arguments = { "pull" };
QStringList arguments = {"pull"};
if (rebase) {
arguments << "--rebase";
abortCommand = "rebase";
@@ -2720,7 +2720,7 @@ void GitClient::synchronousAbortCommand(const QString &workingDir, const QString
}
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
workingDir, { abortCommand, "--abort" },
workingDir, {abortCommand, "--abort"},
VcsCommand::ExpectRepoChanges | VcsCommand::ShowSuccessMessage);
VcsOutputWindow::append(resp.stdOut());
}
@@ -2746,7 +2746,7 @@ bool GitClient::synchronousSetTrackingBranch(const QString &workingDirectory,
const QString &branch, const QString &tracking)
{
return vcsFullySynchronousExec(
workingDirectory, { "branch", "--set-upstream-to=" + tracking, branch }).result
workingDirectory, {"branch", "--set-upstream-to=" + tracking, branch}).result
== SynchronousProcessResponse::Finished;
}
@@ -2787,7 +2787,7 @@ void GitClient::handleMergeConflicts(const QString &workingDir, const QString &c
if (mergeOrAbort.clickedButton() == mergeToolButton)
merge(workingDir);
else if (!abortCommand.isEmpty())
executeAndHandleConflicts(workingDir, { abortCommand, "--skip" }, abortCommand);
executeAndHandleConflicts(workingDir, {abortCommand, "--skip"}, abortCommand);
}
}
@@ -2803,12 +2803,12 @@ void GitClient::synchronousSubversionFetch(const QString &workingDirectory)
const unsigned flags = VcsCommand::SshPasswordPrompt
| VcsCommand::ShowStdOut
| VcsCommand::ShowSuccessMessage;
vcsSynchronousExec(workingDirectory, { "svn", "fetch" }, flags);
vcsSynchronousExec(workingDirectory, {"svn", "fetch"}, flags);
}
void GitClient::subversionLog(const QString &workingDirectory)
{
QStringList arguments = { "svn", "log" };
QStringList arguments = {"svn", "log"};
int logCount = settings().intValue(GitSettings::logCountKey);
if (logCount > 0)
arguments << ("--limit=" + QString::number(logCount));
@@ -2825,14 +2825,14 @@ void GitClient::subversionLog(const QString &workingDirectory)
void GitClient::push(const QString &workingDirectory, const QStringList &pushArgs)
{
vcsExec(workingDirectory, QStringList({ "push" }) + pushArgs, nullptr, true);
vcsExec(workingDirectory, QStringList({"push"}) + pushArgs, nullptr, true);
}
bool GitClient::synchronousMerge(const QString &workingDirectory, const QString &branch,
bool allowFastForward)
{
QString command = "merge";
QStringList arguments = { command };
QStringList arguments = {command};
if (!allowFastForward)
arguments << "--no-ff";
arguments << branch;
@@ -2854,18 +2854,18 @@ bool GitClient::canRebase(const QString &workingDirectory) const
void GitClient::rebase(const QString &workingDirectory, const QString &argument)
{
VcsCommand *command = vcsExecAbortable(workingDirectory, { "rebase", argument });
VcsCommand *command = vcsExecAbortable(workingDirectory, {"rebase", argument});
GitProgressParser::attachToCommand(command);
}
void GitClient::cherryPick(const QString &workingDirectory, const QString &argument)
{
vcsExecAbortable(workingDirectory, { "cherry-pick", argument });
vcsExecAbortable(workingDirectory, {"cherry-pick", argument});
}
void GitClient::revert(const QString &workingDirectory, const QString &argument)
{
vcsExecAbortable(workingDirectory, { "revert", argument });
vcsExecAbortable(workingDirectory, {"revert", argument});
}
// Executes a command asynchronously. Work tree is expected to be clean.
@@ -2893,7 +2893,7 @@ bool GitClient::synchronousRevert(const QString &workingDirectory, const QString
// Do not stash if --continue or --abort is given as the commit
if (!commit.startsWith('-') && !beginStashScope(workingDirectory, command))
return false;
return executeAndHandleConflicts(workingDirectory, { command, "--no-edit", commit }, command);
return executeAndHandleConflicts(workingDirectory, {command, "--no-edit", commit}, command);
}
bool GitClient::synchronousCherryPick(const QString &workingDirectory, const QString &commit)
@@ -2904,7 +2904,7 @@ bool GitClient::synchronousCherryPick(const QString &workingDirectory, const QSt
if (isRealCommit && !beginStashScope(workingDirectory, command))
return false;
QStringList arguments = { command };
QStringList arguments = {command};
if (isRealCommit && isRemoteCommit(workingDirectory, commit))
arguments << "-x";
arguments << commit;
@@ -2914,7 +2914,7 @@ bool GitClient::synchronousCherryPick(const QString &workingDirectory, const QSt
void GitClient::interactiveRebase(const QString &workingDirectory, const QString &commit, bool fixup)
{
QStringList arguments = { "rebase", "-i" };
QStringList arguments = {"rebase", "-i"};
if (fixup)
arguments << "--autosquash";
arguments << commit + '^';
@@ -2938,7 +2938,7 @@ QString GitClient::msgNoCommits(bool includeRemote)
void GitClient::stashPop(const QString &workingDirectory, const QString &stash)
{
QStringList arguments = { "stash", "pop" };
QStringList arguments = {"stash", "pop"};
if (!stash.isEmpty())
arguments << stash;
VcsCommand *cmd = vcsExec(workingDirectory, arguments, nullptr, true, VcsCommand::ExpectRepoChanges);
@@ -2950,7 +2950,7 @@ bool GitClient::synchronousStashRestore(const QString &workingDirectory,
bool pop,
const QString &branch /* = QString()*/) const
{
QStringList arguments = { "stash" };
QStringList arguments = {"stash"};
if (branch.isEmpty())
arguments << QLatin1String(pop ? "pop" : "apply") << stash;
else
@@ -2961,7 +2961,7 @@ bool GitClient::synchronousStashRestore(const QString &workingDirectory,
bool GitClient::synchronousStashRemove(const QString &workingDirectory, const QString &stash,
QString *errorMessage) const
{
QStringList arguments = { "stash" };
QStringList arguments = {"stash"};
if (stash.isEmpty())
arguments << "clear";
else
@@ -2984,7 +2984,7 @@ bool GitClient::synchronousStashList(const QString &workingDirectory, QList<Stas
{
stashes->clear();
const QStringList arguments = { "stash", "list", noColorOption };
const QStringList arguments = {"stash", "list", noColorOption};
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, arguments);
if (resp.result != SynchronousProcessResponse::Finished) {
msgCannotRun(arguments, workingDirectory, resp.stdErr(), errorMessage);
@@ -3002,18 +3002,18 @@ bool GitClient::synchronousStashList(const QString &workingDirectory, QList<Stas
// Read a single-line config value, return trimmed
QString GitClient::readConfigValue(const QString &workingDirectory, const QString &configVar) const
{
return readOneLine(workingDirectory, { "config", configVar });
return readOneLine(workingDirectory, {"config", configVar});
}
void GitClient::setConfigValue(const QString &workingDirectory, const QString &configVar,
const QString &value) const
{
readOneLine(workingDirectory, { "config", configVar, value });
readOneLine(workingDirectory, {"config", configVar, value});
}
QString GitClient::readGitVar(const QString &workingDirectory, const QString &configVar) const
{
return readOneLine(workingDirectory, { "var", configVar });
return readOneLine(workingDirectory, {"var", configVar});
}
QString GitClient::readOneLine(const QString &workingDirectory, const QStringList &arguments) const
@@ -3052,7 +3052,7 @@ unsigned GitClient::synchronousGitVersion(QString *errorMessage) const
// run git --version
const SynchronousProcessResponse resp = vcsSynchronousExec(
QString(), { "--version" }, silentFlags);
QString(), {"--version"}, silentFlags);
if (resp.result != SynchronousProcessResponse::Finished) {
msgCannotRun(tr("Cannot determine Git version: %1").arg(resp.stdErr()), errorMessage);
return 0;
+2 -2
View File
@@ -213,7 +213,7 @@ void GitEditorWidget::revertChange()
void GitEditorWidget::logChange()
{
GitPlugin::client()->log(
sourceWorkingDirectory(), QString(), false, { m_currentChange });
sourceWorkingDirectory(), QString(), false, {m_currentChange});
}
void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
@@ -227,7 +227,7 @@ void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
patchFile.write(chunk.chunk);
patchFile.close();
QStringList args = { "--cached" };
QStringList args = {"--cached"};
if (revert)
args << "--reverse";
QString errorMessage;
+2 -2
View File
@@ -743,7 +743,7 @@ void GitPlugin::undoFileChanges(bool revertStaging)
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return);
FileChangeBlocker fcb(state.currentFile());
m_gitClient->revert({ state.currentFile() }, revertStaging);
m_gitClient->revert({state.currentFile()}, revertStaging);
}
class ResetItemDelegate : public LogItemDelegate
@@ -858,7 +858,7 @@ void GitPlugin::unstageFile()
{
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return);
m_gitClient->synchronousReset(state.currentFileTopLevel(), { state.relativeCurrentFile() });
m_gitClient->synchronousReset(state.currentFileTopLevel(), {state.relativeCurrentFile()});
}
void GitPlugin::gitkForCurrentFile()
+3 -3
View File
@@ -113,13 +113,13 @@ bool GitVersionControl::vcsOpen(const QString & /*fileName*/)
bool GitVersionControl::vcsAdd(const QString & fileName)
{
const QFileInfo fi(fileName);
return m_client->synchronousAdd(fi.absolutePath(), { fi.fileName() });
return m_client->synchronousAdd(fi.absolutePath(), {fi.fileName()});
}
bool GitVersionControl::vcsDelete(const QString & fileName)
{
const QFileInfo fi(fileName);
return m_client->synchronousDelete(fi.absolutePath(), true, { fi.fileName() });
return m_client->synchronousDelete(fi.absolutePath(), true, {fi.fileName()});
}
bool GitVersionControl::vcsMove(const QString &from, const QString &to)
@@ -148,7 +148,7 @@ Core::ShellCommand *GitVersionControl::createInitialCheckoutCommand(const QStrin
const QString &localName,
const QStringList &extraArgs)
{
QStringList args = { "clone", "--progress" };
QStringList args = {"clone", "--progress"};
args << extraArgs << url << localName;
auto command = new VcsBase::VcsCommand(baseDirectory.toString(), m_client->processEnvironment());

Some files were not shown because too many files have changed in this diff Show More