mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-04 17:30:55 +00:00
Replace qAsConst with std::as_const
This commit is contained in:
parent
5a7b749f5b
commit
b58a346be9
|
@ -137,7 +137,7 @@ void DolphinContextMenu::addTrashItemContextMenu()
|
|||
addAction(QIcon::fromTheme("restoration"), i18nc("@action:inmenu", "Restore"), [this]() {
|
||||
QList<QUrl> selectedUrls;
|
||||
selectedUrls.reserve(m_selectedItems.count());
|
||||
for (const KFileItem &item : qAsConst(m_selectedItems)) {
|
||||
for (const KFileItem &item : std::as_const(m_selectedItems)) {
|
||||
selectedUrls.append(item.url());
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ void DolphinContextMenu::addItemContextMenu()
|
|||
} else {
|
||||
// multiple files
|
||||
bool selectionHasOnlyDirs = true;
|
||||
for (const auto &item : qAsConst(m_selectedItems)) {
|
||||
for (const auto &item : std::as_const(m_selectedItems)) {
|
||||
const QUrl &url = DolphinView::openItemAsFolderUrl(item);
|
||||
if (url.isEmpty()) {
|
||||
selectionHasOnlyDirs = false;
|
||||
|
|
|
@ -75,7 +75,7 @@ bool Dolphin::attachToExistingInstance(const QList<QUrl> &inputUrls,
|
|||
}
|
||||
|
||||
int activeWindowIndex = -1;
|
||||
for (const auto &interface : qAsConst(dolphinInterfaces)) {
|
||||
for (const auto &interface : std::as_const(dolphinInterfaces)) {
|
||||
++activeWindowIndex;
|
||||
|
||||
auto isActiveWindowReply = interface.first->isActiveWindow();
|
||||
|
@ -116,7 +116,7 @@ bool Dolphin::attachToExistingInstance(const QList<QUrl> &inputUrls,
|
|||
}
|
||||
}
|
||||
|
||||
for (const auto &interface : qAsConst(dolphinInterfaces)) {
|
||||
for (const auto &interface : std::as_const(dolphinInterfaces)) {
|
||||
if (interface.second.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -981,7 +981,7 @@ void KFileItemModel::resortAllItems()
|
|||
// been moved because of the resorting.
|
||||
QList<QUrl> oldUrls;
|
||||
oldUrls.reserve(itemCount);
|
||||
for (const ItemData *itemData : qAsConst(m_itemData)) {
|
||||
for (const ItemData *itemData : std::as_const(m_itemData)) {
|
||||
oldUrls.append(itemData->item.url());
|
||||
}
|
||||
|
||||
|
@ -1226,7 +1226,7 @@ void KFileItemModel::slotItemsDeleted(const KFileItemList &items)
|
|||
indexesToRemoveWithChildren.reserve(m_itemData.count());
|
||||
|
||||
const int itemCount = m_itemData.count();
|
||||
for (int index : qAsConst(indexesToRemove)) {
|
||||
for (int index : std::as_const(indexesToRemove)) {
|
||||
indexesToRemoveWithChildren.append(index);
|
||||
|
||||
const int parentLevel = expandedParentsCount(index);
|
||||
|
@ -1644,7 +1644,7 @@ void KFileItemModel::prepareItemsForSorting(QList<ItemData *> &itemDataList)
|
|||
case DeletionTimeRole:
|
||||
// These roles can be determined with retrieveData, and they have to be stored
|
||||
// in the QHash "values" for the sorting.
|
||||
for (ItemData *itemData : qAsConst(itemDataList)) {
|
||||
for (ItemData *itemData : std::as_const(itemDataList)) {
|
||||
if (itemData->values.isEmpty()) {
|
||||
itemData->values = retrieveData(itemData->item, itemData->parent);
|
||||
}
|
||||
|
@ -1653,7 +1653,7 @@ void KFileItemModel::prepareItemsForSorting(QList<ItemData *> &itemDataList)
|
|||
|
||||
case TypeRole:
|
||||
// At least store the data including the file type for items with known MIME type.
|
||||
for (ItemData *itemData : qAsConst(itemDataList)) {
|
||||
for (ItemData *itemData : std::as_const(itemDataList)) {
|
||||
if (itemData->values.isEmpty()) {
|
||||
const KFileItem item = itemData->item;
|
||||
if (item.isDir() || item.isMimeTypeKnown()) {
|
||||
|
|
|
@ -905,7 +905,7 @@ void KFileItemModelRolesUpdater::startUpdating()
|
|||
m_pendingPreviewItems.clear();
|
||||
m_pendingPreviewItems.reserve(indexes.count());
|
||||
|
||||
for (int index : qAsConst(indexes)) {
|
||||
for (int index : std::as_const(indexes)) {
|
||||
const KFileItem item = m_model->fileItem(index);
|
||||
if (!m_finishedItems.contains(item)) {
|
||||
m_pendingPreviewItems.append(item);
|
||||
|
@ -1170,11 +1170,11 @@ void KFileItemModelRolesUpdater::updateChangedItems()
|
|||
std::sort(visibleChangedIndexes.begin(), visibleChangedIndexes.end());
|
||||
|
||||
if (m_previewShown) {
|
||||
for (int index : qAsConst(visibleChangedIndexes)) {
|
||||
for (int index : std::as_const(visibleChangedIndexes)) {
|
||||
m_pendingPreviewItems.append(m_model->fileItem(index));
|
||||
}
|
||||
|
||||
for (int index : qAsConst(invisibleChangedIndexes)) {
|
||||
for (int index : std::as_const(invisibleChangedIndexes)) {
|
||||
m_pendingPreviewItems.append(m_model->fileItem(index));
|
||||
}
|
||||
|
||||
|
@ -1359,7 +1359,7 @@ QHash<QByteArray, QVariant> KFileItemModelRolesUpdater::rolesData(const KFileIte
|
|||
}
|
||||
|
||||
QStringList overlays = item.overlays();
|
||||
for (KOverlayIconPlugin *it : qAsConst(m_overlayIconsPlugin)) {
|
||||
for (KOverlayIconPlugin *it : std::as_const(m_overlayIconsPlugin)) {
|
||||
overlays.append(it->getOverlays(item.url()));
|
||||
}
|
||||
if (!overlays.isEmpty()) {
|
||||
|
@ -1384,7 +1384,7 @@ void KFileItemModelRolesUpdater::slotOverlaysChanged(const QUrl &url, const QStr
|
|||
const int index = m_model->index(item);
|
||||
QHash<QByteArray, QVariant> data = m_model->data(index);
|
||||
QStringList overlays = item.overlays();
|
||||
for (KOverlayIconPlugin *it : qAsConst(m_overlayIconsPlugin)) {
|
||||
for (KOverlayIconPlugin *it : std::as_const(m_overlayIconsPlugin)) {
|
||||
overlays.append(it->getOverlays(url));
|
||||
}
|
||||
data.insert("iconOverlays", overlays);
|
||||
|
|
|
@ -231,7 +231,7 @@ void KItemListView::setVisibleRoles(const QList<QByteArray> &roles)
|
|||
if (!m_headerWidget->automaticColumnResizing()) {
|
||||
// The column-width of new roles are still 0. Apply the preferred
|
||||
// column-width as default with.
|
||||
for (const QByteArray &role : qAsConst(m_visibleRoles)) {
|
||||
for (const QByteArray &role : std::as_const(m_visibleRoles)) {
|
||||
if (m_headerWidget->columnWidth(role) == 0) {
|
||||
const qreal width = m_headerWidget->preferredColumnWidth(role);
|
||||
m_headerWidget->setColumnWidth(role, width);
|
||||
|
@ -669,7 +669,7 @@ void KItemListView::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
|
|||
{
|
||||
QGraphicsWidget::paint(painter, option, widget);
|
||||
|
||||
for (auto animation : qAsConst(m_rubberBandAnimations)) {
|
||||
for (auto animation : std::as_const(m_rubberBandAnimations)) {
|
||||
QRectF rubberBandRect = animation->property(RubberPropertyName).toRectF();
|
||||
|
||||
const QPointF topLeft = rubberBandRect.topLeft();
|
||||
|
@ -1220,7 +1220,7 @@ void KItemListView::slotItemsRemoved(const KItemRangeList &itemRanges)
|
|||
// after the deleted items. It is important to update them in ascending
|
||||
// order to prevent overlaps when setting the new index.
|
||||
std::sort(itemsToMove.begin(), itemsToMove.end());
|
||||
for (int i : qAsConst(itemsToMove)) {
|
||||
for (int i : std::as_const(itemsToMove)) {
|
||||
KItemListWidget *widget = m_visibleItems.value(i);
|
||||
Q_ASSERT(widget);
|
||||
const int newIndex = i - count;
|
||||
|
@ -1846,7 +1846,7 @@ void KItemListView::doLayout(LayoutAnimationHint hint, int changedIndex, int cha
|
|||
}
|
||||
|
||||
// Delete invisible KItemListWidget instances that have not been reused
|
||||
for (int index : qAsConst(reusableItems)) {
|
||||
for (int index : std::as_const(reusableItems)) {
|
||||
recycleWidget(m_visibleItems.value(index));
|
||||
}
|
||||
|
||||
|
@ -2222,7 +2222,7 @@ QHash<QByteArray, qreal> KItemListView::preferredColumnWidths(const KItemRangeLi
|
|||
const QFontMetricsF fontMetrics(m_headerWidget->font());
|
||||
const int gripMargin = m_headerWidget->style()->pixelMetric(QStyle::PM_HeaderGripMargin);
|
||||
const int headerMargin = m_headerWidget->style()->pixelMetric(QStyle::PM_HeaderMargin);
|
||||
for (const QByteArray &visibleRole : qAsConst(m_visibleRoles)) {
|
||||
for (const QByteArray &visibleRole : std::as_const(m_visibleRoles)) {
|
||||
const QString headerText = m_model->roleDescription(visibleRole);
|
||||
const qreal headerWidth = fontMetrics.horizontalAdvance(headerText) + gripMargin + headerMargin * 2;
|
||||
widths.insert(visibleRole, headerWidth);
|
||||
|
@ -2238,7 +2238,7 @@ QHash<QByteArray, qreal> KItemListView::preferredColumnWidths(const KItemRangeLi
|
|||
const int endIndex = startIndex + itemRange.count - 1;
|
||||
|
||||
for (int i = startIndex; i <= endIndex; ++i) {
|
||||
for (const QByteArray &visibleRole : qAsConst(m_visibleRoles)) {
|
||||
for (const QByteArray &visibleRole : std::as_const(m_visibleRoles)) {
|
||||
qreal maxWidth = widths.value(visibleRole, 0);
|
||||
const qreal width = creator->preferredRoleColumnWidth(visibleRole, i, this);
|
||||
maxWidth = qMax(width, maxWidth);
|
||||
|
@ -2279,7 +2279,7 @@ void KItemListView::applyColumnWidthsFromHeader()
|
|||
|
||||
void KItemListView::updateWidgetColumnWidths(KItemListWidget *widget)
|
||||
{
|
||||
for (const QByteArray &role : qAsConst(m_visibleRoles)) {
|
||||
for (const QByteArray &role : std::as_const(m_visibleRoles)) {
|
||||
widget->setColumnWidth(role, m_headerWidget->columnWidth(role));
|
||||
}
|
||||
widget->setSidePadding(m_headerWidget->sidePadding());
|
||||
|
@ -2296,7 +2296,7 @@ void KItemListView::updatePreferredColumnWidths(const KItemRangeList &itemRanges
|
|||
|
||||
if (itemCount == rangesItemCount) {
|
||||
const QHash<QByteArray, qreal> preferredWidths = preferredColumnWidths(itemRanges);
|
||||
for (const QByteArray &role : qAsConst(m_visibleRoles)) {
|
||||
for (const QByteArray &role : std::as_const(m_visibleRoles)) {
|
||||
m_headerWidget->setPreferredColumnWidth(role, preferredWidths.value(role));
|
||||
}
|
||||
} else {
|
||||
|
@ -2351,7 +2351,7 @@ void KItemListView::applyAutomaticColumnWidths()
|
|||
// size does not use the available view-size the size of the
|
||||
// first role will get stretched.
|
||||
|
||||
for (const QByteArray &role : qAsConst(m_visibleRoles)) {
|
||||
for (const QByteArray &role : std::as_const(m_visibleRoles)) {
|
||||
const qreal preferredWidth = m_headerWidget->preferredColumnWidth(role);
|
||||
m_headerWidget->setColumnWidth(role, preferredWidth);
|
||||
}
|
||||
|
@ -2400,7 +2400,7 @@ void KItemListView::applyAutomaticColumnWidths()
|
|||
qreal KItemListView::columnWidthsSum() const
|
||||
{
|
||||
qreal widthsSum = 0;
|
||||
for (const QByteArray &role : qAsConst(m_visibleRoles)) {
|
||||
for (const QByteArray &role : std::as_const(m_visibleRoles)) {
|
||||
widthsSum += m_headerWidget->columnWidth(role);
|
||||
}
|
||||
return widthsSum;
|
||||
|
|
|
@ -30,7 +30,7 @@ KItemListViewAccessible::KItemListViewAccessible(KItemListView *view_)
|
|||
|
||||
KItemListViewAccessible::~KItemListViewAccessible()
|
||||
{
|
||||
for (AccessibleIdWrapper idWrapper : qAsConst(m_cells)) {
|
||||
for (AccessibleIdWrapper idWrapper : std::as_const(m_cells)) {
|
||||
if (idWrapper.isValid) {
|
||||
QAccessible::deleteAccessibleInterface(idWrapper.id);
|
||||
}
|
||||
|
|
|
@ -195,14 +195,14 @@ KItemSet KItemSet::operator^(const KItemSet &other) const
|
|||
const QVector<int>::iterator end = rangeBoundaries.end();
|
||||
QVector<int>::iterator it = begin;
|
||||
|
||||
for (const KItemRange &range : qAsConst(m_itemRanges)) {
|
||||
for (const KItemRange &range : std::as_const(m_itemRanges)) {
|
||||
*it++ = range.index;
|
||||
*it++ = range.index + range.count;
|
||||
}
|
||||
|
||||
const QVector<int>::iterator middle = it;
|
||||
|
||||
for (const KItemRange &range : qAsConst(other.m_itemRanges)) {
|
||||
for (const KItemRange &range : std::as_const(other.m_itemRanges)) {
|
||||
*it++ = range.index;
|
||||
*it++ = range.index + range.count;
|
||||
}
|
||||
|
|
|
@ -1278,7 +1278,7 @@ void KStandardItemListWidget::updateIconsLayoutTextCache()
|
|||
|
||||
// Calculate the position for each additional information
|
||||
qreal y = nameTextInfo->pos.y() + nameHeight;
|
||||
for (const QByteArray &role : qAsConst(m_sortedVisibleRoles)) {
|
||||
for (const QByteArray &role : std::as_const(m_sortedVisibleRoles)) {
|
||||
if (role == "text") {
|
||||
continue;
|
||||
}
|
||||
|
@ -1344,7 +1344,7 @@ void KStandardItemListWidget::updateCompactLayoutTextCache()
|
|||
const qreal x = option.padding * 3 + iconSize();
|
||||
qreal y = qRound((widgetHeight - textLinesHeight) / 2);
|
||||
const qreal maxWidth = size().width() - x - option.padding;
|
||||
for (const QByteArray &role : qAsConst(m_sortedVisibleRoles)) {
|
||||
for (const QByteArray &role : std::as_const(m_sortedVisibleRoles)) {
|
||||
const QString text = roleText(role, values);
|
||||
TextInfo *textInfo = m_textInfo.value(role);
|
||||
textInfo->staticText.setText(text);
|
||||
|
@ -1394,7 +1394,7 @@ void KStandardItemListWidget::updateDetailsLayoutTextCache()
|
|||
qreal x = firstColumnInc;
|
||||
const qreal y = qMax(qreal(option.padding), (widgetHeight - fontHeight) / 2);
|
||||
|
||||
for (const QByteArray &role : qAsConst(m_sortedVisibleRoles)) {
|
||||
for (const QByteArray &role : std::as_const(m_sortedVisibleRoles)) {
|
||||
QString text = roleText(role, values);
|
||||
|
||||
// Elide the text in case it does not fit into the available column-width
|
||||
|
|
|
@ -166,7 +166,7 @@ void KDirectoryContentsCounter::slotItemsRemoved()
|
|||
if (!m_watchedDirs.isEmpty()) {
|
||||
// Don't let KDirWatch watch for removed items
|
||||
if (allItemsRemoved) {
|
||||
for (const QString &path : qAsConst(m_watchedDirs)) {
|
||||
for (const QString &path : std::as_const(m_watchedDirs)) {
|
||||
m_dirWatcher->removeDir(path);
|
||||
}
|
||||
m_watchedDirs.clear();
|
||||
|
|
|
@ -167,7 +167,7 @@ void KItemListHeaderWidget::paint(QPainter *painter, const QStyleOptionGraphicsI
|
|||
|
||||
qreal x = -m_offset + m_sidePadding;
|
||||
int orderIndex = 0;
|
||||
for (const QByteArray &role : qAsConst(m_columns)) {
|
||||
for (const QByteArray &role : std::as_const(m_columns)) {
|
||||
const qreal roleWidth = m_columnWidths.value(role);
|
||||
const QRectF rect(x, 0, roleWidth, size().height());
|
||||
paintRole(painter, role, rect, orderIndex, widget);
|
||||
|
@ -507,7 +507,7 @@ int KItemListHeaderWidget::roleIndexAt(const QPointF &pos) const
|
|||
int index = -1;
|
||||
|
||||
qreal x = -m_offset + m_sidePadding;
|
||||
for (const QByteArray &role : qAsConst(m_columns)) {
|
||||
for (const QByteArray &role : std::as_const(m_columns)) {
|
||||
++index;
|
||||
x += m_columnWidths.value(role);
|
||||
if (pos.x() <= x) {
|
||||
|
@ -540,7 +540,7 @@ bool KItemListHeaderWidget::isAbovePaddingGrip(const QPointF &pos, PaddingGrip p
|
|||
return pos.x() >= (lx - grip) && pos.x() <= lx;
|
||||
case Trailing: {
|
||||
qreal rx = lx;
|
||||
for (const QByteArray &role : qAsConst(m_columns)) {
|
||||
for (const QByteArray &role : std::as_const(m_columns)) {
|
||||
rx += m_columnWidths.value(role);
|
||||
}
|
||||
return pos.x() >= (rx - grip) && pos.x() <= rx;
|
||||
|
@ -604,7 +604,7 @@ int KItemListHeaderWidget::targetOfMovingRole() const
|
|||
qreal KItemListHeaderWidget::roleXPosition(const QByteArray &role) const
|
||||
{
|
||||
qreal x = -m_offset + m_sidePadding;
|
||||
for (const QByteArray &visibleRole : qAsConst(m_columns)) {
|
||||
for (const QByteArray &visibleRole : std::as_const(m_columns)) {
|
||||
if (visibleRole == role) {
|
||||
return x;
|
||||
}
|
||||
|
|
|
@ -282,7 +282,7 @@ void DolphinFacetsWidget::updateTagsMenuItems(const QUrl &, const KFileItemList
|
|||
|
||||
const bool onlyOneTag = allTags.count() == 1;
|
||||
|
||||
for (const QString &tagName : qAsConst(allTags)) {
|
||||
for (const QString &tagName : std::as_const(allTags)) {
|
||||
QAction *action = tagsMenu->addAction(QIcon::fromTheme(QStringLiteral("tag")), tagName);
|
||||
action->setCheckable(true);
|
||||
action->setChecked(m_searchTags.contains(tagName));
|
||||
|
|
|
@ -285,7 +285,7 @@ void ContextMenuSettingsPage::loadServices()
|
|||
const auto locations = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kio/servicemenus"), QStandardPaths::LocateDirectory);
|
||||
QStringList files = KFileUtils::findAllUniqueFiles(locations);
|
||||
|
||||
for (const auto &file : qAsConst(files)) {
|
||||
for (const auto &file : std::as_const(files)) {
|
||||
const QList<KServiceAction> serviceActions = KDesktopFileActions::userDefinedServices(KService(file), true);
|
||||
|
||||
const KDesktopFile desktopFile(file);
|
||||
|
|
|
@ -172,7 +172,7 @@ void runUncompress(const QString &inputPath, const QString &outputPath)
|
|||
const auto mime = QMimeDatabase().mimeTypeForFile(inputPath).name();
|
||||
|
||||
UncompressCommand command{};
|
||||
for (const auto &pair : qAsConst(mimeTypeToCommand)) {
|
||||
for (const auto &pair : std::as_const(mimeTypeToCommand)) {
|
||||
if (pair.first.contains(mime)) {
|
||||
command = pair.second;
|
||||
break;
|
||||
|
|
|
@ -129,7 +129,7 @@ void DolphinSettingsDialog::enableApply()
|
|||
|
||||
void DolphinSettingsDialog::applySettings()
|
||||
{
|
||||
for (SettingsPageBase *page : qAsConst(m_pages)) {
|
||||
for (SettingsPageBase *page : std::as_const(m_pages)) {
|
||||
page->applySettings();
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ void DolphinSettingsDialog::applySettings()
|
|||
|
||||
void DolphinSettingsDialog::restoreDefaults()
|
||||
{
|
||||
for (SettingsPageBase *page : qAsConst(m_pages)) {
|
||||
for (SettingsPageBase *page : std::as_const(m_pages)) {
|
||||
page->restoreDefaults();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,14 +59,14 @@ InterfaceSettingsPage::~InterfaceSettingsPage()
|
|||
|
||||
void InterfaceSettingsPage::applySettings()
|
||||
{
|
||||
for (SettingsPageBase *page : qAsConst(m_pages)) {
|
||||
for (SettingsPageBase *page : std::as_const(m_pages)) {
|
||||
page->applySettings();
|
||||
}
|
||||
}
|
||||
|
||||
void InterfaceSettingsPage::restoreDefaults()
|
||||
{
|
||||
for (SettingsPageBase *page : qAsConst(m_pages)) {
|
||||
for (SettingsPageBase *page : std::as_const(m_pages)) {
|
||||
page->restoreDefaults();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,14 +58,14 @@ DolphinGeneralConfigModule::~DolphinGeneralConfigModule()
|
|||
|
||||
void DolphinGeneralConfigModule::save()
|
||||
{
|
||||
for (SettingsPageBase *page : qAsConst(m_pages)) {
|
||||
for (SettingsPageBase *page : std::as_const(m_pages)) {
|
||||
page->applySettings();
|
||||
}
|
||||
}
|
||||
|
||||
void DolphinGeneralConfigModule::defaults()
|
||||
{
|
||||
for (SettingsPageBase *page : qAsConst(m_pages)) {
|
||||
for (SettingsPageBase *page : std::as_const(m_pages)) {
|
||||
page->applySettings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ DolphinViewModesConfigModule::~DolphinViewModesConfigModule()
|
|||
|
||||
void DolphinViewModesConfigModule::save()
|
||||
{
|
||||
for (ViewSettingsTab *tab : qAsConst(m_tabs)) {
|
||||
for (ViewSettingsTab *tab : std::as_const(m_tabs)) {
|
||||
tab->applySettings();
|
||||
}
|
||||
reparseConfiguration();
|
||||
|
@ -67,7 +67,7 @@ void DolphinViewModesConfigModule::save()
|
|||
|
||||
void DolphinViewModesConfigModule::defaults()
|
||||
{
|
||||
for (ViewSettingsTab *tab : qAsConst(m_tabs)) {
|
||||
for (ViewSettingsTab *tab : std::as_const(m_tabs)) {
|
||||
tab->restoreDefaults();
|
||||
}
|
||||
reparseConfiguration();
|
||||
|
|
|
@ -65,14 +65,14 @@ ViewSettingsPage::~ViewSettingsPage()
|
|||
|
||||
void ViewSettingsPage::applySettings()
|
||||
{
|
||||
for (SettingsPageBase *tab : qAsConst(m_tabs)) {
|
||||
for (SettingsPageBase *tab : std::as_const(m_tabs)) {
|
||||
tab->applySettings();
|
||||
}
|
||||
}
|
||||
|
||||
void ViewSettingsPage::restoreDefaults()
|
||||
{
|
||||
for (SettingsPageBase *tab : qAsConst(m_tabs)) {
|
||||
for (SettingsPageBase *tab : std::as_const(m_tabs)) {
|
||||
if (tabWidget->currentWidget() == tab) {
|
||||
tab->restoreDefaults();
|
||||
return;
|
||||
|
|
|
@ -74,7 +74,7 @@ void KFileItemModelBenchmark::insertAndRemoveManyItems_data()
|
|||
QList<int> sizes;
|
||||
sizes << 100000;
|
||||
|
||||
for (int n : qAsConst(sizes)) {
|
||||
for (int n : std::as_const(sizes)) {
|
||||
QStringList allStrings;
|
||||
for (int i = 0; i < n; ++i) {
|
||||
allStrings << QString::number(i);
|
||||
|
|
|
@ -292,9 +292,9 @@ void KItemListControllerTest::testKeyboardNavigation_data()
|
|||
break;
|
||||
}
|
||||
|
||||
for (int columnCount : qAsConst(columnCountList)) {
|
||||
for (const KItemListController::SelectionBehavior &selectionBehavior : qAsConst(selectionBehaviorList)) {
|
||||
for (bool groupingEnabled : qAsConst(groupingEnabledList)) {
|
||||
for (int columnCount : std::as_const(columnCountList)) {
|
||||
for (const KItemListController::SelectionBehavior &selectionBehavior : std::as_const(selectionBehaviorList)) {
|
||||
for (bool groupingEnabled : std::as_const(groupingEnabledList)) {
|
||||
QList<QPair<KeyPress, ViewState>> testList;
|
||||
|
||||
// First, key presses which should have the same effect
|
||||
|
|
|
@ -66,11 +66,11 @@ static QSet<int> KItemSet2QSet(const KItemSet &itemSet)
|
|||
// Check that the conversion was successful.
|
||||
Q_ASSERT(itemSet.count() == result.count());
|
||||
|
||||
for (int i : qAsConst(itemSet)) {
|
||||
for (int i : std::as_const(itemSet)) {
|
||||
Q_ASSERT(result.contains(i));
|
||||
}
|
||||
|
||||
for (int i : qAsConst(result)) {
|
||||
for (int i : std::as_const(result)) {
|
||||
Q_ASSERT(itemSet.contains(i));
|
||||
}
|
||||
|
||||
|
|
|
@ -714,7 +714,7 @@ void DolphinViewActionHandler::slotSortTriggered(QAction *action)
|
|||
// actions and the sub-menu-actions. If an action gets checked, it must
|
||||
// be assured that all other actions get unchecked, except the ascending/
|
||||
// descending actions
|
||||
for (QAction *groupAction : qAsConst(m_sortByActions)) {
|
||||
for (QAction *groupAction : std::as_const(m_sortByActions)) {
|
||||
KActionMenu *actionMenu = qobject_cast<KActionMenu *>(groupAction);
|
||||
if (actionMenu) {
|
||||
const auto actions = actionMenu->menu()->actions();
|
||||
|
|
|
@ -105,7 +105,7 @@ QList<QAction *> VersionControlObserver::actions(const KFileItemList &items) con
|
|||
return m_plugin->versionControlActions(items);
|
||||
} else {
|
||||
QList<QAction *> actions;
|
||||
for (const QPointer<KVersionControlPlugin> &plugin : qAsConst(m_plugins)) {
|
||||
for (const QPointer<KVersionControlPlugin> &plugin : std::as_const(m_plugins)) {
|
||||
actions << plugin->outOfVersionControlActions(items);
|
||||
}
|
||||
return actions;
|
||||
|
@ -283,7 +283,7 @@ void VersionControlObserver::initPlugins()
|
|||
}
|
||||
}
|
||||
|
||||
for (auto &plugin : qAsConst(m_plugins)) {
|
||||
for (auto &plugin : std::as_const(m_plugins)) {
|
||||
connect(plugin, &KVersionControlPlugin::itemVersionsChanged, this, &VersionControlObserver::silentDirectoryVerification);
|
||||
connect(plugin, &KVersionControlPlugin::infoMessage, this, &VersionControlObserver::infoMessage);
|
||||
connect(plugin, &KVersionControlPlugin::errorMessage, this, &VersionControlObserver::errorMessage);
|
||||
|
@ -299,7 +299,7 @@ KVersionControlPlugin *VersionControlObserver::searchPlugin(const QUrl &director
|
|||
initPlugins();
|
||||
|
||||
// Verify whether the current directory is under a version system
|
||||
for (const QPointer<KVersionControlPlugin> &plugin : qAsConst(m_plugins)) {
|
||||
for (const QPointer<KVersionControlPlugin> &plugin : std::as_const(m_plugins)) {
|
||||
if (!plugin) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user