[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
@ -89,7 +89,7 @@ Partition* createNewPartition( PartitionNode* parent,
|
||||
FileSystem::Type fsType,
|
||||
qint64 firstSector,
|
||||
qint64 lastSector,
|
||||
PartitionTable::Flags flags = PartitionTable::FlagNone );
|
||||
PartitionTable::Flags flags );
|
||||
|
||||
Partition* createNewEncryptedPartition( PartitionNode* parent,
|
||||
const Device& device,
|
||||
@ -98,7 +98,7 @@ Partition* createNewEncryptedPartition( PartitionNode* parent,
|
||||
qint64 firstSector,
|
||||
qint64 lastSector,
|
||||
const QString& passphrase,
|
||||
PartitionTable::Flags flags = PartitionTable::FlagNone );
|
||||
PartitionTable::Flags flags );
|
||||
|
||||
Partition* clonePartition( Device* device, Partition* partition );
|
||||
|
||||
|
@ -204,7 +204,8 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||
PartitionRole( PartitionRole::Primary ),
|
||||
FileSystem::typeForName( defaultFsType ),
|
||||
firstFreeSector,
|
||||
lastSectorForRoot
|
||||
lastSectorForRoot,
|
||||
PartitionTable::FlagNone
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -216,7 +217,8 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||
FileSystem::typeForName( defaultFsType ),
|
||||
firstFreeSector,
|
||||
lastSectorForRoot,
|
||||
luksPassphrase
|
||||
luksPassphrase,
|
||||
PartitionTable::FlagNone
|
||||
);
|
||||
}
|
||||
PartitionInfo::setFormat( rootPartition, true );
|
||||
@ -234,7 +236,8 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||
PartitionRole( PartitionRole::Primary ),
|
||||
FileSystem::LinuxSwap,
|
||||
lastSectorForRoot + 1,
|
||||
dev->totalLogical() - 1
|
||||
dev->totalLogical() - 1,
|
||||
PartitionTable::FlagNone
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -246,7 +249,8 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||
FileSystem::LinuxSwap,
|
||||
lastSectorForRoot + 1,
|
||||
dev->totalLogical() - 1,
|
||||
luksPassphrase
|
||||
luksPassphrase,
|
||||
PartitionTable::FlagNone
|
||||
);
|
||||
}
|
||||
PartitionInfo::setFormat( swapPartition, true );
|
||||
@ -296,7 +300,8 @@ doReplacePartition( PartitionCoreModule* core,
|
||||
newRoles,
|
||||
FileSystem::typeForName( defaultFsType ),
|
||||
partition->firstSector(),
|
||||
partition->lastSector()
|
||||
partition->lastSector(),
|
||||
PartitionTable::FlagNone
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -308,7 +313,8 @@ doReplacePartition( PartitionCoreModule* core,
|
||||
FileSystem::typeForName( defaultFsType ),
|
||||
partition->firstSector(),
|
||||
partition->lastSector(),
|
||||
luksPassphrase
|
||||
luksPassphrase,
|
||||
PartitionTable::FlagNone
|
||||
);
|
||||
}
|
||||
PartitionInfo::setMountPoint( newPartition, "/" );
|
||||
|
@ -635,7 +635,8 @@ ChoicePage::doAlongsideApply()
|
||||
candidate->roles(),
|
||||
FileSystem::typeForName( m_defaultFsType ),
|
||||
newLastSector + 2, // *
|
||||
oldLastSector
|
||||
oldLastSector,
|
||||
PartitionTable::FlagNone
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -647,7 +648,8 @@ ChoicePage::doAlongsideApply()
|
||||
FileSystem::typeForName( m_defaultFsType ),
|
||||
newLastSector + 2, // *
|
||||
oldLastSector,
|
||||
luksPassphrase
|
||||
luksPassphrase,
|
||||
PartitionTable::FlagNone
|
||||
);
|
||||
}
|
||||
PartitionInfo::setMountPoint( newPartition, "/" );
|
||||
@ -735,7 +737,9 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
|
||||
FileSystem::typeForName( m_defaultFsType ),
|
||||
selectedPartition->firstSector(),
|
||||
selectedPartition->lastSector(),
|
||||
m_encryptWidget->passphrase() );
|
||||
m_encryptWidget->passphrase(),
|
||||
PartitionTable::FlagNone
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -745,7 +749,9 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
|
||||
newRoles,
|
||||
FileSystem::typeForName( m_defaultFsType ),
|
||||
selectedPartition->firstSector(),
|
||||
selectedPartition->lastSector() );
|
||||
selectedPartition->lastSector(),
|
||||
PartitionTable::FlagNone
|
||||
);
|
||||
}
|
||||
|
||||
PartitionInfo::setMountPoint( newPartition, "/" );
|
||||
|
@ -358,7 +358,15 @@ PartitionJobTests::testResizePartition()
|
||||
|
||||
Partition* freePartition = firstFreePartition( m_device->partitionTable() );
|
||||
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 );
|
||||
job->updatePreview();
|
||||
m_queue.enqueue( job_ptr( job ) );
|
||||
|
Loading…
Reference in New Issue
Block a user