From 4625208ba2223837c7e018ab3121d270c0f0288c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 17 Apr 2024 10:50:38 +0200 Subject: [PATCH] [libcalamares] Apply newer clang-formatting --- src/libcalamares/DllMacro.h | 2 +- src/libcalamares/JobQueue.cpp | 3 +-- src/libcalamares/modulesystem/Descriptor.h | 2 +- src/libcalamares/packages/Globals.h | 10 ++++----- src/libcalamares/partition/Tests.cpp | 3 ++- src/libcalamares/utils/Units.h | 26 +++++++++++++--------- 6 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/libcalamares/DllMacro.h b/src/libcalamares/DllMacro.h index 77b25c6a6..f144d4650 100644 --- a/src/libcalamares/DllMacro.h +++ b/src/libcalamares/DllMacro.h @@ -12,7 +12,7 @@ #define DLLMACRO_H #ifndef CALAMARES_EXPORT -#define CALAMARES_EXPORT __attribute__((visibility("default"))) +#define CALAMARES_EXPORT __attribute__( ( visibility( "default" ) ) ) #endif /* diff --git a/src/libcalamares/JobQueue.cpp b/src/libcalamares/JobQueue.cpp index 8f079a9f0..d35ae4514 100644 --- a/src/libcalamares/JobQueue.cpp +++ b/src/libcalamares/JobQueue.cpp @@ -135,8 +135,7 @@ PowerManagementInterface::inhibitSleep() QStringLiteral( "/org/freedesktop/PowerManagement/Inhibit" ), QStringLiteral( "org.freedesktop.PowerManagement.Inhibit" ), QStringLiteral( "Inhibit" ) ); - inhibitCall.setArguments( - { { tr( "Calamares" ) }, { tr( "Installation in progress", "@status" ) } } ); + inhibitCall.setArguments( { { tr( "Calamares" ) }, { tr( "Installation in progress", "@status" ) } } ); auto asyncReply = sessionBus.asyncCall( inhibitCall ); auto* replyWatcher = new QDBusPendingCallWatcher( asyncReply, this ); diff --git a/src/libcalamares/modulesystem/Descriptor.h b/src/libcalamares/modulesystem/Descriptor.h index 9682b2efc..b3eeface7 100644 --- a/src/libcalamares/modulesystem/Descriptor.h +++ b/src/libcalamares/modulesystem/Descriptor.h @@ -74,7 +74,7 @@ public: Interface interface() const { return m_interface; } bool isEmergency() const { return m_isEmergeny; } - bool hasConfig() const { return m_hasConfig; } // TODO: 3.5 rename to noConfig() to match descriptor key + bool hasConfig() const { return m_hasConfig; } // TODO: 3.5 rename to noConfig() to match descriptor key int weight() const { return m_weight < 1 ? 1 : m_weight; } bool explicitWeight() const { return m_weight > 0; } diff --git a/src/libcalamares/packages/Globals.h b/src/libcalamares/packages/Globals.h index 4b12e76a3..ad8d15e9d 100644 --- a/src/libcalamares/packages/Globals.h +++ b/src/libcalamares/packages/Globals.h @@ -26,17 +26,17 @@ namespace Packages * Returns @c true if anything was changed, @c false otherwise. */ DLLEXPORT bool setGSPackageAdditions( Calamares::GlobalStorage* gs, - const Calamares::ModuleSystem::InstanceKey& module, - const QVariantList& installPackages, - const QVariantList& tryInstallPackages ); + const Calamares::ModuleSystem::InstanceKey& module, + const QVariantList& installPackages, + const QVariantList& tryInstallPackages ); /** @brief Sets the install-packages GS keys for the given module * * This replaces previously-set install-packages lists. Use this with * plain lists of package names. It does not support try-install. */ DLLEXPORT bool setGSPackageAdditions( Calamares::GlobalStorage* gs, - const Calamares::ModuleSystem::InstanceKey& module, - const QStringList& installPackages ); + const Calamares::ModuleSystem::InstanceKey& module, + const QStringList& installPackages ); // void setGSPackageRemovals( const Calamares::ModuleSystem::InstanceKey& key, const QVariantList& removePackages ); } // namespace Packages } // namespace Calamares diff --git a/src/libcalamares/partition/Tests.cpp b/src/libcalamares/partition/Tests.cpp index 582accf8c..a1ad3b708 100644 --- a/src/libcalamares/partition/Tests.cpp +++ b/src/libcalamares/partition/Tests.cpp @@ -110,7 +110,8 @@ PartitionServiceTests::testUnitComparison() } /* Operator to make the table in testUnitNormalisation_data easier to write */ -constexpr qint64 operator""_qi( unsigned long long m ) +constexpr qint64 +operator""_qi( unsigned long long m ) { return qint64( m ); } diff --git a/src/libcalamares/utils/Units.h b/src/libcalamares/utils/Units.h index 173f83a24..824679b26 100644 --- a/src/libcalamares/utils/Units.h +++ b/src/libcalamares/utils/Units.h @@ -24,39 +24,45 @@ namespace Units { /** User defined literals, 1_KB is 1 KiloByte (= 10^3 bytes) */ -constexpr qint64 operator""_KB( unsigned long long m ) +constexpr qint64 +operator""_KB( unsigned long long m ) { return qint64( m ) * 1000; } /** User defined literals, 1_KiB is 1 KibiByte (= 2^10 bytes) */ -constexpr qint64 operator""_KiB( unsigned long long m ) +constexpr qint64 +operator""_KiB( unsigned long long m ) { return qint64( m ) * 1024; } /** User defined literals, 1_MB is 1 MegaByte (= 10^6 bytes) */ -constexpr qint64 operator""_MB( unsigned long long m ) +constexpr qint64 +operator""_MB( unsigned long long m ) { - return operator""_KB(m)*1000; + return operator""_KB( m ) * 1000; } /** User defined literals, 1_MiB is 1 MibiByte (= 2^20 bytes) */ -constexpr qint64 operator""_MiB( unsigned long long m ) +constexpr qint64 +operator""_MiB( unsigned long long m ) { - return operator""_KiB(m)*1024; + return operator""_KiB( m ) * 1024; } /** User defined literals, 1_GB is 1 GigaByte (= 10^9 bytes) */ -constexpr qint64 operator""_GB( unsigned long long m ) +constexpr qint64 +operator""_GB( unsigned long long m ) { - return operator""_MB(m)*1000; + return operator""_MB( m ) * 1000; } /** User defined literals, 1_GiB is 1 GibiByte (= 2^30 bytes) */ -constexpr qint64 operator""_GiB( unsigned long long m ) +constexpr qint64 +operator""_GiB( unsigned long long m ) { - return operator""_MiB(m)*1024; + return operator""_MiB( m ) * 1024; } } // namespace Units