[partition] Apply coding style

This commit is contained in:
Adriaan de Groot 2021-06-22 00:21:01 +02:00
parent e2bf717ea0
commit 131352ca03
9 changed files with 45 additions and 31 deletions

View File

@ -10,8 +10,8 @@
#include "DeviceList.h"
#include "utils/Logger.h"
#include "partition/PartitionIterator.h"
#include "utils/Logger.h"
#include <kpmcore/backend/corebackend.h>
#include <kpmcore/backend/corebackendmanager.h>

View File

@ -177,7 +177,8 @@ canBeResized( Partition* candidate, const Logger::Once& o )
if ( availableStorageB > advisedStorageB )
{
cDebug() << o << "Partition" << convenienceName( candidate ) << "authorized for resize + autopartition install.";
cDebug() << o << "Partition" << convenienceName( candidate )
<< "authorized for resize + autopartition install.";
return true;
}
else
@ -412,8 +413,14 @@ runOsprober( DeviceModel* dm )
FstabEntryList fstabEntries = lookForFstabEntries( path );
QString homePath = findPartitionPathForMountPoint( fstabEntries, "/home" );
osproberEntries.append(
{ prettyName, path, file, QString(), canBeResized( dm, path, o ), lineColumns, fstabEntries, homePath } );
osproberEntries.append( { prettyName,
path,
file,
QString(),
canBeResized( dm, path, o ),
lineColumns,
fstabEntries,
homePath } );
osproberCleanLines.append( line );
}
}

View File

@ -144,7 +144,8 @@ ChoicePage::~ChoicePage() {}
* this avoids cases where the popup would truncate data being drawn
* because the overall box is sized too narrow.
*/
void setModelToComboBox( QComboBox* box, QAbstractItemModel* model )
void
setModelToComboBox( QComboBox* box, QAbstractItemModel* model )
{
box->setModel( model );
if ( model->rowCount() > 0 )
@ -1005,7 +1006,8 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice )
SelectionFilter filter = []( const QModelIndex& index ) {
return PartUtils::canBeResized(
static_cast< Partition* >( index.data( PartitionModel::PartitionPtrRole ).value< void* >() ), Logger::Once() );
static_cast< Partition* >( index.data( PartitionModel::PartitionPtrRole ).value< void* >() ),
Logger::Once() );
};
m_beforePartitionBarsView->setSelectionFilter( filter );
m_beforePartitionLabelsView->setSelectionFilter( filter );
@ -1094,7 +1096,8 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice )
{
SelectionFilter filter = []( const QModelIndex& index ) {
return PartUtils::canBeReplaced(
static_cast< Partition* >( index.data( PartitionModel::PartitionPtrRole ).value< void* >() ), Logger::Once() );
static_cast< Partition* >( index.data( PartitionModel::PartitionPtrRole ).value< void* >() ),
Logger::Once() );
};
m_beforePartitionBarsView->setSelectionFilter( filter );
m_beforePartitionLabelsView->setSelectionFilter( filter );

View File

@ -150,8 +150,7 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device,
QWidget* parentWidget )
: CreatePartitionDialog( device, existingNewPartition.p->parent(), usedMountPoints, parentWidget )
{
standardMountPoints( *( m_ui->mountPointComboBox ),
PartitionInfo::mountPoint( existingNewPartition.p ) );
standardMountPoints( *( m_ui->mountPointComboBox ), PartitionInfo::mountPoint( existingNewPartition.p ) );
setFlagList( *( m_ui->m_listFlags ),
static_cast< PartitionTable::Flags >( ~PartitionTable::Flags::Int( 0 ) ),
PartitionInfo::flags( existingNewPartition.p ) );
@ -248,8 +247,8 @@ CreatePartitionDialog::getNewlyCreatedPartition()
}
else
{
partition
= KPMHelpers::createNewPartition( m_parent, *m_device, m_role, fsType, fsLabel, first, last, PartitionTable::Flags() );
partition = KPMHelpers::createNewPartition(
m_parent, *m_device, m_role, fsType, fsLabel, first, last, PartitionTable::Flags() );
}
if ( m_device->type() == Device::Type::LVM_Device )

View File

@ -45,8 +45,14 @@ private:
QWidget* parentWidget );
public:
struct FreeSpace { Partition* p; };
struct FreshPartition { Partition* p; };
struct FreeSpace
{
Partition* p;
};
struct FreshPartition
{
Partition* p;
};
/** @brief Dialog for editing a new partition based on free space.
*

View File

@ -391,8 +391,8 @@ PartitionPage::onCreateClicked()
return;
}
QPointer< CreatePartitionDialog > dlg = new
CreatePartitionDialog ( model->device(), CreatePartitionDialog::FreeSpace{ partition }, getCurrentUsedMountpoints(), this );
QPointer< CreatePartitionDialog > dlg = new CreatePartitionDialog(
model->device(), CreatePartitionDialog::FreeSpace { partition }, getCurrentUsedMountpoints(), this );
if ( dlg->exec() == QDialog::Accepted )
{
Partition* newPart = dlg->getNewlyCreatedPartition();

View File

@ -403,8 +403,7 @@ shouldWarnForGPTOnBIOS( const PartitionCoreModule* core )
&& ( partition->fileSystem().type() == FileSystem::Unformatted )
&& ( partition->capacity() >= 8_MiB ) )
{
cDebug() << Logger::SubEntry << "Partition" << partition->devicePath()
<< partition->partitionPath()
cDebug() << Logger::SubEntry << "Partition" << partition->devicePath() << partition->partitionPath()
<< "is a suitable bios_grub partition";
return false;
}