diff --git a/src/modules/partition/jobs/ClearMountsJob.cpp b/src/modules/partition/jobs/ClearMountsJob.cpp index 4bab3b0ae..dfca20718 100644 --- a/src/modules/partition/jobs/ClearMountsJob.cpp +++ b/src/modules/partition/jobs/ClearMountsJob.cpp @@ -277,20 +277,20 @@ stringify( const QList< MessageAndPath >& news ) ClearMountsJob::ClearMountsJob( Device* device ) : Calamares::Job() - , m_device( device ) + , m_deviceNode( device->deviceNode() ) { } QString ClearMountsJob::prettyName() const { - return tr( "Clear mounts for partitioning operations on %1" ).arg( m_device->deviceNode() ); + return tr( "Clear mounts for partitioning operations on %1" ).arg( m_deviceNode ); } QString ClearMountsJob::prettyStatusMessage() const { - return tr( "Clearing mounts for partitioning operations on %1." ).arg( m_device->deviceNode() ); + return tr( "Clearing mounts for partitioning operations on %1." ).arg( m_deviceNode ); } Calamares::JobResult @@ -298,13 +298,13 @@ ClearMountsJob::exec() { CalamaresUtils::Partition::Syncer s; - QString deviceName = m_device->deviceNode().split( '/' ).last(); + const QString deviceName = m_deviceNode.split( '/' ).last(); QList< MessageAndPath > goodNews; QProcess process; const QStringList partitionsList = getPartitionsForDevice( deviceName ); - const QStringList swapPartitions = getSwapsForDevice( m_device->deviceNode() ); + const QStringList swapPartitions = getSwapsForDevice( m_deviceNode ); apply( getCryptoDevices(), tryCryptoClose, goodNews ); @@ -377,7 +377,7 @@ ClearMountsJob::exec() apply( swapPartitions, tryClearSwap, goodNews ); Calamares::JobResult ok = Calamares::JobResult::ok(); - ok.setMessage( tr( "Cleared all mounts for %1" ).arg( m_device->deviceNode() ) ); + ok.setMessage( tr( "Cleared all mounts for %1" ).arg( m_deviceNode ) ); ok.setDetails( stringify( goodNews ).join( "\n" ) ); cDebug() << "ClearMountsJob finished. Here's what was done:" << Logger::DebugListT< MessageAndPath >( goodNews ); diff --git a/src/modules/partition/jobs/ClearMountsJob.h b/src/modules/partition/jobs/ClearMountsJob.h index 070e06c30..f0ef3e104 100644 --- a/src/modules/partition/jobs/ClearMountsJob.h +++ b/src/modules/partition/jobs/ClearMountsJob.h @@ -22,13 +22,21 @@ class ClearMountsJob : public Calamares::Job { Q_OBJECT public: + /** @brief Creates a job freeing mounts on @p device + * + * All /dev/mapper entries are closed, regardless of device. + * + * No ownership is transferred; the @p device is used only to access + * the device node (name). + */ explicit ClearMountsJob( Device* device ); + QString prettyName() const override; QString prettyStatusMessage() const override; Calamares::JobResult exec() override; private: - Device* m_device; + const QString m_deviceNode; }; #endif // CLEARMOUNTSJOB_H