Select partition to replace from the current DeviceModel.
This commit is contained in:
parent
5655b4f1da
commit
b767f0b18f
@ -36,6 +36,7 @@
|
|||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Retranslator.h"
|
#include "utils/Retranslator.h"
|
||||||
#include "Branding.h"
|
#include "Branding.h"
|
||||||
|
#include "core/KPMHelpers.h"
|
||||||
|
|
||||||
#include <kpmcore/core/device.h>
|
#include <kpmcore/core/device.h>
|
||||||
|
|
||||||
@ -438,9 +439,15 @@ ChoicePage::applyActionChoice( Device* currentDevice, ChoicePage::Choice choice
|
|||||||
if ( m_core->isDirty() )
|
if ( m_core->isDirty() )
|
||||||
m_core->clearJobs();
|
m_core->clearJobs();
|
||||||
|
|
||||||
|
// We can't use the PartitionPtrRole because we need to make changes to the
|
||||||
|
// main DeviceModel, not the immutable copy.
|
||||||
|
QString partPath = current.data( PartitionModel::PartitionPathRole ).toString();
|
||||||
|
Partition* partition = KPMHelpers::findPartitionByPath( { selectedDevice() },
|
||||||
|
partPath );
|
||||||
|
if ( partition )
|
||||||
PartitionActions::doReplacePartition( m_core,
|
PartitionActions::doReplacePartition( m_core,
|
||||||
selectedDevice(),
|
selectedDevice(),
|
||||||
( Partition* )( current.data( PartitionModel::PartitionPtrRole ).value< void* >() ) );
|
partition );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
case NoChoice:
|
case NoChoice:
|
||||||
|
Loading…
Reference in New Issue
Block a user