Port away from qAsConst.
This commit is contained in:
parent
7d515e43bf
commit
cd10b5ba2c
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2010 Volker Lanz <vl@fidra.de>
|
||||
SPDX-FileCopyrightText: 2014-2018 Andrius Štikonas <andrius@stikonas.eu>
|
||||
SPDX-FileCopyrightText: 2014-2020 Andrius Štikonas <andrius@stikonas.eu>
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
@ -13,6 +13,8 @@
|
|||
#include <util/helpers.h>
|
||||
#include "util/guihelpers.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <config.h>
|
||||
|
||||
GeneralPageWidget::GeneralPageWidget(QWidget* parent) :
|
||||
|
@ -42,7 +44,7 @@ void GeneralPageWidget::setupDialog()
|
|||
|
||||
std::sort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan);
|
||||
|
||||
for (const auto &fsName : qAsConst(fsNames))
|
||||
for (const auto &fsName : std::as_const(fsNames))
|
||||
comboDefaultFileSystem().addItem(createFileSystemColor(FileSystem::typeForName(fsName), 8), fsName);
|
||||
|
||||
setDefaultFileSystem(GuiHelpers::defaultFileSystem());
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2016 Chantara Tith <tith.chantara@gmail.com>
|
||||
SPDX-FileCopyrightText: 2016 Andrius Štikonas <andrius@stikonas.eu>
|
||||
SPDX-FileCopyrightText: 2016-2020 Andrius Štikonas <andrius@stikonas.eu>
|
||||
SPDX-FileCopyrightText: 2018 Caio Jordão Carvalho <caiojcarvalho@gmail.com>
|
||||
SPDX-FileCopyrightText: 2019 Yuri Chornoivan <yurchor@ukr.net>
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
|||
#include <util/capacity.h>
|
||||
#include <util/helpers.h>
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#include <KConfigGroup>
|
||||
|
@ -48,11 +50,11 @@ CreateVolumeGroupDialog::CreateVolumeGroupDialog(QWidget* parent, QString& vgNam
|
|||
|
||||
void CreateVolumeGroupDialog::setupDialog()
|
||||
{
|
||||
for (const auto &p : qAsConst(LVM::pvList::list())) {
|
||||
for (const auto &p : std::as_const(LVM::pvList::list())) {
|
||||
bool toBeDeleted = false;
|
||||
|
||||
// Ignore partitions that are going to be deleted
|
||||
for (const auto &o : qAsConst(m_PendingOps)) {
|
||||
for (const auto &o : std::as_const(m_PendingOps)) {
|
||||
if (dynamic_cast<DeleteOperation *>(o) && o->targets(*p.partition())) {
|
||||
toBeDeleted = true;
|
||||
break;
|
||||
|
@ -66,9 +68,9 @@ void CreateVolumeGroupDialog::setupDialog()
|
|||
dialogWidget().listPV().addPartition(*p.partition(), false);
|
||||
}
|
||||
|
||||
for (const Device *d : qAsConst(m_Devices)) {
|
||||
for (const Device *d : std::as_const(m_Devices)) {
|
||||
if (d->partitionTable() != nullptr) {
|
||||
for (const Partition *p : qAsConst(d->partitionTable()->children())) {
|
||||
for (const Partition *p : std::as_const(d->partitionTable()->children())) {
|
||||
// Looking if there is another VG creation that contains this partition
|
||||
if (LvmDevice::s_DirtyPVs.contains(p))
|
||||
continue;
|
||||
|
@ -88,7 +90,7 @@ void CreateVolumeGroupDialog::setupDialog()
|
|||
}
|
||||
}
|
||||
|
||||
for (const Partition *p : qAsConst(LvmDevice::s_OrphanPVs))
|
||||
for (const Partition *p : std::as_const(LvmDevice::s_OrphanPVs))
|
||||
if (!LvmDevice::s_DirtyPVs.contains(p))
|
||||
dialogWidget().listPV().addPartition(*p, false);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2008-2012 Volker Lanz <vl@fidra.de>
|
||||
SPDX-FileCopyrightText: 2013-2018 Andrius Štikonas <andrius@stikonas.eu>
|
||||
SPDX-FileCopyrightText: 2013-2020 Andrius Štikonas <andrius@stikonas.eu>
|
||||
SPDX-FileCopyrightText: 2015 Teo Mrnjavac <teo@kde.org>
|
||||
SPDX-FileCopyrightText: 2016 Chantara Tith <tith.chantara@gmail.com>
|
||||
SPDX-FileCopyrightText: 2018 Caio Jordão Carvalho <caiojcarvalho@gmail.com>
|
||||
|
@ -22,6 +22,8 @@
|
|||
#include <util/helpers.h>
|
||||
#include "util/guihelpers.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QFontDatabase>
|
||||
|
||||
|
@ -72,7 +74,7 @@ void NewDialog::setupDialog()
|
|||
|
||||
std::sort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan);
|
||||
|
||||
for (const auto &fsName : qAsConst(fsNames))
|
||||
for (const auto &fsName : std::as_const(fsNames))
|
||||
dialogWidget().comboFileSystem().addItem(createFileSystemColor(FileSystem::typeForName(fsName), 8), fsName);
|
||||
|
||||
QString selected = FileSystem::nameForType(GuiHelpers::defaultFileSystem());
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2008-2010 Volker Lanz <vl@fidra.de>
|
||||
SPDX-FileCopyrightText: 2014-2017 Andrius Štikonas <andrius@stikonas.eu>
|
||||
SPDX-FileCopyrightText: 2014-2020 Andrius Štikonas <andrius@stikonas.eu>
|
||||
SPDX-FileCopyrightText: 2014 Yuri Chornoivan <yurchor@ukr.net>
|
||||
SPDX-FileCopyrightText: 2018 Abhijeet Sharma <sharma.abhijeet2096@gmail.com>
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
|||
#include <util/helpers.h>
|
||||
#include "util/guihelpers.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QFontDatabase>
|
||||
#include <QtGlobal>
|
||||
|
@ -319,7 +321,7 @@ void PartPropsDialog::setupFileSystemComboBox()
|
|||
|
||||
std::sort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan);
|
||||
|
||||
for (const auto &fsName : qAsConst(fsNames))
|
||||
for (const auto &fsName : std::as_const(fsNames))
|
||||
dialogWidget().fileSystem().addItem(createFileSystemColor(FileSystem::typeForName(fsName), 8), fsName);
|
||||
|
||||
dialogWidget().fileSystem().setCurrentIndex(dialogWidget().fileSystem().findText(selected));
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2016 Chantara Tith <tith.chantara@gmail.com>
|
||||
SPDX-FileCopyrightText: 2016-2018 Andrius Štikonas <andrius@stikonas.eu>
|
||||
SPDX-FileCopyrightText: 2016-2020 Andrius Štikonas <andrius@stikonas.eu>
|
||||
SPDX-FileCopyrightText: 2018 Caio Jordão Carvalho <caiojcarvalho@gmail.com>
|
||||
SPDX-FileCopyrightText: 2019 Yuri Chornoivan <yurchor@ukr.net>
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
|||
#include <util/capacity.h>
|
||||
#include <util/helpers.h>
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <KConfigGroup>
|
||||
#include <KLocalizedString>
|
||||
#include <KSharedConfig>
|
||||
|
@ -46,11 +48,11 @@ ResizeVolumeGroupDialog::ResizeVolumeGroupDialog(QWidget* parent, VolumeManagerD
|
|||
void ResizeVolumeGroupDialog::setupDialog()
|
||||
{
|
||||
if (dialogWidget().volumeType().currentText() == QStringLiteral("LVM")) {
|
||||
for (const auto &p : qAsConst(LVM::pvList::list())) {
|
||||
for (const auto &p : std::as_const(LVM::pvList::list())) {
|
||||
bool toBeDeleted = false;
|
||||
|
||||
// Ignore partitions that are going to be deleted
|
||||
for (const auto &o : qAsConst(m_PendingOps)) {
|
||||
for (const auto &o : std::as_const(m_PendingOps)) {
|
||||
if (dynamic_cast<DeleteOperation *>(o) && o->targets(*p.partition())) {
|
||||
toBeDeleted = true;
|
||||
break;
|
||||
|
@ -68,9 +70,9 @@ void ResizeVolumeGroupDialog::setupDialog()
|
|||
dialogWidget().listPV().addPartition(*p.partition(), false);
|
||||
}
|
||||
|
||||
for (const Device *d : qAsConst(m_Devices)) {
|
||||
for (const Device *d : std::as_const(m_Devices)) {
|
||||
if (d->partitionTable() != nullptr) {
|
||||
for (const Partition *p : qAsConst(d->partitionTable()->children())) {
|
||||
for (const Partition *p : std::as_const(d->partitionTable()->children())) {
|
||||
// Looking if there is another VG creation that contains this partition
|
||||
if (LvmDevice::s_DirtyPVs.contains(p))
|
||||
continue;
|
||||
|
@ -90,7 +92,7 @@ void ResizeVolumeGroupDialog::setupDialog()
|
|||
}
|
||||
}
|
||||
|
||||
for (const Partition *p : qAsConst(LvmDevice::s_OrphanPVs))
|
||||
for (const Partition *p : std::as_const(LvmDevice::s_OrphanPVs))
|
||||
if (!LvmDevice::s_DirtyPVs.contains(p))
|
||||
dialogWidget().listPV().addPartition(*p, false);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue