Commit 3bf2922e authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Port away from QList::toSet()

The QSet range constructor requires Qt 5.14.

In `DolphinView::slotHeaderContextMenuRequested()` the conversion from
QList to QSet was pointless, so we just use a QList now.
parent 31cba55c
......@@ -7,7 +7,7 @@ set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
set(QT_MIN_VERSION "5.12.0")
set(QT_MIN_VERSION "5.14.0")
set(KF5_MIN_VERSION "5.73.0")
# ECM setup
......
......@@ -388,7 +388,8 @@ void KFileItemListView::applyRolesToModel()
// KFileItemModel does not distinct between "visible" and "invisible" roles.
// Add all roles that are mandatory for having a working KFileItemListView:
QSet<QByteArray> roles = visibleRoles().toSet();
const auto visibleRoles = this->visibleRoles();
auto roles = QSet<QByteArray>(visibleRoles.constBegin(), visibleRoles.constEnd());
roles.insert("iconPixmap");
roles.insert("iconName");
roles.insert("text");
......
......@@ -658,7 +658,8 @@ void KStandardItemListWidget::dataChanged(const QHash<QByteArray, QVariant>& cur
QSet<QByteArray> dirtyRoles;
if (roles.isEmpty()) {
dirtyRoles = visibleRoles().toSet();
const auto visibleRoles = this->visibleRoles();
dirtyRoles = QSet<QByteArray>(visibleRoles.constBegin(), visibleRoles.constEnd());
} else {
dirtyRoles = roles;
}
......
......@@ -54,7 +54,8 @@ void KFileItemClipboard::updateCutItems()
const QByteArray data = mimeData->data(QStringLiteral("application/x-kde-cutselection"));
const bool isCutSelection = (!data.isEmpty() && data.at(0) == QLatin1Char('1'));
if (isCutSelection) {
m_cutItems = KUrlMimeData::urlsFromMimeData(mimeData).toSet();
const auto urlsFromMimeData = KUrlMimeData::urlsFromMimeData(mimeData);
m_cutItems = QSet<QUrl>(urlsFromMimeData.constBegin(), urlsFromMimeData.constEnd());
} else {
m_cutItems.clear();
}
......
......@@ -963,7 +963,7 @@ void DolphinView::slotHeaderContextMenuRequested(const QPointF& pos)
QPointer<QMenu> menu = new QMenu(QApplication::activeWindow());
KItemListView* view = m_container->controller()->view();
const QSet<QByteArray> visibleRolesSet = view->visibleRoles().toSet();
const QList<QByteArray> visibleRolesSet = view->visibleRoles();
bool indexingEnabled = false;
#ifdef HAVE_BALOO
......
......@@ -521,7 +521,7 @@ void DolphinViewActionHandler::slotVisibleRolesChanged(const QList<QByteArray>&
{
Q_UNUSED(previous)
const QSet<QByteArray> checkedRoles = current.toSet();
const auto checkedRoles = QSet<QByteArray>(current.constBegin(), current.constEnd());
QHashIterator<QByteArray, KToggleAction*> it(m_visibleRoles);
while (it.hasNext()) {
it.next();
......
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