Coding style
This commit is contained in:
parent
75e9fd6aa3
commit
b246a95606
@ -124,10 +124,10 @@ CreatePartitionDialog::createPartition()
|
|||||||
? FileSystem::Extended
|
? FileSystem::Extended
|
||||||
: FileSystem::typeForName( m_ui->fsComboBox->currentText() );
|
: FileSystem::typeForName( m_ui->fsComboBox->currentText() );
|
||||||
Partition* partition = PMUtils::createNewPartition(
|
Partition* partition = PMUtils::createNewPartition(
|
||||||
m_parent,
|
m_parent,
|
||||||
*m_device,
|
*m_device,
|
||||||
m_role,
|
m_role,
|
||||||
fsType, range.first, range.second );
|
fsType, range.first, range.second );
|
||||||
|
|
||||||
PartitionInfo::setMountPoint( partition, m_ui->mountPointComboBox->currentText() );
|
PartitionInfo::setMountPoint( partition, m_ui->mountPointComboBox->currentText() );
|
||||||
PartitionInfo::setFormat( partition, true );
|
PartitionInfo::setFormat( partition, true );
|
||||||
|
@ -56,12 +56,12 @@ EditExistingPartitionDialog::applyChanges( PartitionCoreModule* core )
|
|||||||
if ( m_ui->formatRadioButton->isChecked() )
|
if ( m_ui->formatRadioButton->isChecked() )
|
||||||
{
|
{
|
||||||
Partition* newPartition = PMUtils::createNewPartition(
|
Partition* newPartition = PMUtils::createNewPartition(
|
||||||
m_partition->parent(),
|
m_partition->parent(),
|
||||||
*m_device,
|
*m_device,
|
||||||
m_partition->roles(),
|
m_partition->roles(),
|
||||||
m_partition->fileSystem().type(),
|
m_partition->fileSystem().type(),
|
||||||
range.first,
|
range.first,
|
||||||
range.second);
|
range.second );
|
||||||
PartitionInfo::setMountPoint( newPartition, PartitionInfo::mountPoint( m_partition ) );
|
PartitionInfo::setMountPoint( newPartition, PartitionInfo::mountPoint( m_partition ) );
|
||||||
PartitionInfo::setFormat( newPartition, true );
|
PartitionInfo::setFormat( newPartition, true );
|
||||||
|
|
||||||
|
@ -53,17 +53,17 @@ createNewPartition( PartitionNode* parent, const Device& device, const Partition
|
|||||||
{
|
{
|
||||||
FileSystem* fs = FileSystemFactory::create( fsType, firstSector, lastSector );
|
FileSystem* fs = FileSystemFactory::create( fsType, firstSector, lastSector );
|
||||||
return new Partition(
|
return new Partition(
|
||||||
parent,
|
parent,
|
||||||
device,
|
device,
|
||||||
role,
|
role,
|
||||||
fs, fs->firstSector(), fs->lastSector(),
|
fs, fs->firstSector(), fs->lastSector(),
|
||||||
QString() /* path */,
|
QString() /* path */,
|
||||||
PartitionTable::FlagNone /* availableFlags */,
|
PartitionTable::FlagNone /* availableFlags */,
|
||||||
QString() /* mountPoint */,
|
QString() /* mountPoint */,
|
||||||
false /* mounted */,
|
false /* mounted */,
|
||||||
PartitionTable::FlagNone /* activeFlags */,
|
PartitionTable::FlagNone /* activeFlags */,
|
||||||
Partition::StateNew
|
Partition::StateNew
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -46,7 +46,7 @@ static bool
|
|||||||
hasRootPartition( Device* device )
|
hasRootPartition( Device* device )
|
||||||
{
|
{
|
||||||
for ( auto it = PartitionIterator::begin( device ); it != PartitionIterator::end( device ); ++it )
|
for ( auto it = PartitionIterator::begin( device ); it != PartitionIterator::end( device ); ++it )
|
||||||
if ( (*it)->mountPoint() == "/" )
|
if ( ( *it )->mountPoint() == "/" )
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,8 @@
|
|||||||
// Qt
|
// Qt
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
||||||
static QColor COLORS[ 4 ] = {
|
static QColor COLORS[ 4 ] =
|
||||||
|
{
|
||||||
"#448eca",
|
"#448eca",
|
||||||
"#a5cc42",
|
"#a5cc42",
|
||||||
"#d87e30",
|
"#d87e30",
|
||||||
@ -54,7 +55,7 @@ static QColor colorForPartition( Partition* partition, int row )
|
|||||||
|
|
||||||
//- ResetHelper --------------------------------------------
|
//- ResetHelper --------------------------------------------
|
||||||
PartitionModel::ResetHelper::ResetHelper( PartitionModel* model )
|
PartitionModel::ResetHelper::ResetHelper( PartitionModel* model )
|
||||||
: m_model( model )
|
: m_model( model )
|
||||||
{
|
{
|
||||||
m_model->beginResetModel();
|
m_model->beginResetModel();
|
||||||
}
|
}
|
||||||
@ -98,8 +99,8 @@ QModelIndex
|
|||||||
PartitionModel::index( int row, int column, const QModelIndex& parent ) const
|
PartitionModel::index( int row, int column, const QModelIndex& parent ) const
|
||||||
{
|
{
|
||||||
PartitionNode* parentPartition = parent.isValid()
|
PartitionNode* parentPartition = parent.isValid()
|
||||||
? static_cast< PartitionNode* >( partitionForIndex( parent ))
|
? static_cast< PartitionNode* >( partitionForIndex( parent ) )
|
||||||
: static_cast< PartitionNode* >( m_device->partitionTable() );
|
: static_cast< PartitionNode* >( m_device->partitionTable() );
|
||||||
if ( !parentPartition )
|
if ( !parentPartition )
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
auto lst = parentPartition->children();
|
auto lst = parentPartition->children();
|
||||||
|
@ -99,7 +99,8 @@ PartitionPreview::drawPartitions( QPainter* painter, const QRect& rect, const QM
|
|||||||
return;
|
return;
|
||||||
const int count = modl->rowCount( parent );
|
const int count = modl->rowCount( parent );
|
||||||
const int totalWidth = rect.width();
|
const int totalWidth = rect.width();
|
||||||
struct Item {
|
struct Item
|
||||||
|
{
|
||||||
qreal size;
|
qreal size;
|
||||||
QModelIndex index;
|
QModelIndex index;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user