Only look for a separate /home partition if a partition was found.

This commit is contained in:
Teo Mrnjavac 2016-07-20 17:06:14 +02:00
parent d65df112dd
commit aaf85407fb

View File

@ -670,12 +670,6 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
m_core->revertDevice( selectedDevice() );
}
// Find out is the selected partition has a rootfs. If yes, then make the
// m_reuseHomeCheckBox visible and set its text to something meaningful.
homePartitionPath = current.data( PartitionModel::OsproberHomePartitionPathRole ).toString();
if ( homePartitionPath.isEmpty() )
doReuseHomePartition = false;
// if the partition is unallocated(free space), we don't replace it but create new one
// with the same first and last sector
Partition* selectedPartition =
@ -736,6 +730,15 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
partPath );
if ( selectedPartition )
{
// Find out is the selected partition has a rootfs. If yes, then make the
// m_reuseHomeCheckBox visible and set its text to something meaningful.
homePartitionPath.clear();
foreach ( const OsproberEntry& osproberEntry, m_core->osproberEntries() )
if ( osproberEntry.path == partPath )
homePartitionPath = osproberEntry.homePath;
if ( homePartitionPath.isEmpty() )
doReuseHomePartition = false;
PartitionActions::doReplacePartition( m_core,
selectedDevice(),
selectedPartition,