Commit 2475da1b authored by Christian Stenger's avatar Christian Stenger

Replace some more occurrences of QStringList() << pattern

Change-Id: Ic7193ac3a741763479a9ef129ed05cb7ca64f1e9
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 38b6f4ff
......@@ -167,11 +167,10 @@ void AutoTestUnitTests::testCodeParserSwitchStartup_data()
QTest::addColumn<QList<int> >("expectedUnnamedQuickTestsCount");
QTest::addColumn<QList<int> >("expectedDataTagsCount");
QStringList projects = QStringList()
<< QString(m_tmpDir->path() + QLatin1String("/plain/plain.pro"))
<< QString(m_tmpDir->path() + QLatin1String("/mixed_atp/mixed_atp.pro"))
<< QString(m_tmpDir->path() + QLatin1String("/plain/plain.qbs"))
<< QString(m_tmpDir->path() + QLatin1String("/mixed_atp/mixed_atp.qbs"));
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" });
QList<int> expectedAutoTests = QList<int>() << 1 << 4 << 1 << 4;
QList<int> expectedNamedQuickTests = QList<int>() << 0 << 5 << 0 << 5;
......
This diff is collapsed.
......@@ -42,34 +42,14 @@ namespace CppTools {
CppCompletionAssistProcessor::CppCompletionAssistProcessor(int snippetItemOrder)
: m_positionForProposal(-1)
, m_preprocessorCompletions(QStringList()
<< QLatin1String("define")
<< QLatin1String("error")
<< QLatin1String("include")
<< QLatin1String("line")
<< QLatin1String("pragma")
<< QLatin1String("pragma once")
<< QLatin1String("pragma omp atomic")
<< QLatin1String("pragma omp parallel")
<< QLatin1String("pragma omp for")
<< QLatin1String("pragma omp ordered")
<< QLatin1String("pragma omp parallel for")
<< QLatin1String("pragma omp section")
<< QLatin1String("pragma omp sections")
<< QLatin1String("pragma omp parallel sections")
<< QLatin1String("pragma omp single")
<< QLatin1String("pragma omp master")
<< QLatin1String("pragma omp critical")
<< QLatin1String("pragma omp barrier")
<< QLatin1String("pragma omp flush")
<< QLatin1String("pragma omp threadprivate")
<< QLatin1String("undef")
<< QLatin1String("if")
<< QLatin1String("ifdef")
<< QLatin1String("ifndef")
<< QLatin1String("elif")
<< QLatin1String("else")
<< QLatin1String("endif"))
, 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" }))
, m_hintProposal(0)
, m_snippetCollector(QLatin1String(CppEditor::Constants::CPP_SNIPPETS_GROUP_ID),
QIcon(QLatin1String(":/texteditor/images/snippet.png")),
......
......@@ -87,15 +87,12 @@ void CppFileSettings::toSettings(QSettings *s) const
void CppFileSettings::fromSettings(QSettings *s)
{
const QStringList defaultHeaderSearchPaths = QStringList()
<< QLatin1String("include")
<< QLatin1String("Include")
<< QDir::toNativeSeparators(QLatin1String("../include"))
<< QDir::toNativeSeparators(QLatin1String("../Include"));
const QStringList defaultSourceSearchPaths = QStringList()
<< QDir::toNativeSeparators(QLatin1String("../src"))
<< QDir::toNativeSeparators(QLatin1String("../Src"))
<< QLatin1String("..");
const QStringList defaultHeaderSearchPaths
= QStringList({ "include", "Include", QDir::toNativeSeparators("../include"),
QDir::toNativeSeparators("../Include") });
const QStringList defaultSourceSearchPaths
= 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();
......
......@@ -48,10 +48,10 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget(ProjectExplorer::IRunConfigurat
globalSettingLayout->setContentsMargins(0, 0, 0, 0);
m_settingsCombo = new QComboBox(globalSetting);
m_settingsCombo->addItems(QStringList()
<< QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Global")
<< QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Custom")
);
m_settingsCombo->addItems(QStringList({
QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Global"),
QApplication::translate("ProjectExplorer::Internal::EditorSettingsPropertiesPage", "Custom")
}));
globalSettingLayout->addWidget(m_settingsCombo);
connect(m_settingsCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &AnalyzerRunConfigWidget::chooseSettings);
......
......@@ -902,9 +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)
......
......@@ -214,9 +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()
<< QLatin1String("ui_form.h: No such file or directory")
<< QLatin1String("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()))
......@@ -247,10 +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.
......@@ -261,24 +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,19 +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()
<< QLatin1String("bool")
<< QLatin1String("int")
<< QLatin1String("uint")
<< QLatin1String("float")
<< QLatin1String("double")
<< QLatin1String("long")
<< QLatin1String("short")
<< QLatin1String("char")
<< QLatin1String("signed")
<< QLatin1String("unsigned")
<< QLatin1String("qint64")
<< QLatin1String("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);
......
......@@ -387,14 +387,11 @@ QStringList IosDsymBuildStep::defaultCleanCmdList() const
{
IosRunConfiguration *runConf =
qobject_cast<IosRunConfiguration *>(target()->activeRunConfiguration());
QTC_ASSERT(runConf, return QStringList(QLatin1String("echo")));
QTC_ASSERT(runConf, return QStringList("echo"));
QString dsymPath = runConf->bundleDirectory().toUserOutput();
dsymPath.chop(4);
dsymPath.append(QLatin1String(".dSYM"));
return QStringList()
<< QLatin1String("rm")
<< QLatin1String("-rf")
<< dsymPath;
return QStringList({ "rm", "-rf", dsymPath });
}
QStringList IosDsymBuildStep::defaultCmdList() const
......@@ -410,11 +407,7 @@ QStringList IosDsymBuildStep::defaultCmdList() const
QString dsymPath = runConf->bundleDirectory().toUserOutput();
dsymPath.chop(4);
dsymPath.append(QLatin1String(".dSYM"));
return QStringList()
<< dsymutilCmd
<< QLatin1String("-o")
<< dsymPath
<< runConf->localExecutable().toUserOutput();
return QStringList({ dsymutilCmd, "-o", dsymPath, runConf->localExecutable().toUserOutput() });
}
......
......@@ -418,7 +418,7 @@ static FileNameList gatherQmakePathsFromQtChooser()
if (qtchooser.isEmpty())
return FileNameList();
QList<QByteArray> versions = runQtChooser(qtchooser, QStringList() << QStringLiteral("-l"));
QList<QByteArray> versions = runQtChooser(qtchooser, QStringList("-l"));
QSet<FileName> foundQMakes;
foreach (const QByteArray &version, versions) {
FileName possibleQMake = FileName::fromString(
......@@ -475,12 +475,12 @@ static void updateDocumentation()
{
QStringList files;
foreach (BaseQtVersion *v, m_versions) {
const QStringList docPaths = QStringList() << v->documentationPath() + QLatin1Char('/')
<< v->documentationPath() + QLatin1String("/qch/");
const QStringList docPaths = QStringList({ v->documentationPath() + QChar('/'),
v->documentationPath() + "/qch/" });
foreach (const QString &docPath, docPaths) {
const QDir versionHelpDir(docPath);
foreach (const QString &helpFile,
versionHelpDir.entryList(QStringList() << QLatin1String("*.qch"), QDir::Files))
versionHelpDir.entryList(QStringList("*.qch"), QDir::Files))
files << docPath + helpFile;
}
}
......
......@@ -362,8 +362,7 @@ private:
static void createImageFromDot(const QString &inputFile, const QString &outputFile, bool verbose)
{
const QString command = CplusplusToolsUtils::portableExecutableName(QLatin1String("dot"));
const QStringList arguments = QStringList()
<< QLatin1String("-Tpng") << QLatin1String("-o") << outputFile << inputFile;
const QStringList arguments = QStringList({ "-Tpng", "-o", outputFile, inputFile });
CplusplusToolsUtils::executeCommand(command, arguments, QString(), verbose);
}
......
......@@ -65,12 +65,11 @@ BacktraceCollector::~BacktraceCollector()
void BacktraceCollector::run(Q_PID pid)
{
d->debugger.start(QLatin1String("gdb"), QStringList()
<< QLatin1String("--nw") // Do not use a window interface.
<< QLatin1String("--nx") // Do not read .gdbinit file.
<< QLatin1String("--batch") // Exit after processing options.
<< QLatin1String("--command") << createTemporaryCommandFile()
<< QLatin1String("--pid") << QString::number(pid)
d->debugger.start(QLatin1String("gdb"), QStringList({
"--nw", // Do not use a window interface.
"--nx", // Do not read .gdbinit file.
"--batch", // Exit after processing options.
"--command", createTemporaryCommandFile(), "--pid", QString::number(pid) })
);
}
......
......@@ -302,11 +302,7 @@ void CrashHandler::debugApplication()
QString executable = d->creatorInPath.toString();
if (executable.isEmpty() && !d->restartAppCommandLine.isEmpty())
executable = d->restartAppCommandLine.at(0);
const QStringList commandLine = QStringList()
<< executable
<< QLatin1String("-debug")
<< QString::number(d->pid);
const QStringList commandLine = QStringList({ executable, "-debug", QString::number(d->pid) });
QStringList environment;
if (!d->restartAppEnvironment.isEmpty())
environment = d->restartAppEnvironment;
......
......@@ -162,18 +162,10 @@ void tst_QrcParser::simpleTest()
QrcParser::Ptr p = QrcParser::parseQrcFile(QString::fromLatin1(TESTSRCDIR).append(QLatin1String("/simple.qrc")), QString());
QStringList paths = allPaths(p);
paths.sort();
QVERIFY(paths == QStringList()
<< QLatin1String("/")
<< QLatin1String("/cut.jpg")
<< QLatin1String("/images/")
<< QLatin1String("/images/copy.png")
<< QLatin1String("/images/cut.png")
<< QLatin1String("/images/new.png")
<< QLatin1String("/images/open.png")
<< QLatin1String("/images/paste.png")
<< QLatin1String("/images/save.png")
<< QLatin1String("/myresources/")
<< QLatin1String("/myresources/cut-img.png"));
QVERIFY(paths == QStringList({ "/", "/cut.jpg", "/images/", "/images/copy.png",
"/images/cut.png", "/images/new.png", "/images/open.png",
"/images/paste.png", "/images/save.png", "/myresources/",
"/myresources/cut-img.png" }));
QString frPath = p->firstFileAtPath(QLatin1String("/cut.jpg"), QLocale(QLatin1String("fr_FR")));
QString refFrPath = QString::fromLatin1(TESTSRCDIR).append(QLatin1String("/cut_fr.jpg"));
QCOMPARE(frPath, refFrPath);
......
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