mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 01:15:38 -04:00
Use PMUtils::findPartitionByPath in PVS + fix back button in Alongside.
This commit is contained in:
parent
2347ead200
commit
08a2ab94e7
1 changed files with 24 additions and 31 deletions
|
@ -21,6 +21,7 @@
|
|||
#include <core/DeviceModel.h>
|
||||
#include <core/PartitionCoreModule.h>
|
||||
#include <core/PartitionModel.h>
|
||||
#include <core/PMUtils.h>
|
||||
#include "core/partition.h"
|
||||
#include "core/device.h"
|
||||
#include <gui/ChoicePage.h>
|
||||
|
@ -113,6 +114,7 @@ PartitionViewStep::PartitionViewStep( QObject* parent )
|
|||
|
||||
m_widget->addWidget( m_choicePage );
|
||||
m_widget->addWidget( m_manualPartitionPage );
|
||||
m_widget->addWidget( m_alongsidePage );
|
||||
m_widget->addWidget( m_erasePage );
|
||||
m_widget->removeWidget( waitingWidget );
|
||||
waitingWidget->deleteLater();
|
||||
|
@ -240,7 +242,8 @@ bool
|
|||
PartitionViewStep::isAtBeginning() const
|
||||
{
|
||||
if ( m_widget->currentWidget() == m_manualPartitionPage ||
|
||||
m_widget->currentWidget() == m_erasePage )
|
||||
m_widget->currentWidget() == m_erasePage ||
|
||||
m_widget->currentWidget() == m_alongsidePage )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
@ -275,12 +278,8 @@ PartitionViewStep::canBeResized( const QString& partitionPath )
|
|||
for ( int i = 0; i < dm->rowCount(); ++i )
|
||||
{
|
||||
Device* dev = dm->deviceForIndex( dm->index( i ) );
|
||||
PartitionModel* pm = m_core->partitionModelForDevice( dev );
|
||||
for ( int j = 0; j < pm->rowCount(); ++j )
|
||||
{
|
||||
QModelIndex index = pm->index( j, 0 );
|
||||
Partition* candidate = pm->partitionForIndex( index );
|
||||
if ( candidate->partitionPath() == partitionWithOs )
|
||||
Partition* candidate = PMUtils::findPartitionByPath( { dev }, partitionWithOs );
|
||||
if ( candidate )
|
||||
{
|
||||
cDebug() << "found Partition* for" << partitionWithOs;
|
||||
bool ok = false;
|
||||
|
@ -299,18 +298,12 @@ PartitionViewStep::canBeResized( const QString& partitionPath )
|
|||
if ( ok &&
|
||||
availableStorageB > requiredStorageB )
|
||||
{
|
||||
canResize = true;
|
||||
}
|
||||
}
|
||||
if ( canResize )
|
||||
break;
|
||||
}
|
||||
if ( canResize )
|
||||
break;
|
||||
}
|
||||
|
||||
cDebug() << "Partition" << partitionWithOs << "authorized for resize + autopartition install.";
|
||||
return canResize;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cDebug() << "Partition" << partitionWithOs << "CANNOT BE RESIZED FOR AUTOINSTALL.";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue