From 1c7c0b9af8c2aae8835fdecf1f96a583fc56598e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 27 Jun 2022 00:37:15 +0200 Subject: [PATCH] CI: apply coding style (clang-format 13) --- src/calamares/CalamaresApplication.h | 2 +- src/calamares/DebugWindow.cpp | 3 ++- src/calamares/DebugWindow.h | 2 +- src/libcalamares/PythonHelper.h | 2 +- src/libcalamares/PythonJobApi.h | 2 +- src/libcalamares/locale/Global.h | 2 +- src/libcalamares/modulesystem/Descriptor.h | 5 +---- src/libcalamaresui/Branding.h | 2 +- .../widgets/waitingspinnerwidget.cpp | 2 +- src/modules/contextualprocess/Binding.h | 4 ++-- src/modules/finished/FinishedPage.h | 2 +- src/modules/keyboard/KeyboardPage.h | 2 +- src/modules/license/LicensePage.h | 2 +- .../luksbootkeyfile/LuksBootKeyFileJob.cpp | 8 +++---- src/modules/netinstall/NetInstallPage.h | 2 +- src/modules/netinstall/PackageModel.h | 2 +- src/modules/packagechooser/ItemAppStream.h | 2 +- .../packagechooser/PackageChooserPage.h | 2 +- src/modules/partition/core/KPMHelpers.cpp | 21 +++++++------------ src/modules/partition/core/PartUtils.h | 2 +- src/modules/partition/gui/ChoicePage.h | 2 +- src/modules/partition/gui/EncryptWidget.h | 2 +- .../partition/gui/VolumeGroupBaseDialog.h | 2 +- src/modules/plasmalnf/PlasmaLnfPage.h | 2 +- src/modules/tracking/TrackingPage.h | 2 +- src/modules/users/UsersPage.h | 2 +- src/modules/welcome/WelcomePage.h | 2 +- src/modules/welcome/WelcomeViewStep.h | 2 +- .../welcome/checker/GeneralRequirements.cpp | 4 ++-- src/modules/welcomeq/WelcomeQmlViewStep.h | 2 +- 30 files changed, 43 insertions(+), 50 deletions(-) diff --git a/src/calamares/CalamaresApplication.h b/src/calamares/CalamaresApplication.h index 5f0037971..77cf3a00b 100644 --- a/src/calamares/CalamaresApplication.h +++ b/src/calamares/CalamaresApplication.h @@ -18,7 +18,7 @@ class CalamaresWindow; namespace Calamares { class ModuleManager; -} +} // namespace Calamares /** diff --git a/src/calamares/DebugWindow.cpp b/src/calamares/DebugWindow.cpp index feeab833e..826696b4f 100644 --- a/src/calamares/DebugWindow.cpp +++ b/src/calamares/DebugWindow.cpp @@ -116,7 +116,8 @@ DebugWindow::DebugWindow() connect( m_ui->modulesListView->selectionModel(), &QItemSelectionModel::selectionChanged, this, - [this] { + [ this ] + { QString moduleName = m_ui->modulesListView->currentIndex().data().toString(); Module* module = ModuleManager::instance()->moduleInstance( ModuleSystem::InstanceKey::fromString( moduleName ) ); diff --git a/src/calamares/DebugWindow.h b/src/calamares/DebugWindow.h index 7bc789a89..83bfb085e 100644 --- a/src/calamares/DebugWindow.h +++ b/src/calamares/DebugWindow.h @@ -26,7 +26,7 @@ namespace Calamares namespace Ui { class DebugWindow; -} +} // namespace Ui class DebugWindow : public QWidget { diff --git a/src/libcalamares/PythonHelper.h b/src/libcalamares/PythonHelper.h index 0a2127fb0..121806862 100644 --- a/src/libcalamares/PythonHelper.h +++ b/src/libcalamares/PythonHelper.h @@ -19,7 +19,7 @@ namespace Calamares { class GlobalStorage; -} +} // namespace Calamares namespace CalamaresPython { diff --git a/src/libcalamares/PythonJobApi.h b/src/libcalamares/PythonJobApi.h index e61609460..373812187 100644 --- a/src/libcalamares/PythonJobApi.h +++ b/src/libcalamares/PythonJobApi.h @@ -18,7 +18,7 @@ namespace Calamares { class PythonJob; -} +} // namespace Calamares namespace CalamaresPython { diff --git a/src/libcalamares/locale/Global.h b/src/libcalamares/locale/Global.h index cf23ef7df..326fef109 100644 --- a/src/libcalamares/locale/Global.h +++ b/src/libcalamares/locale/Global.h @@ -28,7 +28,7 @@ namespace Calamares { class GlobalStorage; -} +} // namespace Calamares namespace CalamaresUtils { diff --git a/src/libcalamares/modulesystem/Descriptor.h b/src/libcalamares/modulesystem/Descriptor.h index 5b3681336..061d17890 100644 --- a/src/libcalamares/modulesystem/Descriptor.h +++ b/src/libcalamares/modulesystem/Descriptor.h @@ -111,10 +111,7 @@ public: * * Python job modules have one specific script to load and run. */ - QString script() const - { - return m_interface == Interface::Python ? m_script : QString(); - } + QString script() const { return m_interface == Interface::Python ? m_script : QString(); } private: QString m_name; diff --git a/src/libcalamaresui/Branding.h b/src/libcalamaresui/Branding.h index 6e7d780ee..a5a2e535d 100644 --- a/src/libcalamaresui/Branding.h +++ b/src/libcalamaresui/Branding.h @@ -28,7 +28,7 @@ namespace YAML { class Node; -} +} // namespace YAML namespace Calamares { diff --git a/src/libcalamaresui/widgets/waitingspinnerwidget.cpp b/src/libcalamaresui/widgets/waitingspinnerwidget.cpp index 3073e9b97..2ee5a5ea4 100644 --- a/src/libcalamaresui/widgets/waitingspinnerwidget.cpp +++ b/src/libcalamaresui/widgets/waitingspinnerwidget.cpp @@ -30,9 +30,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "waitingspinnerwidget.h" -#include #include #include +#include static bool isAlignCenter( Qt::AlignmentFlag a ) diff --git a/src/modules/contextualprocess/Binding.h b/src/modules/contextualprocess/Binding.h index fc9f65557..77a966caf 100644 --- a/src/modules/contextualprocess/Binding.h +++ b/src/modules/contextualprocess/Binding.h @@ -22,11 +22,11 @@ namespace CalamaresUtils { class CommandList; -} +} // namespace CalamaresUtils namespace Calamares { class GlobalStorage; -} +} // namespace Calamares struct ValueCheck : public QPair< QString, CalamaresUtils::CommandList* > { diff --git a/src/modules/finished/FinishedPage.h b/src/modules/finished/FinishedPage.h index 068efbdb5..7661afa75 100644 --- a/src/modules/finished/FinishedPage.h +++ b/src/modules/finished/FinishedPage.h @@ -20,7 +20,7 @@ class Config; namespace Ui { class FinishedPage; -} +} // namespace Ui class FinishedPage : public QWidget { diff --git a/src/modules/keyboard/KeyboardPage.h b/src/modules/keyboard/KeyboardPage.h index 1c644cc08..f9870e1c1 100644 --- a/src/modules/keyboard/KeyboardPage.h +++ b/src/modules/keyboard/KeyboardPage.h @@ -25,7 +25,7 @@ namespace Ui { class Page_Keyboard; -} +} // namespace Ui class Config; class KeyBoardPreview; diff --git a/src/modules/license/LicensePage.h b/src/modules/license/LicensePage.h index 73a62defa..cfd991e73 100644 --- a/src/modules/license/LicensePage.h +++ b/src/modules/license/LicensePage.h @@ -21,7 +21,7 @@ namespace Ui { class LicensePage; -} +} // namespace Ui class LicenseWidget; diff --git a/src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp b/src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp index 3dd7fe42a..5b0914595 100644 --- a/src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp +++ b/src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp @@ -17,8 +17,8 @@ #include "GlobalStorage.h" #include "JobQueue.h" -#include #include +#include LuksBootKeyFileJob::LuksBootKeyFileJob( QObject* parent ) : Calamares::CppJob( parent ) @@ -144,7 +144,7 @@ setupLuks( const LuksDevice& d ) if ( luks_dump.getExitCode() == 0 ) { QRegularExpression re( QStringLiteral( R"(\d+:\s*enabled)" ), QRegularExpression::CaseInsensitiveOption ); - int count = luks_dump.getOutput().count(re); + int count = luks_dump.getOutput().count( re ); cDebug() << "Luks Dump slot count: " << count; if ( count >= 7 ) { @@ -152,8 +152,8 @@ setupLuks( const LuksDevice& d ) { "cryptsetup", "luksKillSlot", d.device, "1" }, QString(), d.passphrase, std::chrono::seconds( 60 ) ); if ( r.getExitCode() != 0 ) { - cWarning() << "Could not kill a slot to make room on" << d.device << ':' << r.getOutput() << "(exit code" - << r.getExitCode() << ')'; + cWarning() << "Could not kill a slot to make room on" << d.device << ':' << r.getOutput() + << "(exit code" << r.getExitCode() << ')'; return false; } } diff --git a/src/modules/netinstall/NetInstallPage.h b/src/modules/netinstall/NetInstallPage.h index 94ce6d4ba..5b10b5ca7 100644 --- a/src/modules/netinstall/NetInstallPage.h +++ b/src/modules/netinstall/NetInstallPage.h @@ -29,7 +29,7 @@ class QNetworkReply; namespace Ui { class Page_NetInst; -} +} // namespace Ui class NetInstallPage : public QWidget { diff --git a/src/modules/netinstall/PackageModel.h b/src/modules/netinstall/PackageModel.h index cc8668b2f..01334fea8 100644 --- a/src/modules/netinstall/PackageModel.h +++ b/src/modules/netinstall/PackageModel.h @@ -20,7 +20,7 @@ namespace YAML { class Node; -} +} // namespace YAML class PackageModel : public QAbstractItemModel { diff --git a/src/modules/packagechooser/ItemAppStream.h b/src/modules/packagechooser/ItemAppStream.h index 9fa3608c3..5d92ab443 100644 --- a/src/modules/packagechooser/ItemAppStream.h +++ b/src/modules/packagechooser/ItemAppStream.h @@ -15,7 +15,7 @@ namespace AppStream { class Pool; -} +} // namespace AppStream /** @brief Loads an item from AppStream data. * diff --git a/src/modules/packagechooser/PackageChooserPage.h b/src/modules/packagechooser/PackageChooserPage.h index 90c2b28a6..1889ef500 100644 --- a/src/modules/packagechooser/PackageChooserPage.h +++ b/src/modules/packagechooser/PackageChooserPage.h @@ -19,7 +19,7 @@ namespace Ui { class PackageChooserPage; -} +} // namespace Ui class PackageChooserPage : public QWidget { diff --git a/src/modules/partition/core/KPMHelpers.cpp b/src/modules/partition/core/KPMHelpers.cpp index e3985bc40..102d803cb 100644 --- a/src/modules/partition/core/KPMHelpers.cpp +++ b/src/modules/partition/core/KPMHelpers.cpp @@ -199,7 +199,8 @@ cryptOpen( Partition* partition ) const QString deviceNode = partition->partitionPath(); ExternalCommand openCmd( QStringLiteral( "cryptsetup" ), { QStringLiteral( "open" ), deviceNode, luksFs->suggestedMapperName( deviceNode ) } ); - if ( ( openCmd.write( luksFs->passphrase().toLocal8Bit() + '\n' ) && openCmd.start( -1 ) && openCmd.exitCode() == 0 ) ) + if ( ( openCmd.write( luksFs->passphrase().toLocal8Bit() + '\n' ) && openCmd.start( -1 ) + && openCmd.exitCode() == 0 ) ) { luksFs->scan( deviceNode ); if ( luksFs->mapperName().isEmpty() ) @@ -252,9 +253,7 @@ cryptLabel( Partition* partition, const QString& label ) if ( !mappedDevice.isEmpty() ) { // Label mapped device - ExternalCommand openCmd( QStringLiteral( "e2label" ), - { mappedDevice, - label } ); + ExternalCommand openCmd( QStringLiteral( "e2label" ), { mappedDevice, label } ); openCmd.start( -1 ); cryptClose( partition ); return true; @@ -262,11 +261,9 @@ cryptLabel( Partition* partition, const QString& label ) } else { - ExternalCommand openCmd( QStringLiteral( "cryptsetup" ), - { QStringLiteral( "config" ), - partition->partitionPath(), - QStringLiteral( "--label" ), - label } ); + ExternalCommand openCmd( + QStringLiteral( "cryptsetup" ), + { QStringLiteral( "config" ), partition->partitionPath(), QStringLiteral( "--label" ), label } ); if ( openCmd.start( -1 ) && openCmd.exitCode() == 0 ) { return true; @@ -286,12 +283,10 @@ cryptVersion( Partition* partition ) // Get luks version from header information int luksVersion = 1; ExternalCommand openCmd( QStringLiteral( "cryptsetup" ), - { QStringLiteral( "luksDump" ), - partition->partitionPath() } ); + { QStringLiteral( "luksDump" ), partition->partitionPath() } ); if ( openCmd.start( -1 ) && openCmd.exitCode() == 0 ) { - QRegularExpression re( QStringLiteral( R"(version:\s+(\d))" ), - QRegularExpression::CaseInsensitiveOption ); + QRegularExpression re( QStringLiteral( R"(version:\s+(\d))" ), QRegularExpression::CaseInsensitiveOption ); QRegularExpressionMatch rem = re.match( openCmd.output() ); if ( rem.hasMatch() ) { diff --git a/src/modules/partition/core/PartUtils.h b/src/modules/partition/core/PartUtils.h index f3c51df45..0ed388ff5 100644 --- a/src/modules/partition/core/PartUtils.h +++ b/src/modules/partition/core/PartUtils.h @@ -27,7 +27,7 @@ class Partition; namespace Logger { class Once; -} +} // namespace Logger namespace PartUtils { diff --git a/src/modules/partition/gui/ChoicePage.h b/src/modules/partition/gui/ChoicePage.h index ea346f5ad..ee60b4309 100644 --- a/src/modules/partition/gui/ChoicePage.h +++ b/src/modules/partition/gui/ChoicePage.h @@ -33,7 +33,7 @@ namespace Calamares namespace Widgets { class PrettyRadioButton; -} +} // namespace Widgets } // namespace Calamares class Config; diff --git a/src/modules/partition/gui/EncryptWidget.h b/src/modules/partition/gui/EncryptWidget.h index 704365817..9a3b8ab1f 100644 --- a/src/modules/partition/gui/EncryptWidget.h +++ b/src/modules/partition/gui/EncryptWidget.h @@ -17,7 +17,7 @@ namespace Ui { class EncryptWidget; -} +} // namespace Ui class EncryptWidget : public QWidget { diff --git a/src/modules/partition/gui/VolumeGroupBaseDialog.h b/src/modules/partition/gui/VolumeGroupBaseDialog.h index 94ed0b98b..56379e75f 100644 --- a/src/modules/partition/gui/VolumeGroupBaseDialog.h +++ b/src/modules/partition/gui/VolumeGroupBaseDialog.h @@ -17,7 +17,7 @@ namespace Ui { class VolumeGroupBaseDialog; -} +} // namespace Ui class QComboBox; class QLineEdit; diff --git a/src/modules/plasmalnf/PlasmaLnfPage.h b/src/modules/plasmalnf/PlasmaLnfPage.h index 0616b1a48..24813239a 100644 --- a/src/modules/plasmalnf/PlasmaLnfPage.h +++ b/src/modules/plasmalnf/PlasmaLnfPage.h @@ -15,7 +15,7 @@ namespace Ui { class PlasmaLnfPage; -} +} // namespace Ui class Config; diff --git a/src/modules/tracking/TrackingPage.h b/src/modules/tracking/TrackingPage.h index eb843b755..d9c5a3ec1 100644 --- a/src/modules/tracking/TrackingPage.h +++ b/src/modules/tracking/TrackingPage.h @@ -19,7 +19,7 @@ namespace Ui { class TrackingPage; -} +} // namespace Ui class Config; class TrackingStyleConfig; diff --git a/src/modules/users/UsersPage.h b/src/modules/users/UsersPage.h index ed537540c..2d48f1fa3 100644 --- a/src/modules/users/UsersPage.h +++ b/src/modules/users/UsersPage.h @@ -25,7 +25,7 @@ class QLabel; namespace Ui { class Page_UserSetup; -} +} // namespace Ui class UsersPage : public QWidget { diff --git a/src/modules/welcome/WelcomePage.h b/src/modules/welcome/WelcomePage.h index d5741240d..71aebd468 100644 --- a/src/modules/welcome/WelcomePage.h +++ b/src/modules/welcome/WelcomePage.h @@ -19,7 +19,7 @@ namespace Ui { class WelcomePage; -} +} // namespace Ui class CheckerContainer; class Config; diff --git a/src/modules/welcome/WelcomeViewStep.h b/src/modules/welcome/WelcomeViewStep.h index dfc6f1169..effaafcf8 100644 --- a/src/modules/welcome/WelcomeViewStep.h +++ b/src/modules/welcome/WelcomeViewStep.h @@ -28,7 +28,7 @@ namespace CalamaresUtils namespace GeoIP { class Handler; -} +} // namespace GeoIP } // namespace CalamaresUtils class PLUGINDLLEXPORT WelcomeViewStep : public Calamares::ViewStep diff --git a/src/modules/welcome/checker/GeneralRequirements.cpp b/src/modules/welcome/checker/GeneralRequirements.cpp index 0c467124f..cebfc1a4b 100644 --- a/src/modules/welcome/checker/GeneralRequirements.cpp +++ b/src/modules/welcome/checker/GeneralRequirements.cpp @@ -230,7 +230,7 @@ GeneralRequirements::checkRequirements() } if ( entry == "slow-false" ) { - sleep(3); + sleep( 3 ); checkEntries.append( { entry, [] { return tr( "is always false (slowly)" ); }, [] { return tr( "The computer says no (slowly)." ); }, @@ -247,7 +247,7 @@ GeneralRequirements::checkRequirements() } if ( entry == "slow-true" ) { - sleep(3); + sleep( 3 ); checkEntries.append( { entry, [] { return tr( "is always true (slowly)" ); }, [] { return tr( "The computer says yes (slowly)." ); }, diff --git a/src/modules/welcomeq/WelcomeQmlViewStep.h b/src/modules/welcomeq/WelcomeQmlViewStep.h index 1ed90ce05..12beb4dde 100644 --- a/src/modules/welcomeq/WelcomeQmlViewStep.h +++ b/src/modules/welcomeq/WelcomeQmlViewStep.h @@ -26,7 +26,7 @@ namespace CalamaresUtils namespace GeoIP { class Handler; -} +} // namespace GeoIP } // namespace CalamaresUtils