[partition] Apply coding style to core/

This commit is contained in:
Adriaan de Groot 2021-06-18 11:23:27 +02:00
parent f9659989b1
commit 9fa5ab04e5
6 changed files with 32 additions and 21 deletions

View File

@ -210,7 +210,8 @@ Config::setSwapChoice( Config::SwapChoice c )
void void
Config::setEraseFsTypeChoice( const QString& choice ) Config::setEraseFsTypeChoice( const QString& choice )
{ {
if(choice != m_eraseFsTypeChoice){ if ( choice != m_eraseFsTypeChoice )
{
m_eraseFsTypeChoice = choice; m_eraseFsTypeChoice = choice;
} }
} }
@ -249,12 +250,16 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
gs->insert( "allowManualPartitioning", gs->insert( "allowManualPartitioning",
CalamaresUtils::getBool( configurationMap, "allowManualPartitioning", true ) ); CalamaresUtils::getBool( configurationMap, "allowManualPartitioning", true ) );
if ( configurationMap.contains( "availableFileSystemTypes" ) ) { if ( configurationMap.contains( "availableFileSystemTypes" ) )
if(configurationMap.value( "availableFileSystemTypes" ).type() == QVariant::List ){ {
if ( configurationMap.value( "availableFileSystemTypes" ).type() == QVariant::List )
{
m_eraseFsTypes.clear(); m_eraseFsTypes.clear();
m_eraseFsTypes.append( configurationMap.value( "availableFileSystemTypes" ).toStringList() ); m_eraseFsTypes.append( configurationMap.value( "availableFileSystemTypes" ).toStringList() );
m_eraseFsTypeChoice = m_eraseFsTypes[ 0 ]; m_eraseFsTypeChoice = m_eraseFsTypes[ 0 ];
} else if ( configurationMap.value( "availableFileSystemTypes" ).type() == QVariant::String ){ }
else if ( configurationMap.value( "availableFileSystemTypes" ).type() == QVariant::String )
{
m_eraseFsTypes.append( configurationMap.value( "availableFileSystemTypes" ).toString() ); m_eraseFsTypes.append( configurationMap.value( "availableFileSystemTypes" ).toString() );
m_eraseFsTypeChoice = m_eraseFsTypes[ 0 ]; m_eraseFsTypeChoice = m_eraseFsTypes[ 0 ];
} }

View File

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

View File

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

View File

@ -390,7 +390,6 @@ PartitionCoreModule::createPartitionTable( Device* device, PartitionTable::Table
OperationHelper helper( partitionModelForDevice( device ), this ); OperationHelper helper( partitionModelForDevice( device ), this );
deviceInfo->makeJob< CreatePartitionTableJob >( type ); deviceInfo->makeJob< CreatePartitionTableJob >( type );
} }
} }