Commit 56409f5a authored by hjk's avatar hjk

Replace a few occurrences of QStringList() << ...

... by something shorter.

Change-Id: I363b4e509adb07997517b2d233246a333aea4aea
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 95e2d7f5
......@@ -873,7 +873,7 @@
\code
auto something = new MyCustomType;
auto keyEvent = static_cast<QKeyEvent *>(event);
auto myList = QStringList() << QLatin1String("FooThing") << QLatin1String("BarThing");
auto myList = QStringList({ "FooThing", "BarThing" });
\endcode
\li When assigning iterator types.
......
......@@ -106,7 +106,7 @@ enum { debugLeaks = 0 };
loading.
\code
// 'plugins' and subdirs will be searched for plugins
PluginManager::setPluginPaths(QStringList() << "plugins");
PluginManager::setPluginPaths(QStringList("plugins"));
PluginManager::loadPlugins(); // try to load all the plugins
\endcode
Additionally, it is possible to directly access the plugin specifications
......
......@@ -82,7 +82,7 @@ void ConfigController::readStereotypeDefinitions(const QString &path)
fileNames.append(fileInfo.fileName());
} else if (fileInfo.isDir()) {
dir.setPath(path);
dir.setNameFilters(QStringList() << QStringLiteral("*.def"));
dir.setNameFilters(QStringList("*.def"));
fileNames = dir.entryList(QDir::Files);
} else {
// TODO add error handling
......
......@@ -147,9 +147,9 @@ void StereotypeDisplayVisitor::visitDItem(const DItem *item)
m_stereotypeSmartDisplay = DObject::StereotypeIcon;
visitDObject(item);
if (m_stereotypeIconId.isEmpty() && !item->shape().isEmpty())
m_shapeIconId = m_stereotypeController->findStereotypeIconId(StereotypeIcon::ElementItem, QStringList() << item->shape());
m_shapeIconId = m_stereotypeController->findStereotypeIconId(StereotypeIcon::ElementItem, QStringList(item->shape()));
if (m_shapeIconId.isEmpty() && !item->variety().isEmpty())
m_shapeIconId = m_stereotypeController->findStereotypeIconId(StereotypeIcon::ElementItem, QStringList() << item->variety());
m_shapeIconId = m_stereotypeController->findStereotypeIconId(StereotypeIcon::ElementItem, QStringList(item->variety()));
}
} // namespace qmt
......@@ -461,7 +461,7 @@ Qt::DropActions TreeModel::supportedDropActions() const
QStringList TreeModel::mimeTypes() const
{
return QStringList() << QStringLiteral("text/model-elements");
return QStringList(QString("text/model-elements"));
}
void TreeModel::onBeginResetModel()
......
......@@ -698,7 +698,7 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association)
m_endANavigable->setEnabled(isSingleSelection);
if (m_endAKind == 0) {
m_endAKind = new QComboBox(m_topWidget);
m_endAKind->addItems(QStringList() << tr("Association") << tr("Aggregation") << tr("Composition"));
m_endAKind->addItems({ tr("Association"), tr("Aggregation"), tr("Composition") });
addRow(tr("Relationship:"), m_endAKind, "relationship a");
connect(m_endAKind, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &PropertiesView::MView::onAssociationEndAKindChanged);
......@@ -763,7 +763,7 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association)
m_endBNavigable->setEnabled(isSingleSelection);
if (m_endBKind == 0) {
m_endBKind = new QComboBox(m_topWidget);
m_endBKind->addItems(QStringList() << tr("Association") << tr("Aggregation") << tr("Composition"));
m_endBKind->addItems({ tr("Association"), tr("Aggregation"), tr("Composition") });
addRow(tr("Relationship:"), m_endBKind, "relationship b");
connect(m_endBKind, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &PropertiesView::MView::onAssociationEndBKindChanged);
......@@ -862,9 +862,8 @@ void PropertiesView::MView::visitDObject(const DObject *object)
}
if (m_visualSecondaryRoleSelector == 0) {
m_visualSecondaryRoleSelector = new QComboBox(m_topWidget);
m_visualSecondaryRoleSelector->addItems(QStringList() << tr("Normal")
<< tr("Lighter") << tr("Darker")
<< tr("Soften") << tr("Outline"));
m_visualSecondaryRoleSelector->addItems({ tr("Normal"), tr("Lighter"), tr("Darker"),
tr("Soften"), tr("Outline") });
addRow(tr("Role:"), m_visualSecondaryRoleSelector, "role");
connect(m_visualSecondaryRoleSelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &PropertiesView::MView::onVisualSecondaryRoleChanged);
......@@ -891,8 +890,8 @@ void PropertiesView::MView::visitDObject(const DObject *object)
}
if (m_stereotypeDisplaySelector == 0) {
m_stereotypeDisplaySelector = new QComboBox(m_topWidget);
m_stereotypeDisplaySelector->addItems(QStringList() << tr("Smart") << tr("None") << tr("Label")
<< tr("Decoration") << tr("Icon"));
m_stereotypeDisplaySelector->addItems({ tr("Smart"), tr("None"), tr("Label"),
tr("Decoration"), tr("Icon") });
addRow(tr("Stereotype display:"), m_stereotypeDisplaySelector, "stereotype display");
connect(m_stereotypeDisplaySelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &PropertiesView::MView::onStereotypeDisplayChanged);
......@@ -929,7 +928,7 @@ void PropertiesView::MView::visitDClass(const DClass *klass)
visitDObject(klass);
if (m_templateDisplaySelector == 0) {
m_templateDisplaySelector = new QComboBox(m_topWidget);
m_templateDisplaySelector->addItems(QStringList() << tr("Smart") << tr("Box") << tr("Angle Brackets"));
m_templateDisplaySelector->addItems({ tr("Smart"), tr("Box"), tr("Angle Brackets") });
addRow(tr("Template display:"), m_templateDisplaySelector, "template display");
connect(m_templateDisplaySelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &PropertiesView::MView::onTemplateDisplayChanged);
......@@ -1378,7 +1377,8 @@ void PropertiesView::MView::setTitle(const MItem *item, const QList<V *> &elemen
if (filtered.size() == elements.size()) {
if (elements.size() == 1) {
if (item && !item->isVarietyEditable()) {
QString stereotypeIconId = m_propertiesView->stereotypeController()->findStereotypeIconId(StereotypeIcon::ElementItem, QStringList() << item->variety());
QString stereotypeIconId = m_propertiesView->stereotypeController()
->findStereotypeIconId(StereotypeIcon::ElementItem, QStringList(item->variety()));
if (!stereotypeIconId.isEmpty()) {
StereotypeIcon stereotypeIcon = m_propertiesView->stereotypeController()->findStereotypeIcon(stereotypeIconId);
m_propertiesTitle = stereotypeIcon.title();
......
......@@ -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(QStringList() << 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(QStringList() << 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(QStringList() << stereotype);
klass->setStereotypes({ stereotype });
newObject = klass;
} else if (newElementId == QLatin1String(ELEMENT_TYPE_ITEM)) {
auto item = new MItem();
......
......@@ -245,7 +245,7 @@ void ModelManagerInterface::addTaskInternal(QFuture<void> result, const QString
void ModelManagerInterface::loadQmlTypeDescriptionsInternal(const QString &resourcePath)
{
const QDir typeFileDir(resourcePath + QLatin1String("/qml-type-descriptions"));
const QStringList qmlTypesExtensions = QStringList() << QLatin1String("*.qmltypes");
const QStringList qmlTypesExtensions = QStringList("*.qmltypes");
QFileInfoList qmlTypesFiles = typeFileDir.entryInfoList(
qmlTypesExtensions,
QDir::Files,
......@@ -352,7 +352,7 @@ QFuture<void> ModelManagerInterface::refreshSourceFiles(const QStringList &sourc
void ModelManagerInterface::fileChangedOnDisk(const QString &path)
{
Utils::runAsync(&ModelManagerInterface::parse,
workingCopyInternal(), QStringList() << path,
workingCopyInternal(), QStringList(path),
this, Dialect(Dialect::AnyLanguage), true);
}
......
......@@ -89,7 +89,7 @@ DropSupport::DropSupport(QWidget *parentWidget, const DropFilterFunction &filter
QStringList DropSupport::mimeTypesForFilePaths()
{
return QStringList() << QStringLiteral("text/uri-list");
return QStringList("text/uri-list");
}
bool DropSupport::isFileDrop(QDropEvent *event) const
......
......@@ -118,7 +118,7 @@ MimeType MimeDatabasePrivate::mimeTypeForName(const QString &nameOrAlias)
QStringList MimeDatabasePrivate::mimeTypeForFileName(const QString &fileName, QString *foundSuffix)
{
if (fileName.endsWith(QLatin1Char('/')))
return QStringList() << QLatin1String("inode/directory");
return QStringList("inode/directory");
const QStringList matchingMimeTypes = provider()->findByFileName(QFileInfo(fileName).fileName(), foundSuffix);
return matchingMimeTypes;
......
......@@ -154,7 +154,7 @@ namespace {
SynchronousProcess proc;
proc.setProcessChannelMode(QProcess::MergedChannels);
proc.setTimeoutS(30);
SynchronousProcessResponse response = proc.runBlocking(executable, QStringList() << shell);
SynchronousProcessResponse response = proc.runBlocking(executable, QStringList(shell));
if (response.result != SynchronousProcessResponse::Finished)
return true;
return !response.allOutput().contains("x86-64");
......@@ -327,7 +327,7 @@ void AndroidConfig::updateNdkInformation() const
return;
m_availableNdkPlatforms.clear();
FileName path = ndkLocation();
QDirIterator it(path.appendPath(QLatin1String("platforms")).toString(), QStringList() << QLatin1String("android-*"), QDir::Dirs);
QDirIterator it(path.appendPath("platforms").toString(), QStringList("android-*"), QDir::Dirs);
while (it.hasNext()) {
const QString &fileName = it.next();
m_availableNdkPlatforms.push_back(fileName.midRef(fileName.lastIndexOf(QLatin1Char('-')) + 1).toInt());
......@@ -378,7 +378,7 @@ void AndroidConfig::updateAvailableSdkPlatforms() const
proc.setProcessEnvironment(androidToolEnvironment().toProcessEnvironment());
SynchronousProcessResponse response
= proc.runBlocking(androidToolPath().toString(),
QStringList() << QLatin1String("list") << QLatin1String("target")); // list avaialbe AVDs
QStringList({ "list", "target" })); // list available AVDs
if (response.result != SynchronousProcessResponse::Finished)
return;
......@@ -539,8 +539,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(const QString &adbToo
QVector<AndroidDeviceInfo> devices;
SynchronousProcess adbProc;
adbProc.setTimeoutS(30);
SynchronousProcessResponse response
= adbProc.runBlocking(adbToolPath, QStringList() << QLatin1String("devices"));
SynchronousProcessResponse response = adbProc.runBlocking(adbToolPath, QStringList("devices"));
if (response.result != SynchronousProcessResponse::Finished) {
if (error)
*error = QApplication::translate("AndroidConfiguration",
......@@ -669,9 +668,7 @@ bool AndroidConfig::removeAVD(const QString &name) const
proc.setTimeoutS(5);
proc.setProcessEnvironment(androidToolEnvironment().toProcessEnvironment());
SynchronousProcessResponse response
= proc.runBlocking(androidToolPath().toString(),
QStringList() << QLatin1String("delete") << QLatin1String("avd")
<< QLatin1String("-n") << name);
= proc.runBlocking(androidToolPath().toString(), QStringList({ "delete", "avd", "-n", name }));
return response.result == SynchronousProcessResponse::Finished && response.exitCode == 0;
}
......@@ -687,9 +684,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::androidVirtualDevices(const QString &a
SynchronousProcess proc;
proc.setTimeoutS(20);
proc.setProcessEnvironment(environment.toProcessEnvironment());
SynchronousProcessResponse response
= proc.run(androidTool,
QStringList() << QLatin1String("list") << QLatin1String("avd")); // list available AVDs
SynchronousProcessResponse response = proc.run(androidTool, { "list", "avd" }); // list available AVDs
if (response.result != SynchronousProcessResponse::Finished)
return devices;
......@@ -739,16 +734,16 @@ QVector<AndroidDeviceInfo> AndroidConfig::androidVirtualDevices(const QString &a
int lastIndex = line.lastIndexOf(QLatin1Char('/')) + 1;
if (lastIndex >= line.size())
break;
dev.cpuAbi = QStringList() << line.mid(lastIndex);
dev.cpuAbi = QStringList(line.mid(lastIndex));
} else if (line.contains(QLatin1String("ABI:"))) {
int lastIndex = line.lastIndexOf(QLatin1Char(' ')) + 1;
if (lastIndex >= line.size())
break;
dev.cpuAbi = QStringList() << line.mid(lastIndex).trimmed();
dev.cpuAbi = QStringList(line.mid(lastIndex).trimmed());
}
}
// armeabi-v7a devices can also run armeabi code
if (dev.cpuAbi == QStringList(QLatin1String("armeabi-v7a")))
if (dev.cpuAbi == QStringList("armeabi-v7a"))
dev.cpuAbi << QLatin1String("armeabi");
dev.state = AndroidDeviceInfo::OkState;
dev.type = AndroidDeviceInfo::Emulator;
......@@ -1354,8 +1349,8 @@ bool AndroidConfigurations::force32bitEmulator()
QStringList AndroidDeviceInfo::adbSelector(const QString &serialNumber)
{
if (serialNumber.startsWith(QLatin1String("????")))
return QStringList() << QLatin1String("-d");
return QStringList() << QLatin1String("-s") << serialNumber;
return QStringList("-d");
return QStringList({ "-s", serialNumber });
}
const AndroidConfig &AndroidConfigurations::currentConfig()
......
......@@ -69,7 +69,7 @@ static QStringList qtSoPaths(QtSupport::BaseQtVersion *qtVersion)
QString path = qtVersion->qmakeProperty(qMakeVariables[i]);
if (path.isNull())
continue;
QDirIterator it(path, QStringList() << QLatin1String("*.so"), QDir::Files, QDirIterator::Subdirectories);
QDirIterator it(path, QStringList("*.so"), QDir::Files, QDirIterator::Subdirectories);
while (it.hasNext()) {
it.next();
paths.insert(it.fileInfo().absolutePath());
......
......@@ -408,15 +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;
arguments << QLatin1String("-certreq")
<< QLatin1String("-keystore")
<< keystorePath
<< QLatin1String("--storepass")
<< keystorePasswd
<< QLatin1String("-alias")
<< alias
<< QLatin1String("-keypass");
QStringList arguments = { "-certreq", "-keystore", keystorePath,
"--storepass", keystorePasswd, "-alias", alias, "-keypass" };
if (certificatePasswd.isEmpty())
arguments << keystorePasswd;
else
......@@ -433,14 +426,8 @@ bool AndroidManager::checkCertificateExists(const QString &keystorePath,
const QString &keystorePasswd, const QString &alias)
{
// assumes that the keystore password is correct
QStringList arguments;
arguments << QLatin1String("-list")
<< QLatin1String("-keystore")
<< keystorePath
<< QLatin1String("--storepass")
<< keystorePasswd
<< QLatin1String("-alias")
<< alias;
QStringList arguments = { "-list", "-keystore", keystorePath,
"--storepass", keystorePasswd, "-alias", alias };
Utils::SynchronousProcess proc;
proc.setTimeoutS(10);
......
......@@ -1056,8 +1056,8 @@ bool AndroidManifestEditorWidget::parseMetaData(QXmlStreamReader &reader, QXmlSt
QXmlStreamAttributes result;
if (attributes.value(QLatin1String("android:name")) == QLatin1String("android.app.lib_name")) {
QStringList keys = QStringList() << QLatin1String("android:value");
QStringList values = QStringList() << m_targetLineEdit->currentText();
QStringList keys = QStringList("android:value");
QStringList values = QStringList(m_targetLineEdit->currentText());
result = modifyXmlStreamAttributes(attributes, keys, values);
found = true;
} else {
......
......@@ -678,7 +678,7 @@ void AndroidSettingsWidget::manageAVD()
avdProcess->setProcessEnvironment(m_androidConfig.androidToolEnvironment().toProcessEnvironment());
QString executable = m_androidConfig.androidToolPath().toString();
QStringList arguments = QStringList() << QLatin1String("avd");
QStringList arguments = QStringList("avd");
avdProcess->start(executable, arguments);
}
......
......@@ -297,7 +297,7 @@ QList<AndroidToolChainFactory::AndroidToolChainInformation> AndroidToolChainFact
QRegExp versionRegExp(NDKGccVersionRegExp);
FileName path = ndkPath;
QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(),
QStringList() << QLatin1String("*"), QDir::Dirs);
QStringList("*"), QDir::Dirs);
while (it.hasNext()) {
const QString &fileName = FileName::fromString(it.next()).fileName();
int idx = versionRegExp.indexIn(fileName);
......@@ -387,7 +387,7 @@ AndroidToolChainFactory::autodetectToolChainsForNdk(const FileName &ndkPath,
QRegExp versionRegExp(NDKGccVersionRegExp);
FileName path = ndkPath;
QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(),
QStringList() << QLatin1String("*"), QDir::Dirs);
QStringList("*"), QDir::Dirs);
QHash<Abi, QList<AndroidToolChain *>> newestToolChainForArch;
while (it.hasNext()) {
......@@ -437,7 +437,7 @@ QList<int> AndroidToolChainFactory::newestToolChainVersionForArch(const Abi &abi
m_ndkLocation = AndroidConfigurations::currentConfig().ndkLocation();
FileName path = m_ndkLocation;
QDirIterator it(path.appendPath(QLatin1String("toolchains")).toString(),
QStringList() << QLatin1String("*"), QDir::Dirs);
QStringList("*"), QDir::Dirs);
while (it.hasNext()) {
const QString &fileName = FileName::fromString(it.next()).fileName();
int idx = versionRegExp.indexIn(fileName);
......
......@@ -80,7 +80,7 @@ static int updateVersionHelper(const QString &command)
{
Utils::SynchronousProcess process;
Utils::SynchronousProcessResponse response
= process.runBlocking(command, QStringList() << QLatin1String("--version"));
= process.runBlocking(command, QStringList("--version"));
if (response.result != Utils::SynchronousProcessResponse::Finished)
return 0;
......@@ -157,7 +157,7 @@ void ArtisticStyleSettings::createDocumentationFile() const
Utils::SynchronousProcess process;
process.setTimeoutS(2);
Utils::SynchronousProcessResponse response
= process.runBlocking(command(), QStringList() << QLatin1String("-h"));
= process.runBlocking(command(), QStringList("-h"));
if (response.result != Utils::SynchronousProcessResponse::Finished)
return;
......
......@@ -129,7 +129,7 @@ void UncrustifySettings::createDocumentationFile() const
Utils::SynchronousProcess process;
process.setTimeoutS(2);
Utils::SynchronousProcessResponse response
= process.runBlocking(command(), QStringList() << QLatin1String("--show-config"));
= process.runBlocking(command(), QStringList("--show-config"));
if (response.result != Utils::SynchronousProcessResponse::Finished)
return;
......
......@@ -68,7 +68,7 @@ private:
ClangStaticAnalyzerDiagnosticModel::ClangStaticAnalyzerDiagnosticModel(QObject *parent)
: Utils::TreeModel<>(parent)
{
setHeader(QStringList() << tr("Issue") << tr("Location"));
setHeader({ tr("Issue"), tr("Location") });
}
void ClangStaticAnalyzerDiagnosticModel::addDiagnostics(const QList<Diagnostic> &diagnostics)
......
......@@ -1600,7 +1600,7 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
VersionSelector selector(file, response.stdErr);
if (selector.exec() == QDialog::Accepted) {
if (selector.isUpdate())
ccUpdate(workingDir, QStringList() << file);
ccUpdate(workingDir, QStringList(file));
else
args.removeOne(QLatin1String("-query"));
response = runCleartool(topLevel, args, m_settings.timeOutS,
......@@ -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() << QLatin1String("mkelem") << QLatin1String("-ci"), fileName);
QStringList({ "mkelem", "-ci" }), fileName);
}
bool ClearCasePlugin::vcsDelete(const QString &workingDir, const QString &fileName)
......@@ -1806,14 +1806,14 @@ bool ClearCasePlugin::vcsDelete(const QString &workingDir, const QString &fileNa
return true;
return ccFileOp(workingDir, tr("ClearCase Remove File %1").arg(baseName(fileName)),
QStringList() << QLatin1String("rmname") << QLatin1String("-force"), fileName);
QStringList({ "rmname", "-force" }), fileName);
}
bool ClearCasePlugin::vcsMove(const QString &workingDir, const QString &from, const QString &to)
{
return ccFileOp(workingDir, tr("ClearCase Rename File %1 -> %2")
.arg(baseName(from)).arg(baseName(to)),
QStringList() << QLatin1String("move"), from, to);
QStringList("move"), from, to);
}
bool ClearCasePlugin::vcsCheckout(const QString & /*directory*/, const QByteArray & /*url*/)
......
......@@ -151,7 +151,7 @@ void CommandMappings::setPageTitle(const QString &s)
void CommandMappings::setTargetHeader(const QString &s)
{
d->commandList->setHeaderLabels(QStringList() << tr("Command") << tr("Label") << s);
d->commandList->setHeaderLabels({ tr("Command"), tr("Label"), s});
}
void CommandMappings::filterChanged(const QString &f)
......
......@@ -171,7 +171,7 @@ bool ExternalToolModel::dropMimeData(const QMimeData *data,
QStringList ExternalToolModel::mimeTypes() const
{
return QStringList() << QLatin1String("application/qtcreator-externaltool-config");
return QStringList("application/qtcreator-externaltool-config");
}
QModelIndex ExternalToolModel::index(int row, int column, const QModelIndex &parent) const
......
......@@ -499,7 +499,7 @@ void ShortcutSettingsWidget::initialize()
const QString section = identifier.left(pos);
const QString subId = identifier.mid(pos + 1);
if (!sections.contains(section)) {
QTreeWidgetItem *categoryItem = new QTreeWidgetItem(commandList(), QStringList() << section);
QTreeWidgetItem *categoryItem = new QTreeWidgetItem(commandList(), QStringList(section));
QFont f = categoryItem->font(0);
f.setBold(true);
categoryItem->setFont(0, f);
......
......@@ -2176,7 +2176,7 @@ void EditorManagerPrivate::revertToSaved(IDocument *document)
return;
if (diffService && msgBox.clickedButton() == diffButton) {
diffService->diffModifiedFiles(QStringList() << fileName);
diffService->diffModifiedFiles(QStringList(fileName));
return;
}
}
......
......@@ -40,7 +40,7 @@ SystemEditor::SystemEditor(QObject *parent) :
QStringList SystemEditor::mimeTypes() const
{
return QStringList() << QLatin1String("application/octet-stream");
return QStringList("application/octet-stream");
}
Id SystemEditor::id() const
......
......@@ -190,7 +190,7 @@ static void addThemesFromPath(const QString &path, QList<ThemeEntry> *themes)
{
static const QLatin1String extension("*.creatortheme");
QDir themeDir(path);
themeDir.setNameFilters(QStringList() << extension);
themeDir.setNameFilters({ extension });
themeDir.setFilter(QDir::Files);
const QStringList themeList = themeDir.entryList();
foreach (const QString &fileName, themeList) {
......
......@@ -596,9 +596,9 @@ void CorePlugin::testVcsManager_data()
<< QLatin1String("a/1/b/../../2:a:A:*") // in A
);
QTest::newRow("A and B") // first one wins...
<< (QStringList() << QLatin1String("a:a") << QLatin1String("a/1:a") << QLatin1String("a/2:a"))
<< (QStringList() << QLatin1String("a:a") << QLatin1String("a/1:a") << QLatin1String("a/2:a"))
<< (QStringList() << QLatin1String("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()
......
......@@ -91,9 +91,9 @@ int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
const QStringList protocols = QStringList() << 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();
......
......@@ -3644,7 +3644,7 @@ void CppEditorPlugin::test_quickfix_AddIncludeForUndefinedIdentifier_noDoubleQtH
ProjectPartHeaderPath::IncludePath);
AddIncludeForUndefinedIdentifier factory;
const QStringList expectedOperations = QStringList() << QLatin1String("Add #include <QDir>");
const QStringList expectedOperations = QStringList("Add #include <QDir>");
QuickFixOfferedOperationsTest(testDocuments, &factory, headerPaths, expectedOperations);
}
......
......@@ -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 = QStringList() << testCpp;
const QStringList projectFiles2 = QStringList() << testCpp << testCpp2;
const QStringList projectFiles1 = { testCpp };
const QStringList projectFiles2 = { testCpp, testCpp2 };
// Add a file
QTest::newRow("case: add project file") << fileToChange << projectFiles1 << projectFiles2;
......@@ -568,9 +568,7 @@ void CppToolsPlugin::test_modelmanager_snapshot_after_two_projects()
// Project 1
project1.create(_("test_modelmanager_snapshot_after_two_projects.1"),
_("testdata_project1"),
QStringList() << _("foo.h")
<< _("foo.cpp")
<< _("main.cpp"));
{ "foo.h", "foo.cpp", "main.cpp" });
refreshedFiles = helper.updateProjectInfo(project1.projectInfo);
QCOMPARE(refreshedFiles, project1.projectFiles.toSet());
......@@ -582,9 +580,7 @@ void CppToolsPlugin::test_modelmanager_snapshot_after_two_projects()
// Project 2
project2.create(_("test_modelmanager_snapshot_after_two_projects.2"),
_("testdata_project2"),
QStringList() << _("bar.h")
<< _("bar.cpp")
<< _("main.cpp"));
{ "bar.h", "bar.cpp", "main.cpp" });
refreshedFiles = helper.updateProjectInfo(project2.projectInfo);
QCOMPARE(refreshedFiles, project2.projectFiles.toSet());
......@@ -1029,7 +1025,7 @@ void CppToolsPlugin::test_modelmanager_renameIncludes()
QVERIFY(tmpDir.isValid());
const QDir workingDir(tmpDir.path());
const QStringList fileNames = QStringList() << _("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();
......@@ -1075,7 +1071,7 @@ void CppToolsPlugin::test_modelmanager_renameIncludesInEditor()
QVERIFY(tmpDir.isValid());
const QDir workingDir(tmpDir.path());
const QStringList fileNames = QStringList() << _("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")));
......
......@@ -168,7 +168,7 @@ void CppSourceProcessor::addFrameworkPath(const ProjectPartHeaderPath &framework
m_headerPaths.append(cleanFrameworkPath);
const QDir frameworkDir(cleanFrameworkPath.path);
const QStringList filter = QStringList() << QLatin1String("*.framework");
const QStringList filter = QStringList("*.framework");