[partition] Apply coding style

This commit is contained in:
Adriaan de Groot 2022-05-18 12:07:20 +02:00
parent 56071c4016
commit 8fea6f71ab
6 changed files with 233 additions and 237 deletions

View File

@ -20,9 +20,9 @@
#include <kpmcore/backend/corebackendmanager.h>
#include <kpmcore/core/device.h>
#include <kpmcore/core/partition.h>
#include <kpmcore/fs/filesystem.h>
#include <kpmcore/fs/filesystemfactory.h>
#include <kpmcore/fs/luks.h>
#include <kpmcore/fs/filesystem.h>
#include <kpmcore/util/externalcommand.h>
using CalamaresUtils::Partition::PartitionIterator;
@ -174,13 +174,9 @@ namespace KPMHelpers
}
ExternalCommand openCmd( QStringLiteral( "cryptsetup" ),
{ QStringLiteral( "open" ),
deviceNode,
luksFs->suggestedMapperName( deviceNode ) } );
{ QStringLiteral( "open" ), deviceNode, luksFs->suggestedMapperName( deviceNode ) } );
if ( !( openCmd.write( passphrase.toLocal8Bit() + '\n' ) &&
openCmd.start( -1 ) &&
openCmd.exitCode() == 0 ) )
if ( !( openCmd.write( passphrase.toLocal8Bit() + '\n' ) && openCmd.start( -1 ) && openCmd.exitCode() == 0 ) )
{
cWarning() << Logger::SubEntry << openCmd.exitCode() << ": cryptsetup command failed";
return openCmd.exitCode();

View File

@ -467,10 +467,14 @@ ChoicePage::onActionChanged()
}
// Whole disk encryption isn't implemented for zfs so disable the option for now
if ( m_eraseFsTypesChoiceComboBox != nullptr && m_enableEncryptionWidget ) {
if ( m_eraseFsTypesChoiceComboBox->currentText() == "zfs" ) {
if ( m_eraseFsTypesChoiceComboBox != nullptr && m_enableEncryptionWidget )
{
if ( m_eraseFsTypesChoiceComboBox->currentText() == "zfs" )
{
m_encryptWidget->hide();
} else {
}
else
{
m_encryptWidget->show();
}
}

View File

@ -17,10 +17,10 @@
#include "ui_EditExistingPartitionDialog.h"
#include "core/ColorUtils.h"
#include "core/KPMHelpers.h"
#include "core/PartUtils.h"
#include "core/PartitionCoreModule.h"
#include "core/PartitionInfo.h"
#include "core/KPMHelpers.h"
#include "gui/PartitionDialogHelpers.h"
#include "gui/PartitionSizeController.h"
@ -38,9 +38,9 @@
#include <QComboBox>
#include <QDir>
#include <QPushButton>
#include <QProcess>
#include <QMessageBox>
#include <QProcess>
#include <QPushButton>
using CalamaresUtils::Partition::untranslatedFS;
using CalamaresUtils::Partition::userVisibleFS;
@ -265,8 +265,7 @@ EditExistingPartitionDialog::applyChanges( PartitionCoreModule* core )
"or delete and create a new encrypted partition." )
.arg( m_partition->partitionPath() );
QMessageBox mb( QMessageBox::Information, message, description,
QMessageBox::Ok, this->parentWidget() );
QMessageBox mb( QMessageBox::Information, message, description, QMessageBox::Ok, this->parentWidget() );
Calamares::fixButtonLabels( &mb );
mb.exec();
}
@ -321,7 +320,6 @@ EditExistingPartitionDialog::updateMountPointPicker()
}
toggleEncryptWidget();
}
void
@ -344,9 +342,7 @@ EditExistingPartitionDialog::toggleEncryptWidget()
// and not currently formatted
// and its mount point not a standard mount point except when it's /home
QString mp = selectedMountPoint( m_ui->mountPointComboBox );
if ( !mp.isEmpty()
&& m_partition->fileSystem().type() == FileSystem::Luks
&& !m_ui->formatRadioButton->isChecked()
if ( !mp.isEmpty() && m_partition->fileSystem().type() == FileSystem::Luks && !m_ui->formatRadioButton->isChecked()
&& ( !standardMountPoints().contains( mp ) || mp == "/home" ) )
{
m_ui->encryptWidget->show();