Commit e952b9d4 authored by Christian Stenger's avatar Christian Stenger

Replace occurrences of QStringList() << pattern

Change-Id: I598d8c06193c2e72435a76165d1afc9ee3465b48
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 7f8e60b2
......@@ -614,8 +614,7 @@ void PropertiesView::MView::visitMDependency(const MDependency *dependency)
bool isSingleSelection = selection.size() == 1;
if (m_directionSelector == 0) {
m_directionSelector = new QComboBox(m_topWidget);
m_directionSelector->addItems(QStringList()
<< QStringLiteral("->") << QStringLiteral("<-") << QStringLiteral("<->"));
m_directionSelector->addItems(QStringList({ "->", "<-", "<->" }));
addRow(tr("Direction:"), m_directionSelector, "direction");
connect(m_directionSelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &PropertiesView::MView::onDependencyDirectionChanged);
......@@ -1051,9 +1050,9 @@ void PropertiesView::MView::visitDAnnotation(const DAnnotation *annotation)
}
if (m_annotationVisualRoleSelector == 0) {
m_annotationVisualRoleSelector = new QComboBox(m_topWidget);
m_annotationVisualRoleSelector->addItems(QStringList()
<< tr("Normal") << tr("Title") << tr("Subtitle")
<< tr("Emphasized") << tr("Soften") << tr("Footnote"));
m_annotationVisualRoleSelector->addItems(QStringList({ tr("Normal"), tr("Title"),
tr("Subtitle"), tr("Emphasized"),
tr("Soften"), tr("Footnote") }));
addRow(tr("Role:"), m_annotationVisualRoleSelector, "visual role");
connect(m_annotationVisualRoleSelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &PropertiesView::MView::onAnnotationVisualRoleChanged);
......
......@@ -100,9 +100,8 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
return false;
}
pcmd = QLatin1String("/bin/sh");
pargs = QtcProcess::Arguments::createUnixArgs(QStringList()
<< QLatin1String("-c")
<< (QtcProcess::quoteArg(program) + QLatin1Char(' ') + args));
pargs = QtcProcess::Arguments::createUnixArgs(
QStringList({ "-c", (QtcProcess::quoteArg(program) + ' ' + args) }));
}
QtcProcess::SplitError qerr;
......
......@@ -659,9 +659,8 @@ bool QtcProcess::prepareCommand(const QString &command, const QString &arguments
if (err != QtcProcess::FoundMeta)
return false;
*outCmd = QLatin1String("/bin/sh");
*outArgs = Arguments::createUnixArgs(QStringList()
<< QLatin1String("-c")
<< (quoteArg(command) + QLatin1Char(' ') + arguments));
*outArgs = Arguments::createUnixArgs(
QStringList({ "-c", (quoteArg(command) + ' ' + arguments) }));
}
}
return true;
......
......@@ -68,13 +68,9 @@ void Android::Internal::AndroidSignalOperation::adbFindRunAsFinished(int exitCod
this, &AndroidSignalOperation::adbKillFinished);
m_state = Kill;
m_timeout->start();
m_adbProcess->start(m_adbPath, QStringList()
<< QLatin1String("shell")
<< QLatin1String("run-as")
<< runAs
<< QLatin1String("kill")
<< QString::fromLatin1("-%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) }));
}
}
......@@ -122,10 +118,8 @@ void Android::Internal::AndroidSignalOperation::signalOperationViaADB(qint64 pid
this, &AndroidSignalOperation::adbFindRunAsFinished);
m_state = RunAs;
m_timeout->start();
m_adbProcess->start(m_adbPath, QStringList()
<< QLatin1String("shell")
<< QLatin1String("cat")
<< QString::fromLatin1("/proc/%1/cmdline").arg(m_pid));
m_adbProcess->start(m_adbPath, QStringList({ "shell", "cat",
QString("/proc/%1/cmdline").arg(m_pid) }));
}
void Android::Internal::AndroidSignalOperation::killProcess(qint64 pid)
......
......@@ -45,11 +45,7 @@ AvdDialog::AvdDialog(int minApiLevel, const QString &targetArch, const AndroidCo
m_hideTipTimer.setSingleShot(true);
if (targetArch.isEmpty())
m_avdDialog.abiComboBox->addItems(QStringList()
<< QLatin1String("armeabi-v7a")
<< QLatin1String("armeabi")
<< QLatin1String("x86")
<< QLatin1String("mips"));
m_avdDialog.abiComboBox->addItems(QStringList({ "armeabi-v7a", "armeabi", "x86", "mips" }));
else
m_avdDialog.abiComboBox->addItems(QStringList(targetArch));
......
......@@ -116,8 +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
......
......@@ -94,10 +94,9 @@ void Core::Internal::CorePlugin::test_basefilefilter_data()
const QChar pathSeparator = QDir::separator();
const MyTestDataDir testDir(QLatin1String("testdata_basic"));
const QStringList testFiles = QStringList()
<< QDir::fromNativeSeparators(testDir.file(QLatin1String("file.cpp")))
<< QDir::fromNativeSeparators(testDir.file(QLatin1String("main.cpp")))
<< QDir::fromNativeSeparators(testDir.file(QLatin1String("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));
......
......@@ -550,51 +550,42 @@ void CorePlugin::testVcsManager_data()
QTest::addColumn<QStringList>("results");
QTest::newRow("A and B next to each other")
<< (QStringList()
<< QLatin1String("a:a") << QLatin1String("a/1:a") << QLatin1String("a/2:a")
<< QLatin1String("a/2/5:a") << QLatin1String("a/2/5/6:a"))
<< (QStringList()
<< QLatin1String("b:b") << QLatin1String("b/3:b") << QLatin1String("b/4:b"))
<< (QStringList()
<< QLatin1String(":::-") // empty directory to look up
<< QLatin1String("c:::*") // Neither in A nor B
<< QLatin1String("a:a:A:*") // in A
<< QLatin1String("b:b:B:*") // in B
<< QLatin1String("b/3:b:B:*") // in B
<< QLatin1String("b/4:b:B:*") // in B
<< QLatin1String("a/1:a:A:*") // in A
<< QLatin1String("a/2:a:A:*") // in A
<< QLatin1String(":::-") // empty directory to look up
<< QLatin1String("a/2/5/6:a:A:*") // in A
<< QLatin1String("a/2/5:a:A:-") // in A (cached from before!)
// repeat: These need to come from the cache now:
<< QLatin1String("c:::-") // Neither in A nor B
<< QLatin1String("a:a:A:-") // in A
<< QLatin1String("b:b:B:-") // in B
<< QLatin1String("b/3:b:B:-") // in B
<< QLatin1String("b/4:b:B:-") // in B
<< QLatin1String("a/1:a:A:-") // in A
<< QLatin1String("a/2:a:A:-") // in A
<< QLatin1String("a/2/5/6:a:A:-") // in A
<< QLatin1String("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()
<< QLatin1String("a:a") << QLatin1String("a/1:a") << QLatin1String("a/2:a")
<< QLatin1String("a/2/5:a") << QLatin1String("a/2/5/6:a"))
<< (QStringList()
<< QLatin1String("a/1/b:a/1/b") << QLatin1String("a/1/b/3:a/1/b")
<< QLatin1String("a/1/b/4:a/1/b") << QLatin1String("a/1/b/3/5:a/1/b")
<< QLatin1String("a/1/b/3/5/6:a/1/b"))
<< (QStringList()
<< QLatin1String("a:a:A:*") // in A
<< QLatin1String("c:::*") // Neither in A nor B
<< QLatin1String("a/3:::*") // Neither in A nor B
<< QLatin1String("a/1/b/x:::*") // Neither in A nor B
<< QLatin1String("a/1/b:a/1/b:B:*") // in B
<< QLatin1String("a/1:a:A:*") // in A
<< QLatin1String("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" })
......
......@@ -193,8 +193,7 @@ QString AbstractMsvcToolChain::makeCommand(const Utils::Environment &environment
Utils::FileName tmp;
if (useJom) {
tmp = environment.searchInPath(jom, QStringList()
<< QCoreApplication::applicationDirPath());
tmp = environment.searchInPath(jom, QStringList(QCoreApplication::applicationDirPath()));
if (!tmp.isEmpty())
return tmp.toString();
}
......
......@@ -258,24 +258,23 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data()
// make sure adding directories works (once;-)
QTest::newRow("entering directory")
<< (QStringList() << QString::fromLatin1("/test/dir") )
<< QStringList("/test/dir")
<< QString::fromLatin1("make[4]: Entering directory `/home/code/build/qt/examples/opengl/grabber'\n"
"make[4]: Entering directory `/home/code/build/qt/examples/opengl/grabber'")
<< OutputParserTester::STDOUT
<< QString() << QString()
<< QList<Task>()
<< QString()
<< (QStringList() << QString::fromLatin1("/home/code/build/qt/examples/opengl/grabber")
<< QString::fromLatin1("/home/code/build/qt/examples/opengl/grabber")
<< QString::fromLatin1("/test/dir"));
<< QStringList({ "/home/code/build/qt/examples/opengl/grabber",
"/home/code/build/qt/examples/opengl/grabber", "/test/dir" });
QTest::newRow("leaving directory")
<< (QStringList() << QString::fromLatin1("/home/code/build/qt/examples/opengl/grabber") << QString::fromLatin1("/test/dir"))
<< QStringList({ "/home/code/build/qt/examples/opengl/grabber", "/test/dir" })
<< QString::fromLatin1("make[4]: Leaving directory `/home/code/build/qt/examples/opengl/grabber'")
<< OutputParserTester::STDOUT
<< QString() << QString()
<< QList<Task>()
<< QString()
<< (QStringList() << QString::fromLatin1("/test/dir"));
<< QStringList("/test/dir");
QTest::newRow("make error")
<< QStringList()
<< QString::fromLatin1("make: *** No rule to make target `hello.c', needed by `hello.o'. Stop.")
......@@ -476,8 +475,8 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data()
-1,
Constants::TASK_CATEGORY_COMPILE);
QTest::newRow("find file")
<< (QStringList(QLatin1String("test/file.cpp")))
<< (QStringList(QLatin1String("test")))
<< QStringList("test/file.cpp")
<< QStringList("test")
<< Task(Task::Error,
QLatin1String("mangling"),
Utils::FileName::fromUserInput(QLatin1String("file.cpp")),
......
......@@ -278,35 +278,33 @@ QString QbsBuildConfiguration::equivalentCommandLine(const BuildStep *buildStep)
buildStep->project()->activeTarget()->activeBuildConfiguration());
if (buildConfig) {
const QString buildDir = buildConfig->buildDirectory().toUserOutput();
Utils::QtcProcess::addArgs(&commandLine, QStringList() << QLatin1String("-d") << buildDir);
Utils::QtcProcess::addArgs(&commandLine, QStringList({ "-d", buildDir }));
}
Utils::QtcProcess::addArgs(&commandLine, QStringList() << QLatin1String("-f")
Utils::QtcProcess::addArgs(&commandLine, QStringList("-f")
<< buildStep->project()->projectFilePath().toUserOutput());
if (QbsProjectManagerSettings::useCreatorSettingsDirForQbs()) {
Utils::QtcProcess::addArgs(&commandLine, QStringList() << QLatin1String("--settings-dir")
<< QDir::toNativeSeparators(QbsProjectManagerSettings::qbsSettingsBaseDir()));
Utils::QtcProcess::addArgs(&commandLine, QStringList({ "--settings-dir",
QDir::toNativeSeparators(QbsProjectManagerSettings::qbsSettingsBaseDir()) }));
}
if (stepProxy.dryRun())
Utils::QtcProcess::addArg(&commandLine, QLatin1String("--dry-run"));
if (stepProxy.keepGoing())
Utils::QtcProcess::addArg(&commandLine, QLatin1String("--keep-going"));
if (stepProxy.showCommandLines())
Utils::QtcProcess::addArgs(&commandLine, QStringList()
<< QLatin1String("--command-echo-mode")
<< QLatin1String("command-line"));
Utils::QtcProcess::addArgs(&commandLine, QStringList({ "--command-echo-mode",
"command-line" }));
if (stepProxy.noInstall())
Utils::QtcProcess::addArg(&commandLine, QLatin1String("--no-install"));
if (stepProxy.cleanInstallRoot())
Utils::QtcProcess::addArg(&commandLine, QLatin1String("--clean-install-root"));
const int jobCount = stepProxy.jobCount();
if (jobCount > 0) {
Utils::QtcProcess::addArgs(&commandLine, QStringList() << QLatin1String("--jobs")
<< QString::number(jobCount));
Utils::QtcProcess::addArgs(&commandLine, QStringList({ "--jobs",
QString::number(jobCount) }));
}
const QString installRoot = stepProxy.installRoot();
if (!installRoot.isEmpty()) {
Utils::QtcProcess::addArgs(&commandLine, QStringList() << QLatin1String("--install-root")
<< installRoot);
Utils::QtcProcess::addArgs(&commandLine, QStringList({ "--install-root", installRoot }));
}
const QString profileName = QbsManager::instance()->profileForKit(buildStep->target()->kit());
......
......@@ -476,8 +476,7 @@ void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList
void QbsProjectManagerPlugin::buildSingleFile(QbsProject *project, const QString &file)
{
buildFiles(project, QStringList(file), QStringList()
<< QLatin1String("obj") << QLatin1String("hpp"));
buildFiles(project, QStringList(file), QStringList({ "obj", "hpp" }));
}
void QbsProjectManagerPlugin::buildProducts(QbsProject *project, const QStringList &products)
......
......@@ -68,11 +68,7 @@ void BackendModel::resetModel()
beginResetModel();
clear();
setHorizontalHeaderLabels(QStringList()
<< tr("Type")
<< tr("Name")
<< tr("Singleton")
<< tr("Local"));
setHorizontalHeaderLabels(QStringList({ tr("Type"), tr("Name"), tr("Singleton"), tr("Local") }));
ModelNode rootNode = connectionView()->rootModelNode();
......
......@@ -52,11 +52,8 @@ void BindingModel::resetModel()
{
beginResetModel();
clear();
setHorizontalHeaderLabels(QStringList()
<< tr("Item")
<< tr("Property")
<< tr("Source Item")
<< tr("Source Property"));
setHorizontalHeaderLabels(QStringList({ tr("Item"), tr("Property"), tr("Source Item"),
tr("Source Property") }));
foreach (const ModelNode modelNode, m_selectedModelNodes)
addModelNode(modelNode);
......
......@@ -75,10 +75,7 @@ void ConnectionModel::resetModel()
{
beginResetModel();
clear();
setHorizontalHeaderLabels(QStringList()
<< tr("Target")
<< tr("Signal Handler")
<< tr("Action"));
setHorizontalHeaderLabels(QStringList({ tr("Target"), tr("Signal Handler"), tr("Action") }));
if (connectionView()->isAttached()) {
foreach (const ModelNode modelNode, connectionView()->allModelNodes())
......
......@@ -128,11 +128,8 @@ void DynamicPropertiesModel::resetModel()
{
beginResetModel();
clear();
setHorizontalHeaderLabels(QStringList()
<< tr("Item")
<< tr("Property")
<< tr("Property Type")
<< tr("Property Value"));
setHorizontalHeaderLabels(QStringList({ tr("Item"), tr("Property"), tr("Property Type"),
tr("Property Value") }));
foreach (const ModelNode modelNode, m_selectedModelNodes)
addModelNode(modelNode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment