mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
[partition] Make new partition flags explicit
Suggested by aliveafter1000: having a default value, and then filling in the default in one place it is used and not others, is weird. Instead of dropping the one use, remove the default value: partition flags are important enough to be explicit.
This commit is contained in:
parent
6ae7a6b470
commit
8144295e98
4 changed files with 33 additions and 13 deletions
|
@ -89,7 +89,7 @@ Partition* createNewPartition( PartitionNode* parent,
|
||||||
FileSystem::Type fsType,
|
FileSystem::Type fsType,
|
||||||
qint64 firstSector,
|
qint64 firstSector,
|
||||||
qint64 lastSector,
|
qint64 lastSector,
|
||||||
PartitionTable::Flags flags = PartitionTable::FlagNone );
|
PartitionTable::Flags flags );
|
||||||
|
|
||||||
Partition* createNewEncryptedPartition( PartitionNode* parent,
|
Partition* createNewEncryptedPartition( PartitionNode* parent,
|
||||||
const Device& device,
|
const Device& device,
|
||||||
|
@ -98,7 +98,7 @@ Partition* createNewEncryptedPartition( PartitionNode* parent,
|
||||||
qint64 firstSector,
|
qint64 firstSector,
|
||||||
qint64 lastSector,
|
qint64 lastSector,
|
||||||
const QString& passphrase,
|
const QString& passphrase,
|
||||||
PartitionTable::Flags flags = PartitionTable::FlagNone );
|
PartitionTable::Flags flags );
|
||||||
|
|
||||||
Partition* clonePartition( Device* device, Partition* partition );
|
Partition* clonePartition( Device* device, Partition* partition );
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,8 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||||
PartitionRole( PartitionRole::Primary ),
|
PartitionRole( PartitionRole::Primary ),
|
||||||
FileSystem::typeForName( defaultFsType ),
|
FileSystem::typeForName( defaultFsType ),
|
||||||
firstFreeSector,
|
firstFreeSector,
|
||||||
lastSectorForRoot
|
lastSectorForRoot,
|
||||||
|
PartitionTable::FlagNone
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -216,7 +217,8 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||||
FileSystem::typeForName( defaultFsType ),
|
FileSystem::typeForName( defaultFsType ),
|
||||||
firstFreeSector,
|
firstFreeSector,
|
||||||
lastSectorForRoot,
|
lastSectorForRoot,
|
||||||
luksPassphrase
|
luksPassphrase,
|
||||||
|
PartitionTable::FlagNone
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
PartitionInfo::setFormat( rootPartition, true );
|
PartitionInfo::setFormat( rootPartition, true );
|
||||||
|
@ -234,7 +236,8 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||||
PartitionRole( PartitionRole::Primary ),
|
PartitionRole( PartitionRole::Primary ),
|
||||||
FileSystem::LinuxSwap,
|
FileSystem::LinuxSwap,
|
||||||
lastSectorForRoot + 1,
|
lastSectorForRoot + 1,
|
||||||
dev->totalLogical() - 1
|
dev->totalLogical() - 1,
|
||||||
|
PartitionTable::FlagNone
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -246,7 +249,8 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||||
FileSystem::LinuxSwap,
|
FileSystem::LinuxSwap,
|
||||||
lastSectorForRoot + 1,
|
lastSectorForRoot + 1,
|
||||||
dev->totalLogical() - 1,
|
dev->totalLogical() - 1,
|
||||||
luksPassphrase
|
luksPassphrase,
|
||||||
|
PartitionTable::FlagNone
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
PartitionInfo::setFormat( swapPartition, true );
|
PartitionInfo::setFormat( swapPartition, true );
|
||||||
|
@ -296,7 +300,8 @@ doReplacePartition( PartitionCoreModule* core,
|
||||||
newRoles,
|
newRoles,
|
||||||
FileSystem::typeForName( defaultFsType ),
|
FileSystem::typeForName( defaultFsType ),
|
||||||
partition->firstSector(),
|
partition->firstSector(),
|
||||||
partition->lastSector()
|
partition->lastSector(),
|
||||||
|
PartitionTable::FlagNone
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -308,7 +313,8 @@ doReplacePartition( PartitionCoreModule* core,
|
||||||
FileSystem::typeForName( defaultFsType ),
|
FileSystem::typeForName( defaultFsType ),
|
||||||
partition->firstSector(),
|
partition->firstSector(),
|
||||||
partition->lastSector(),
|
partition->lastSector(),
|
||||||
luksPassphrase
|
luksPassphrase,
|
||||||
|
PartitionTable::FlagNone
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
PartitionInfo::setMountPoint( newPartition, "/" );
|
PartitionInfo::setMountPoint( newPartition, "/" );
|
||||||
|
|
|
@ -635,7 +635,8 @@ ChoicePage::doAlongsideApply()
|
||||||
candidate->roles(),
|
candidate->roles(),
|
||||||
FileSystem::typeForName( m_defaultFsType ),
|
FileSystem::typeForName( m_defaultFsType ),
|
||||||
newLastSector + 2, // *
|
newLastSector + 2, // *
|
||||||
oldLastSector
|
oldLastSector,
|
||||||
|
PartitionTable::FlagNone
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -647,7 +648,8 @@ ChoicePage::doAlongsideApply()
|
||||||
FileSystem::typeForName( m_defaultFsType ),
|
FileSystem::typeForName( m_defaultFsType ),
|
||||||
newLastSector + 2, // *
|
newLastSector + 2, // *
|
||||||
oldLastSector,
|
oldLastSector,
|
||||||
luksPassphrase
|
luksPassphrase,
|
||||||
|
PartitionTable::FlagNone
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
PartitionInfo::setMountPoint( newPartition, "/" );
|
PartitionInfo::setMountPoint( newPartition, "/" );
|
||||||
|
@ -735,7 +737,9 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
|
||||||
FileSystem::typeForName( m_defaultFsType ),
|
FileSystem::typeForName( m_defaultFsType ),
|
||||||
selectedPartition->firstSector(),
|
selectedPartition->firstSector(),
|
||||||
selectedPartition->lastSector(),
|
selectedPartition->lastSector(),
|
||||||
m_encryptWidget->passphrase() );
|
m_encryptWidget->passphrase(),
|
||||||
|
PartitionTable::FlagNone
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -745,7 +749,9 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
|
||||||
newRoles,
|
newRoles,
|
||||||
FileSystem::typeForName( m_defaultFsType ),
|
FileSystem::typeForName( m_defaultFsType ),
|
||||||
selectedPartition->firstSector(),
|
selectedPartition->firstSector(),
|
||||||
selectedPartition->lastSector() );
|
selectedPartition->lastSector(),
|
||||||
|
PartitionTable::FlagNone
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
PartitionInfo::setMountPoint( newPartition, "/" );
|
PartitionInfo::setMountPoint( newPartition, "/" );
|
||||||
|
|
|
@ -358,7 +358,15 @@ PartitionJobTests::testResizePartition()
|
||||||
|
|
||||||
Partition* freePartition = firstFreePartition( m_device->partitionTable() );
|
Partition* freePartition = firstFreePartition( m_device->partitionTable() );
|
||||||
QVERIFY( freePartition );
|
QVERIFY( freePartition );
|
||||||
Partition* partition = KPMHelpers::createNewPartition( freePartition->parent(), *m_device, PartitionRole( PartitionRole::Primary ), FileSystem::Ext4, oldFirst, oldLast );
|
Partition* partition = KPMHelpers::createNewPartition(
|
||||||
|
freePartition->parent(),
|
||||||
|
*m_device,
|
||||||
|
PartitionRole( PartitionRole::Primary ),
|
||||||
|
FileSystem::Ext4,
|
||||||
|
oldFirst,
|
||||||
|
oldLast,
|
||||||
|
PartitionTable::FlagNone
|
||||||
|
);
|
||||||
CreatePartitionJob* job = new CreatePartitionJob( m_device.data(), partition );
|
CreatePartitionJob* job = new CreatePartitionJob( m_device.data(), partition );
|
||||||
job->updatePreview();
|
job->updatePreview();
|
||||||
m_queue.enqueue( job_ptr( job ) );
|
m_queue.enqueue( job_ptr( job ) );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue