[libcalamares] Apply newer clang-formatting

This commit is contained in:
Adriaan de Groot 2024-04-17 10:50:38 +02:00
parent 09dae0437e
commit 4625208ba2
6 changed files with 26 additions and 20 deletions

View File

@ -12,7 +12,7 @@
#define DLLMACRO_H #define DLLMACRO_H
#ifndef CALAMARES_EXPORT #ifndef CALAMARES_EXPORT
#define CALAMARES_EXPORT __attribute__((visibility("default"))) #define CALAMARES_EXPORT __attribute__( ( visibility( "default" ) ) )
#endif #endif
/* /*

View File

@ -135,8 +135,7 @@ PowerManagementInterface::inhibitSleep()
QStringLiteral( "/org/freedesktop/PowerManagement/Inhibit" ), QStringLiteral( "/org/freedesktop/PowerManagement/Inhibit" ),
QStringLiteral( "org.freedesktop.PowerManagement.Inhibit" ), QStringLiteral( "org.freedesktop.PowerManagement.Inhibit" ),
QStringLiteral( "Inhibit" ) ); QStringLiteral( "Inhibit" ) );
inhibitCall.setArguments( inhibitCall.setArguments( { { tr( "Calamares" ) }, { tr( "Installation in progress", "@status" ) } } );
{ { tr( "Calamares" ) }, { tr( "Installation in progress", "@status" ) } } );
auto asyncReply = sessionBus.asyncCall( inhibitCall ); auto asyncReply = sessionBus.asyncCall( inhibitCall );
auto* replyWatcher = new QDBusPendingCallWatcher( asyncReply, this ); auto* replyWatcher = new QDBusPendingCallWatcher( asyncReply, this );

View File

@ -74,7 +74,7 @@ public:
Interface interface() const { return m_interface; } Interface interface() const { return m_interface; }
bool isEmergency() const { return m_isEmergeny; } 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; } int weight() const { return m_weight < 1 ? 1 : m_weight; }
bool explicitWeight() const { return m_weight > 0; } bool explicitWeight() const { return m_weight > 0; }

View File

@ -26,17 +26,17 @@ namespace Packages
* Returns @c true if anything was changed, @c false otherwise. * Returns @c true if anything was changed, @c false otherwise.
*/ */
DLLEXPORT bool setGSPackageAdditions( Calamares::GlobalStorage* gs, DLLEXPORT bool setGSPackageAdditions( Calamares::GlobalStorage* gs,
const Calamares::ModuleSystem::InstanceKey& module, const Calamares::ModuleSystem::InstanceKey& module,
const QVariantList& installPackages, const QVariantList& installPackages,
const QVariantList& tryInstallPackages ); const QVariantList& tryInstallPackages );
/** @brief Sets the install-packages GS keys for the given module /** @brief Sets the install-packages GS keys for the given module
* *
* This replaces previously-set install-packages lists. Use this with * This replaces previously-set install-packages lists. Use this with
* plain lists of package names. It does not support try-install. * plain lists of package names. It does not support try-install.
*/ */
DLLEXPORT bool setGSPackageAdditions( Calamares::GlobalStorage* gs, DLLEXPORT bool setGSPackageAdditions( Calamares::GlobalStorage* gs,
const Calamares::ModuleSystem::InstanceKey& module, const Calamares::ModuleSystem::InstanceKey& module,
const QStringList& installPackages ); const QStringList& installPackages );
// void setGSPackageRemovals( const Calamares::ModuleSystem::InstanceKey& key, const QVariantList& removePackages ); // void setGSPackageRemovals( const Calamares::ModuleSystem::InstanceKey& key, const QVariantList& removePackages );
} // namespace Packages } // namespace Packages
} // namespace Calamares } // namespace Calamares

View File

@ -110,7 +110,8 @@ PartitionServiceTests::testUnitComparison()
} }
/* Operator to make the table in testUnitNormalisation_data easier to write */ /* 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 ); return qint64( m );
} }

View File

@ -24,39 +24,45 @@ namespace Units
{ {
/** User defined literals, 1_KB is 1 KiloByte (= 10^3 bytes) */ /** 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; return qint64( m ) * 1000;
} }
/** User defined literals, 1_KiB is 1 KibiByte (= 2^10 bytes) */ /** 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; return qint64( m ) * 1024;
} }
/** User defined literals, 1_MB is 1 MegaByte (= 10^6 bytes) */ /** 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) */ /** 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) */ /** 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) */ /** 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 } // namespace Units