diff --git a/src/core/devicescanner.cpp b/src/core/devicescanner.cpp index c34caf0..dce2d58 100644 --- a/src/core/devicescanner.cpp +++ b/src/core/devicescanner.cpp @@ -66,7 +66,7 @@ void DeviceScanner::scan() const QList deviceList = CoreBackendManager::self()->backend()->scanDevices(); const QList lvmList = LvmDevice::scanSystemLVM(); - operationStack().physicalVolumes() = FS::lvm2_pv::getPVs(deviceList); + LVM::pvList = FS::lvm2_pv::getPVs(deviceList); for (const auto &d : deviceList) operationStack().addDevice(d); @@ -75,12 +75,12 @@ void DeviceScanner::scan() for (const auto &d : lvmList) { operationStack().addDevice(d); - operationStack().physicalVolumes().append(FS::lvm2_pv::getPVinNode(d->partitionTable())); + LVM::pvList.append(FS::lvm2_pv::getPVinNode(d->partitionTable())); } // Store list of physical volumes in LvmDevice for (const auto &d : lvmList) - for (const auto &p : operationStack().physicalVolumes()) + for (const auto &p : LVM::pvList) // FIXME: qAsConst if (p.vgName() == d->name()) d->physicalVolumes().append(p.partition()); } diff --git a/src/core/operationstack.h b/src/core/operationstack.h index 211e404..b6fbfac 100644 --- a/src/core/operationstack.h +++ b/src/core/operationstack.h @@ -19,7 +19,6 @@ #define OPERATIONSTACK__H -#include "fs/lvm2_pv.h" #include "util/libpartitionmanagerexport.h" #include @@ -75,13 +74,6 @@ public: return m_PreviewDevices; /**< @return the list of Devices */ } - QList& physicalVolumes() { - return m_LVMPhysicalVolumes; /**< @return the list of LVM PVs */ - } - const QList& physicalVolumes() const { - return m_LVMPhysicalVolumes; /**< @return the list of LVM PVs */ - } - Operations& operations() { return m_Operations; /**< @return the list of operations */ } @@ -110,7 +102,6 @@ protected: private: Operations m_Operations; mutable Devices m_PreviewDevices; - mutable QList m_LVMPhysicalVolumes; QReadWriteLock m_Lock; }; diff --git a/src/fs/lvm2_pv.cpp b/src/fs/lvm2_pv.cpp index 19fdd28..9e67ec7 100644 --- a/src/fs/lvm2_pv.cpp +++ b/src/fs/lvm2_pv.cpp @@ -289,6 +289,8 @@ QList lvm2_pv::getPVs(const QList& devices) } +QList LVM::pvList; + LvmPV::LvmPV(const QString vgName, const Partition* p, bool isLuks) : m_vgName(vgName) , m_p(p) diff --git a/src/fs/lvm2_pv.h b/src/fs/lvm2_pv.h index 0e62223..ba3ef77 100644 --- a/src/fs/lvm2_pv.h +++ b/src/fs/lvm2_pv.h @@ -57,6 +57,9 @@ private: bool m_isLuks; }; +namespace LVM { + extern LIBKPMCORE_EXPORT QList pvList; +} namespace FS {