Use initializer list with containers and multiple initial elements

parent 074b9376
......@@ -42,8 +42,10 @@ void SessionJob::start()
{
if (operationName() == QLatin1String("open"))
{
QStringList args;
args << QStringLiteral("--open-session") << destination();
const QStringList args{
QStringLiteral("--open-session"),
destination(),
};
KToolInvocation::kdeinitExec(QStringLiteral("kdevelop"), args);
setResult(true);
......
......@@ -78,9 +78,9 @@ Variable::Variable(TreeModel* model, TreeItem* parent,
// FIXME: should not duplicate the data, instead overload 'data'
// and return expression_ directly.
if (display.isEmpty())
setData(QVector<QVariant>() << expression << QString() << QString());
setData(QVector<QVariant>{expression, QString(), QString()});
else
setData(QVector<QVariant>() << display << QString() << QString());
setData(QVector<QVariant>{display, QString(), QString()});
}
QString Variable::expression() const
......@@ -245,7 +245,7 @@ QVariant Variable::data(int column, int role) const
Watches::Watches(TreeModel* model, TreeItem* parent)
: TreeItem(model, parent), finishResult_(nullptr)
{
setData(QVector<QVariant>() << i18n("Auto") << QString());
setData(QVector<QVariant>{i18n("Auto"), QString()});
}
Variable* Watches::add(const QString& expression)
......@@ -323,7 +323,7 @@ void Watches::reinstall()
Locals::Locals(TreeModel* model, TreeItem* parent, const QString &name)
: TreeItem(model, parent)
{
setData(QVector<QVariant>() << name << QString());
setData(QVector<QVariant>{name, QString()});
}
QList<Variable*> Locals::updateLocals(QStringList locals)
......
......@@ -93,8 +93,7 @@ VariableToolTip::VariableToolTip(QWidget* parent, const QPoint& position,
{
setPalette( QApplication::palette() );
m_model = new TreeModel(QVector<QString>() << i18n("Name") << i18n("Value") << i18n("Type"),
this);
m_model = new TreeModel(QVector<QString>{i18n("Name"), i18n("Value"), i18n("Type")}, this);
TooltipRoot* tr = new TooltipRoot(m_model);
m_model->setRootItem(tr);
......
......@@ -185,7 +185,7 @@ void ApplyChangesWidgetPrivate::createEditPart(const IndexedString & file)
m_editParts[m_index]->openUrl(url);
v->addWidget(m_editParts[m_index]->widget());
v->setSizes(QList<int>() << 400 << 100);
v->setSizes(QList<int>{400, 100});
}
void ApplyChangesWidget::indexChanged(int newIndex)
......
......@@ -213,8 +213,13 @@ QString TemplateClassGenerator::identifier() const
void TemplateClassGenerator::setIdentifier(const QString& identifier)
{
d->renderer.addVariable(QStringLiteral("identifier"), identifier);;
QStringList separators;
separators << QStringLiteral("::") << QStringLiteral(".") << QStringLiteral(":") << QStringLiteral("\\") << QStringLiteral("/");
const QStringList separators{
QStringLiteral("::"),
QStringLiteral("."),
QStringLiteral(":"),
QStringLiteral("\\"),
QStringLiteral("/"),
};
QStringList ns;
foreach (const QString& separator, separators)
{
......
......@@ -240,16 +240,16 @@ void ProjectChangesModel::reloadAll()
void ProjectChangesModel::jobUnregistered(KJob* job)
{
static QList<VcsJob::JobType> readOnly = QList<VcsJob::JobType>()
<< KDevelop::VcsJob::Add
<< KDevelop::VcsJob::Remove
<< KDevelop::VcsJob::Pull
<< KDevelop::VcsJob::Commit
<< KDevelop::VcsJob::Move
<< KDevelop::VcsJob::Copy
<< KDevelop::VcsJob::Revert
;
static const QList<VcsJob::JobType> readOnly = QList<VcsJob::JobType>{
KDevelop::VcsJob::Add,
KDevelop::VcsJob::Remove,
KDevelop::VcsJob::Pull,
KDevelop::VcsJob::Commit,
KDevelop::VcsJob::Move,
KDevelop::VcsJob::Copy,
KDevelop::VcsJob::Revert,
};
VcsJob* vcsjob=dynamic_cast<VcsJob*>(job);
if(vcsjob && readOnly.contains(vcsjob->type())) {
reloadAll();
......
......@@ -1083,7 +1083,7 @@ bool DocumentController::openDocumentsWithSplitSeparators( Sublime::AreaIndex* i
Sublime::Area* area = Core::self()->uiControllerInternal()->activeArea();
QList<int> topLevelSeparators; // Indices of the top-level separators (with groups skipped)
QStringList separators = QStringList() << QStringLiteral("/") << QStringLiteral("-");
const QStringList separators {QStringLiteral("/"), QStringLiteral("-")};
QList<QStringList> groups;
bool ret = true;
......
......@@ -64,7 +64,7 @@ LaunchConfigurationDialog::LaunchConfigurationDialog(QWidget* parent)
mainLayout->addWidget(mainWidget);
setupUi(mainWidget);
splitter->setSizes(QList<int>() << 260 << 620);
splitter->setSizes(QList<int>{260, 620});
splitter->setCollapsible(0, false);
addConfig->setToolTip(i18nc("@info:tooltip", "Add a new launch configuration."));
......
......@@ -196,8 +196,7 @@ public:
QPushButton *button = new QPushButton();
button->setIcon(QIcon::fromTheme(QStringLiteral("dialog-information")));
setBlockedEventTypes(button, QList<QEvent::Type>() << QEvent::MouseButtonPress
<< QEvent::MouseButtonRelease << QEvent::MouseButtonDblClick);
setBlockedEventTypes(button, QList<QEvent::Type>{QEvent::MouseButtonPress, QEvent::MouseButtonRelease, QEvent::MouseButtonDblClick});
connect(button, &QPushButton::clicked, this, &LoadedPluginsDelegate::info);
return QList<QWidget*>()
......
......@@ -50,8 +50,12 @@ QIcon generateIcon(const WorkingSetIconParameters& params)
pixmap.fill(QColor::fromRgba(qRgba(0, 0, 0, 0)));
const uint coloredCount = params.coloredCount;
// coordinates of the rectangles to draw, for 16x16 icons specifically
QList<QRect> rects;
rects << QRect(1, 1, 5, 5) << QRect(1, 9, 5, 5) << QRect(9, 1, 5, 5) << QRect(9, 9, 5, 5);
QList<QRect> rects{
{1, 1, 5, 5},
{1, 9, 5, 5},
{9, 1, 5, 5},
{9, 9, 5, 5},
};
if ( params.swapDiagonal ) {
rects.swap(1, 2);
}
......
......@@ -173,9 +173,10 @@ void IdealDockWidget::contextMenuRequested(const QPoint &point)
//save shortcut config
KConfigGroup config = KSharedConfig::openConfig()->group("UI");
QStringList shortcuts;
shortcuts << w->shortcut().value(0).toString();
shortcuts << w->shortcut().value(1).toString();
const QStringList shortcuts{
w->shortcut().value(0).toString(),
w->shortcut().value(1).toString(),
};
config.writeEntry(QStringLiteral("Shortcut for %1").arg(m_view->document()->title()), shortcuts);
config.sync();
}
......
......@@ -70,9 +70,10 @@ void VcsItemEventModel::addItemEvents( const QList<KDevelop::VcsItemEvent>& list
QMimeType mime = repoUrl.isLocalFile()
? mimeDataBase.mimeTypeForFile(repoUrl.toLocalFile(), QMimeDatabase::MatchExtension)
: mimeDataBase.mimeTypeForUrl(repoUrl);
QList<QStandardItem*> rowItems = QList<QStandardItem*>()
<< new QStandardItem(QIcon::fromTheme(mime.iconName()), ev.repositoryLocation())
<< new QStandardItem(actionStrings.join(i18nc("separes an action list", ", ")));
QList<QStandardItem*> rowItems{
new QStandardItem(QIcon::fromTheme(mime.iconName()), ev.repositoryLocation()),
new QStandardItem(actionStrings.join(i18nc("separes an action list", ", "))),
};
QString loc = ev.repositoryCopySourceLocation();
if(!loc.isEmpty()) { //according to the documentation, those are optional. don't force them on the UI
rowItems << new QStandardItem(ev.repositoryCopySourceLocation());
......
......@@ -534,10 +534,11 @@ QString AppWizardPlugin::knsConfigurationFile() const
QStringList AppWizardPlugin::supportedMimeTypes() const
{
QStringList types;
types << QStringLiteral("application/x-desktop");
types << QStringLiteral("application/x-bzip-compressed-tar");
types << QStringLiteral("application/zip");
const QStringList types{
QStringLiteral("application/x-desktop"),
QStringLiteral("application/x-bzip-compressed-tar"),
QStringLiteral("application/zip"),
};
return types;
}
......
......@@ -56,7 +56,7 @@ ProjectSelectionPage::ProjectSelectionPage(ProjectTemplatesModel *templatesModel
this, &ProjectSelectionPage::nameChanged );
ui->listView->setLevels(2);
ui->listView->setHeaderLabels(QStringList() << i18n("Category") << i18n("Project Type"));
ui->listView->setHeaderLabels(QStringList{i18n("Category"), i18n("Project Type")});
ui->listView->setModel(templatesModel);
ui->listView->setLastLevelViewMode(MultiLevelListView::DirectChildren);
connect (ui->listView, &MultiLevelListView::currentIndexChanged, this, &ProjectSelectionPage::typeChanged);
......
......@@ -359,12 +359,13 @@ public:
QVariant data(const QModelIndex& index, int role, const CodeCompletionModel* model) const override
{
if (role == CodeCompletionModel::CustomHighlight && index.column() == CodeCompletionModel::Arguments && argumentHintDepth()) {
QList<QVariant> highlighting;
highlighting << QVariant(m_range.start);
highlighting << QVariant(m_range.end);
QTextCharFormat boldFormat;
boldFormat.setFontWeight(QFont::Bold);
highlighting << boldFormat;
const QList<QVariant> highlighting {
QVariant(m_range.start),
QVariant(m_range.end),
boldFormat,
};
return highlighting;
}
......
......@@ -46,13 +46,14 @@ void CMakeCacheModel::reset()
void CMakeCacheModel::read()
{
// Set headers
QStringList labels;
labels.append(i18n("Name"));
labels.append(i18n("Type"));
labels.append(i18n("Value"));
labels.append(i18n("Comment"));
labels.append(i18n("Advanced"));
labels.append(i18n("Strings"));
const QStringList labels{
i18n("Name"),
i18n("Type"),
i18n("Value"),
i18n("Comment"),
i18n("Advanced"),
i18n("Strings"),
};
setHorizontalHeaderLabels(labels);
QFile file(m_filePath.toLocalFile());
......@@ -83,11 +84,12 @@ void CMakeCacheModel::read()
QString type=c.type();
QString value=c.value();
QList<QStandardItem*> lineItems;
lineItems.append(new QStandardItem(name));
lineItems.append(new QStandardItem(type));
lineItems.append(new QStandardItem(value));
lineItems.append(new QStandardItem(currentComment.join(QLatin1Char('\n'))));
const QList<QStandardItem*> lineItems{
new QStandardItem(name),
new QStandardItem(type),
new QStandardItem(value),
new QStandardItem(currentComment.join(QLatin1Char('\n'))),
};
if(flag==QLatin1String("INTERNAL"))
{
......
......@@ -65,9 +65,9 @@ private:
CMakeBuilder::CMakeBuilder(QObject *parent, const QVariantList &)
: KDevelop::IPlugin(QStringLiteral("kdevcmakebuilder"), parent)
{
addBuilder(QStringLiteral("Makefile"), QStringList(QStringLiteral("Unix Makefiles"))
<< QStringLiteral("NMake Makefiles")
<< QStringLiteral("MinGW Makefiles"),
addBuilder(QStringLiteral("Makefile"), QStringList{QStringLiteral("Unix Makefiles"),
QStringLiteral("NMake Makefiles"),
QStringLiteral("MinGW Makefiles")},
core()->pluginController()->pluginForExtension(QStringLiteral("org.kdevelop.IMakeBuilder")));
addBuilder(QStringLiteral("build.ninja"), QStringList(QStringLiteral("Ninja")), core()->pluginController()->pluginForExtension(QStringLiteral("org.kdevelop.IProjectBuilder"), QStringLiteral("KDevNinjaBuilder")));
}
......
......@@ -105,11 +105,13 @@ CompilerProvider::CompilerProvider( SettingsManager* settings, QObject* parent )
: QObject( parent )
, m_settings(settings)
{
m_factories.append(CompilerFactoryPointer(new GccFactory()));
m_factories.append(CompilerFactoryPointer(new ClangFactory()));
m_factories = {
CompilerFactoryPointer(new GccFactory()),
CompilerFactoryPointer(new ClangFactory()),
#ifdef _WIN32
m_factories.append(CompilerFactoryPointer(new MsvcFactory()));
CompilerFactoryPointer(new MsvcFactory()),
#endif
};
if (!QStandardPaths::findExecutable( QStringLiteral("clang") ).isEmpty()) {
m_factories[1]->registerDefaultCompilers(this);
......
......@@ -85,11 +85,13 @@ Defines GccLikeCompiler::defines(Utils::LanguageType type, const QString& argume
proc.setProcessChannelMode( QProcess::MergedChannels );
// TODO: what about -mXXX or -target= flags, some of these change search paths/defines
QStringList compilerArguments{languageOption(type), languageStandard(arguments)};
compilerArguments.append(QStringLiteral("-dM"));
compilerArguments.append(QStringLiteral("-E"));
compilerArguments.append(QStringLiteral("-"));
const QStringList compilerArguments{
languageOption(type),
languageStandard(arguments),
QStringLiteral("-dM"),
QStringLiteral("-E"),
QStringLiteral("-"),
};
proc.setStandardInputFile(QProcess::nullDevice());
proc.setProgram(path());
proc.setArguments(compilerArguments);
......@@ -140,10 +142,13 @@ Path::List GccLikeCompiler::includes(Utils::LanguageType type, const QString& ar
// /usr/include
// End of search list.
QStringList compilerArguments{languageOption(type), languageStandard(arguments)};
compilerArguments.append(QStringLiteral("-E"));
compilerArguments.append(QStringLiteral("-v"));
compilerArguments.append(QStringLiteral("-"));
const QStringList compilerArguments{
languageOption(type),
languageStandard(arguments),
QStringLiteral("-E"),
QStringLiteral("-v"),
QStringLiteral("-"),
};
proc.setStandardInputFile(QProcess::nullDevice());
proc.setProgram(path());
......
......@@ -112,13 +112,14 @@ namespace {
QStringList possibleTargets(const QString& targetBaseName) const
{
QStringList ret;
const QStringList ret{
///@todo open the make-file, and read the target-names from there.
//It would be nice if all targets could be processed in one call, the problem is the exit-status of make, so for now make has to be called multiple times.
ret << targetBaseName + ".o";
ret << targetBaseName + ".lo";
targetBaseName + QLatin1String(".o"),
targetBaseName + QLatin1String(".lo"),
//ret << targetBaseName + ".lo " + targetBaseName + ".o";
ret << targetBaseName + ".ko";
targetBaseName + QLatin1String(".ko"),
};
return ret;
}
......
......@@ -275,11 +275,12 @@ KDevelop::SourceFormatterStyle CustomScriptPlugin::predefinedStyle(const QString
QVector<KDevelop::SourceFormatterStyle> CustomScriptPlugin::predefinedStyles() const
{
QVector<KDevelop::SourceFormatterStyle> styles = stylesFromLanguagePlugins();
styles << predefinedStyle(QStringLiteral("kdev_format_source"));
styles << predefinedStyle(QStringLiteral("GNU_indent_GNU"));
styles << predefinedStyle(QStringLiteral("GNU_indent_KR"));
styles << predefinedStyle(QStringLiteral("GNU_indent_orig"));
const QVector<KDevelop::SourceFormatterStyle> styles = stylesFromLanguagePlugins() + QVector<KDevelop::SourceFormatterStyle>{
predefinedStyle(QStringLiteral("kdev_format_source")),
predefinedStyle(QStringLiteral("GNU_indent_GNU")),
predefinedStyle(QStringLiteral("GNU_indent_KR")),
predefinedStyle(QStringLiteral("GNU_indent_orig")),
};
return styles;
}
......
......@@ -57,7 +57,13 @@ RegistersGroup RegisterController_Arm::registersFromGroup(const GroupsName& grou
QVector<GroupsName> RegisterController_Arm::namesOfRegisterGroups() const
{
static const QVector<GroupsName> registerGroups = QVector<GroupsName>() << enumToGroupName(General) << enumToGroupName(Flags) << enumToGroupName(VFP_single) << enumToGroupName(VFP_double) << enumToGroupName(VFP_quad);
static const QVector<GroupsName> registerGroups = QVector<GroupsName>{
enumToGroupName(General),
enumToGroupName(Flags),
enumToGroupName(VFP_single),
enumToGroupName(VFP_double),
enumToGroupName(VFP_quad),
};
return registerGroups;
}
......@@ -120,15 +126,8 @@ RegisterController_Arm::RegisterController_Arm(MIDebugSession* debugSession, QOb
m_formatsModes.resize(namesOfRegisterGroups().size());
m_formatsModes[VFP_double].formats.append(Binary);
m_formatsModes[VFP_double].formats.append(Decimal);
m_formatsModes[VFP_double].formats.append(Hexadecimal);
m_formatsModes[VFP_double].formats.append(Octal);
m_formatsModes[VFP_double].formats.append(Unsigned);
m_formatsModes[VFP_double].modes.append(u32);
m_formatsModes[VFP_double].modes.append(u64);
m_formatsModes[VFP_double].modes.append(f32);
m_formatsModes[VFP_double].modes.append(f64);
m_formatsModes[VFP_double].formats = {Binary, Decimal, Hexadecimal, Octal, Unsigned};
m_formatsModes[VFP_double].modes = {u32, u64, f32, f64};
m_formatsModes[Flags].formats.append(Raw);
m_formatsModes[Flags].modes.append(natural);
......@@ -150,8 +149,20 @@ void RegisterController_Arm::initRegisterNames()
}
m_cpsr.registerName = QStringLiteral("cpsr");
m_cpsr.flags << QStringLiteral("Q") << QStringLiteral("V") << QStringLiteral("C") << QStringLiteral("Z") << QStringLiteral("N");
m_cpsr.bits << QStringLiteral("27") << QStringLiteral("28") << QStringLiteral("29") << QStringLiteral("30") << QStringLiteral("31");
m_cpsr.flags = QStringList{
QStringLiteral("Q"),
QStringLiteral("V"),
QStringLiteral("C"),
QStringLiteral("Z"),
QStringLiteral("N"),
};
m_cpsr.bits = QStringList{
QStringLiteral("27"),
QStringLiteral("28"),
QStringLiteral("29"),
QStringLiteral("30"),
QStringLiteral("31"),
};
m_cpsr.groupName = enumToGroupName(Flags);
m_registerNames[Flags] = m_cpsr.flags;
......
......@@ -57,7 +57,13 @@ RegistersGroup RegisterControllerGeneral_x86::registersFromGroup(const GroupsNam
QVector<GroupsName> RegisterControllerGeneral_x86::namesOfRegisterGroups() const
{
static const QVector<GroupsName> registerGroups = QVector<GroupsName>() << enumToGroupName(General) << enumToGroupName(Flags) << enumToGroupName(FPU) << enumToGroupName(XMM) << enumToGroupName(Segment);
static const QVector<GroupsName> registerGroups = QVector<GroupsName>{
enumToGroupName(General),
enumToGroupName(Flags),
enumToGroupName(FPU),
enumToGroupName(XMM),
enumToGroupName(Segment),
};
return registerGroups;
}
......@@ -133,15 +139,8 @@ RegisterControllerGeneral_x86::RegisterControllerGeneral_x86(MIDebugSession* deb
m_formatsModes.resize(namesOfRegisterGroups().size());
m_formatsModes[XMM].formats.append(Binary);
m_formatsModes[XMM].formats.append(Decimal);
m_formatsModes[XMM].formats.append(Hexadecimal);
m_formatsModes[XMM].formats.append(Octal);
m_formatsModes[XMM].formats.append(Unsigned);
m_formatsModes[XMM].modes.append(v4_float);
m_formatsModes[XMM].modes.append(v2_double);
m_formatsModes[XMM].modes.append(v4_int32);
m_formatsModes[XMM].modes.append(v2_int64);
m_formatsModes[XMM].formats = {Binary, Decimal, Hexadecimal, Octal, Unsigned};
m_formatsModes[XMM].modes = {v4_float, v2_double, v4_int32, v2_int64};
m_formatsModes[Flags].formats.append(Raw);
m_formatsModes[Flags].modes.append(natural);
......@@ -173,10 +172,26 @@ void RegisterControllerGeneral_x86::initRegisterNames()
QStringLiteral("O")
};
m_registerNames[Segment] << QStringLiteral("cs") << QStringLiteral("ss") << QStringLiteral("ds") << QStringLiteral("es") << QStringLiteral("fs") << QStringLiteral("gs");
m_registerNames[Segment] = QStringList{
QStringLiteral("cs"),
QStringLiteral("ss"),
QStringLiteral("ds"),
QStringLiteral("es"),
QStringLiteral("fs"),
QStringLiteral("gs"),
};
m_eflags.flags = m_registerNames[Flags];
m_eflags.bits << QStringLiteral("0") << QStringLiteral("2") << QStringLiteral("4") << QStringLiteral("6") << QStringLiteral("7") << QStringLiteral("8") << QStringLiteral("10") << QStringLiteral("11");
m_eflags.bits = QStringList{
QStringLiteral("0"),
QStringLiteral("2"),
QStringLiteral("4"),
QStringLiteral("6"),
QStringLiteral("7"),
QStringLiteral("8"),
QStringLiteral("10"),
QStringLiteral("11"),
};
m_eflags.registerName = QStringLiteral("eflags");
m_eflags.groupName = enumToGroupName(Flags);
}
......
......@@ -315,11 +315,19 @@ bool STTY::findExternalTTY(const QString& termApp)
m_externalTerminal.reset(new QProcess(this));
if (appName == QLatin1String("konsole")) {
m_externalTerminal->start(appName, QStringList() << QStringLiteral("-e") << QStringLiteral("sh") << QStringLiteral("-c") << "tty>" + file.fileName() + ";exec<&-;exec>&-;while :;do sleep 3600;done");
m_externalTerminal->start(appName, QStringList{
QStringLiteral("-e"),
QStringLiteral("sh"),
QStringLiteral("-c"),
QLatin1String("tty>") + file.fileName() + QLatin1String(";exec<&-;exec>&-;while :;do sleep 3600;done")});
} else if (appName == QLatin1String("xfce4-terminal")) {
m_externalTerminal->start(appName, QStringList() << QStringLiteral("-e") << " sh -c \"tty>" + file.fileName() + ";\"\"<&\\-\"\">&\\-;\"\"while :;\"\"do sleep 3600;\"\"done\"");
m_externalTerminal->start(appName, QStringList{
QStringLiteral("-e"),
QLatin1String("sh -c \"tty>") + file.fileName() + QLatin1String(";\"\"<&\\-\"\">&\\-;\"\"while :;\"\"do sleep 3600;\"\"done\"")});
} else {
m_externalTerminal->start(appName, QStringList() << QStringLiteral("-e") << "sh -c \"tty>" + file.fileName() + ";exec<&-;exec>&-;while :;do sleep 3600;done\"");
m_externalTerminal->start(appName, QStringList{
QStringLiteral("-e"),
QLatin1String("sh -c \"tty>") + file.fileName() + QLatin1String(";exec<&-;exec>&-;while :;do sleep 3600;done\"")});
}
if (!m_externalTerminal->waitForStarted(500)) {
......
......@@ -200,7 +200,7 @@ DisassembleWidget::DisassembleWidget(MIDebuggerPlugin* plugin, QWidget *parent)
m_disassembleWindow->setUniformRowHeights(true);
m_disassembleWindow->setRootIsDecorated(false);
m_disassembleWindow->setHeaderLabels(QStringList() << QString() << i18n("Address") << i18n("Function") << i18n("Instruction"));
m_disassembleWindow->setHeaderLabels(QStringList{QString(), i18n("Address"), i18n("Function"), i18n("Instruction")});
m_splitter->setStretchFactor(0, 1);
m_splitter->setContentsMargins(0, 0, 0, 0);
......@@ -398,7 +398,7 @@ void DisassembleWidget::disassembleMemoryHandler(const ResultRecord& r)
}else { currentFunction = fct; }
m_disassembleWindow->addTopLevelItem(new QTreeWidgetItem(m_disassembleWindow,
QStringList() << QString() << addr << fct << inst));
QStringList{QString(), addr, fct, inst}));
if (i == 0) {
lower_ = addr.toULong(&ok,16);
......
......@@ -92,9 +92,10 @@ void PlasmoidExecutionConfig::saveToConfiguration( KConfigGroup cfg, KDevelop::I
{
Q_UNUSED( project );
cfg.writeEntry("PlasmoidIdentifier", identifier->lineEdit()->text());
QStringList args;
args += QStringLiteral("--formfactor");
args += formFactor->currentText();
QStringList args{
QStringLiteral("--formfactor"),
formFactor->currentText(),
};
if(!themes->currentText().isEmpty()) {
args += QStringLiteral("--theme");
args += themes->currentText();
......
......@@ -145,15 +145,18 @@ void FileManager::setupActions()
action->setText(i18n("Current Document Directory"));
action->setIcon(QIcon::fromTheme(QStringLiteral("dirsync")));
connect(action, &QAction::triggered, this, &FileManager::syncCurrentDocumentDirectory);
tbActions << (dirop->actionCollection()->action(QStringLiteral("back")));
tbActions << (dirop->actionCollection()->action(QStringLiteral("up")));
tbActions << (dirop->actionCollection()->action(QStringLiteral("home")));
tbActions << (dirop->actionCollection()->action(QStringLiteral("forward")));
tbActions << (dirop->actionCollection()->action(QStringLiteral("reload")));
tbActions << acmBookmarks;
tbActions << action;
tbActions << (dirop->actionCollection()->action(QStringLiteral("sorting menu")));
tbActions << (dirop->actionCollection()->action(QStringLiteral("show hidden")));
auto* diropActionCollection = dirop->actionCollection();
tbActions = {
diropActionCollection->action(QStringLiteral("back")),
diropActionCollection->action(QStringLiteral("up")),
diropActionCollection->action(QStringLiteral("home")),
diropActionCollection->action(QStringLiteral("forward")),
diropActionCollection->action(QStringLiteral("reload")),
acmBookmarks,
action,
diropActionCollection->action(QStringLiteral("sorting menu")),
diropActionCollection->action(QStringLiteral("show hidden")),
};
newFileAction = new QAction(this);
newFileAction->setText(i18n("New File..."));
......
......@@ -168,10 +168,11 @@ QString FileTemplatesPlugin::knsConfigurationFile() const
QStringList FileTemplatesPlugin::supportedMimeTypes() const
{
QStringList types;
types << QStringLiteral("application/x-desktop");
types << QStringLiteral("application/x-bzip-compressed-tar");
types << QStringLiteral("application/zip");
const QStringList types{
QStringLiteral("application/x-desktop"),
QStringLiteral("application/x-bzip-compressed-tar"),
QStringLiteral("application/zip"),
};
return types;
}
......@@ -243,8 +244,7 @@ FileTemplatesPlugin::TemplateType FileTemplatesPlugin::determineTemplateType(con
int level = 0;
while (dir.cdUp() && level < 5)
{
QStringList filters;
filters << QStringLiteral("*.kdevtemplate") << QStringLiteral("*.desktop");
const QStringList filters{QStringLiteral("*.kdevtemplate"), QStringLiteral("*.desktop")};
foreach (const QString& entry, dir.entryList(filters))
{
qCDebug(PLUGIN_FILETEMPLATES) << "Trying entry" << entry;
......
......@@ -211,7 +211,7 @@ TemplateSelectionPage::TemplateSelectionPage(TemplateClassAssistant* parent)
d->model->refresh();
d->ui->view->setLevels(3);
d->ui->view->setHeaderLabels(QStringList() << i18n("Language") << i18n("Framework") << i18n("Template"));
d->ui->view->setHeaderLabels(QStringList{i18n("Language"), i18n("Framework"), i18n("Template")});