Replace complicated QPair type with custom LvmPV class.
This commit is contained in:
parent
b2520a8dc6
commit
97aedd1806
|
@ -27,7 +27,7 @@
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KSharedConfig>
|
#include <KSharedConfig>
|
||||||
|
|
||||||
CreateVolumeGroupDialog::CreateVolumeGroupDialog(QWidget* parent, QString& vgName, QList<const Partition*>& pvList, qint32& peSize, FS::lvm2_pv::PhysicalVolumes physicalVolumes, QList<Device*> devices)
|
CreateVolumeGroupDialog::CreateVolumeGroupDialog(QWidget* parent, QString& vgName, QList<const Partition*>& pvList, qint32& peSize, QList<LvmPV> physicalVolumes, QList<Device*> devices)
|
||||||
: VolumeGroupDialog(parent, vgName, pvList)
|
: VolumeGroupDialog(parent, vgName, pvList)
|
||||||
, m_PESize(peSize)
|
, m_PESize(peSize)
|
||||||
, m_PhysicalVolumes(physicalVolumes)
|
, m_PhysicalVolumes(physicalVolumes)
|
||||||
|
@ -49,8 +49,8 @@ CreateVolumeGroupDialog::CreateVolumeGroupDialog(QWidget* parent, QString& vgNam
|
||||||
void CreateVolumeGroupDialog::setupDialog()
|
void CreateVolumeGroupDialog::setupDialog()
|
||||||
{
|
{
|
||||||
for (const auto &p : m_PhysicalVolumes)
|
for (const auto &p : m_PhysicalVolumes)
|
||||||
if (p.first == QString() && !LvmDevice::s_DirtyPVs.contains(p.second))
|
if (p.vgName() == QString() && !LvmDevice::s_DirtyPVs.contains(p.partition()))
|
||||||
dialogWidget().listPV().addPartition(*p.second, false);
|
dialogWidget().listPV().addPartition(*p.partition(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateVolumeGroupDialog::setupConnections()
|
void CreateVolumeGroupDialog::setupConnections()
|
||||||
|
|
|
@ -31,7 +31,7 @@ class CreateVolumeGroupDialog : public VolumeGroupDialog
|
||||||
Q_DISABLE_COPY(CreateVolumeGroupDialog)
|
Q_DISABLE_COPY(CreateVolumeGroupDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CreateVolumeGroupDialog(QWidget* parent, QString& vgName, QList<const Partition*>& pvList, qint32& peSize, FS::lvm2_pv::PhysicalVolumes physicalVolumes, QList<Device*> devices);
|
CreateVolumeGroupDialog(QWidget* parent, QString& vgName, QList<const Partition*>& pvList, qint32& peSize, QList<LvmPV> physicalVolumes, QList<Device*> devices);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void accept() override;
|
void accept() override;
|
||||||
|
@ -49,7 +49,7 @@ protected:
|
||||||
qint32& m_PESize;
|
qint32& m_PESize;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const FS::lvm2_pv::PhysicalVolumes m_PhysicalVolumes; // List of all LVM Physical Volumes found on the system
|
const QList<LvmPV> m_PhysicalVolumes; // List of all LVM Physical Volumes found on the system
|
||||||
const QList<Device*> m_Devices; // List of all devices found on the system
|
const QList<Device*> m_Devices; // List of all devices found on the system
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
@param parent pointer to the parent widget
|
@param parent pointer to the parent widget
|
||||||
@param d the Device to show properties for
|
@param d the Device to show properties for
|
||||||
*/
|
*/
|
||||||
ResizeVolumeGroupDialog::ResizeVolumeGroupDialog(QWidget* parent, VolumeManagerDevice* d, QList<const Partition*>& partList, FS::lvm2_pv::PhysicalVolumes physicalVolumes)
|
ResizeVolumeGroupDialog::ResizeVolumeGroupDialog(QWidget* parent, VolumeManagerDevice* d, QList<const Partition*>& partList, QList<LvmPV> physicalVolumes)
|
||||||
: VolumeGroupDialog(parent, d->name(), partList)
|
: VolumeGroupDialog(parent, d->name(), partList)
|
||||||
, m_Device(d)
|
, m_Device(d)
|
||||||
, m_PhysicalVolumes(physicalVolumes)
|
, m_PhysicalVolumes(physicalVolumes)
|
||||||
|
@ -52,10 +52,10 @@ void ResizeVolumeGroupDialog::setupDialog()
|
||||||
{
|
{
|
||||||
if (dialogWidget().volumeType().currentText() == QStringLiteral("LVM")) {
|
if (dialogWidget().volumeType().currentText() == QStringLiteral("LVM")) {
|
||||||
for (const auto &p : m_PhysicalVolumes) {
|
for (const auto &p : m_PhysicalVolumes) {
|
||||||
if (p.first == device()->name())
|
if (p.vgName() == device()->name())
|
||||||
dialogWidget().listPV().addPartition(*p.second, true);
|
dialogWidget().listPV().addPartition(*p.partition(), true);
|
||||||
else if (p.first == QString() && !LvmDevice::s_DirtyPVs.contains(p.second)) // TODO: Remove LVM PVs in current VG
|
else if (p.vgName() == QString() && !LvmDevice::s_DirtyPVs.contains(p.partition())) // TODO: Remove LVM PVs in current VG
|
||||||
dialogWidget().listPV().addPartition(*p.second, false);
|
dialogWidget().listPV().addPartition(*p.partition(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ class ResizeVolumeGroupDialog : public VolumeGroupDialog
|
||||||
Q_DISABLE_COPY(ResizeVolumeGroupDialog)
|
Q_DISABLE_COPY(ResizeVolumeGroupDialog)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ResizeVolumeGroupDialog(QWidget* parent, VolumeManagerDevice *d, QList<const Partition*>& partList, FS::lvm2_pv::PhysicalVolumes physicalVolumes);
|
ResizeVolumeGroupDialog(QWidget* parent, VolumeManagerDevice *d, QList<const Partition*>& partList, QList<LvmPV> physicalVolumes);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void accept() override;
|
void accept() override;
|
||||||
|
@ -44,7 +44,7 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
VolumeManagerDevice* m_Device;
|
VolumeManagerDevice* m_Device;
|
||||||
const FS::lvm2_pv::PhysicalVolumes m_PhysicalVolumes; // List of all devices found on the system
|
const QList<LvmPV> m_PhysicalVolumes; // List of all devices found on the system
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue