┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2014-11-10 08:45:38 +0100
committerEmmanuel Pescosta <[email protected]>2014-11-10 08:45:38 +0100
commitd0f0f1f2e2644e3738c03374d062dab9acc61eaf (patch)
treeae2d4224b9e1706671926df592c2f4affacfe39c /src/views
parent82f19ab47019e9e8670e202ad44720d911ab09cf (diff)
make use of initializer lists
Diffstat (limited to 'src/views')
-rw-r--r--src/views/dolphinview.cpp6
-rw-r--r--src/views/dolphinviewactionhandler.cpp4
-rw-r--r--src/views/draganddrophelper.cpp2
-rw-r--r--src/views/renamedialog.cpp2
-rw-r--r--src/views/viewproperties.cpp5
5 files changed, 9 insertions, 10 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 782cc19f2..00281af73 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -125,7 +125,7 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) :
m_model = new KFileItemModel(this);
m_view = new DolphinItemListView();
m_view->setEnabledSelectionToggles(GeneralSettings::showSelectionToggle());
- m_view->setVisibleRoles(QList<QByteArray>() << "text");
+ m_view->setVisibleRoles({"text"});
applyModeToView();
KItemListController* controller = new KItemListController(m_model, m_view, this);
@@ -1286,7 +1286,7 @@ void DolphinView::observeCreatedItem(const QUrl& url)
if (m_active) {
clearSelection();
markUrlAsCurrent(url);
- markUrlsAsSelected(QList<QUrl>() << url);
+ markUrlsAsSelected({url});
}
}
@@ -1513,7 +1513,7 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con
KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
KJobWidgets::setWindow(job, this);
- KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, QList<QUrl>() << oldUrl, newUrl, job);
+ KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
job->ui()->setAutoErrorHandlingEnabled(true);
if (!newNameExistsAlready) {
diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp
index 668623c8c..08d140c01 100644
--- a/src/views/dolphinviewactionhandler.cpp
+++ b/src/views/dolphinviewactionhandler.cpp
@@ -141,7 +141,7 @@ void DolphinViewActionHandler::createActions()
// Well, it's the File menu in dolphinmainwindow and the Edit menu in dolphinpart... :)
propertiesAction->setText( i18nc("@action:inmenu File", "Properties") );
propertiesAction->setIcon(QIcon::fromTheme("document-properties"));
- m_actionCollection->setDefaultShortcuts(propertiesAction, QList<QKeySequence>() << Qt::ALT + Qt::Key_Return << Qt::ALT + Qt::Key_Enter);
+ m_actionCollection->setDefaultShortcuts(propertiesAction, {Qt::ALT + Qt::Key_Return, Qt::ALT + Qt::Key_Enter});
connect(propertiesAction, &QAction::triggered, this, &DolphinViewActionHandler::slotProperties);
// View menu
@@ -211,7 +211,7 @@ void DolphinViewActionHandler::createActions()
KToggleAction* showHiddenFiles = m_actionCollection->add<KToggleAction>("show_hidden_files");
showHiddenFiles->setText(i18nc("@action:inmenu View", "Show Hidden Files"));
- m_actionCollection->setDefaultShortcuts(showHiddenFiles, QList<QKeySequence>() << Qt::ALT + Qt::Key_Period << Qt::Key_F8);
+ m_actionCollection->setDefaultShortcuts(showHiddenFiles, {Qt::ALT + Qt::Key_Period, Qt::Key_F8});
connect(showHiddenFiles, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleShowHiddenFiles);
QAction* adjustViewProps = m_actionCollection->addAction("view_properties");
diff --git a/src/views/draganddrophelper.cpp b/src/views/draganddrophelper.cpp
index 1f3f4ba82..a09faa345 100644
--- a/src/views/draganddrophelper.cpp
+++ b/src/views/draganddrophelper.cpp
@@ -47,7 +47,7 @@ KonqOperations* DragAndDropHelper::dropUrls(const KFileItem& destItem, const QUr
QDBusMessage message = QDBusMessage::createMethodCall(remoteDBusClient, remoteDBusPath,
"org.kde.ark.DndExtract", "extractSelectedFilesTo");
- message.setArguments(QVariantList() << destUrl.toDisplayString(QUrl::PreferLocalFile));
+ message.setArguments({destUrl.toDisplayString(QUrl::PreferLocalFile)});
QDBusConnection::sessionBus().call(message);
} else if (!destItem.isNull() && (destItem.isDir() || destItem.isDesktopFile())) {
// Drop into a directory or a desktop-file
diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp
index 458b9ef79..7fdb486e1 100644
--- a/src/views/renamedialog.cpp
+++ b/src/views/renamedialog.cpp
@@ -159,7 +159,7 @@ void RenameDialog::renameItem(const KFileItem &item, const QString& newName)
KIO::Job * job = KIO::moveAs(oldUrl, newUrl);
KJobWidgets::setWindow(job, widget);
- KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, QList<QUrl>() << oldUrl, newUrl, job);
+ KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Rename, {oldUrl}, newUrl, job);
job->ui()->setAutoErrorHandlingEnabled(true);
}
diff --git a/src/views/viewproperties.cpp b/src/views/viewproperties.cpp
index 5eb5d23fd..36c6338fe 100644
--- a/src/views/viewproperties.cpp
+++ b/src/views/viewproperties.cpp
@@ -98,7 +98,7 @@ ViewProperties::ViewProperties(const QUrl& url) :
if (useDefaultProps) {
if (useDetailsViewWithPath) {
setViewMode(DolphinView::DetailsView);
- setVisibleRoles(QList<QByteArray>() << "path");
+ setVisibleRoles({"path"});
} else {
// The global view-properties act as default for directories without
// any view-property configuration. Constructing a ViewProperties
@@ -286,8 +286,7 @@ QList<QByteArray> ViewProperties::visibleRoles() const
// by "CustomizedDetails"), also a details-view with no additional information
// is accepted.
- QList<QByteArray> roles;
- roles.append("text");
+ QList<QByteArray> roles{"text"};
// Iterate through all stored keys and append all roles that match to
// the current view mode.