CI: apply coding style (clang-format 13)

This commit is contained in:
Adriaan de Groot 2022-06-27 00:37:15 +02:00
parent 5a14c3c76f
commit 1c7c0b9af8
30 changed files with 43 additions and 50 deletions

View File

@ -18,7 +18,7 @@ class CalamaresWindow;
namespace Calamares
{
class ModuleManager;
}
} // namespace Calamares
/**

View File

@ -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 ) );

View File

@ -26,7 +26,7 @@ namespace Calamares
namespace Ui
{
class DebugWindow;
}
} // namespace Ui
class DebugWindow : public QWidget
{

View File

@ -19,7 +19,7 @@
namespace Calamares
{
class GlobalStorage;
}
} // namespace Calamares
namespace CalamaresPython
{

View File

@ -18,7 +18,7 @@
namespace Calamares
{
class PythonJob;
}
} // namespace Calamares
namespace CalamaresPython
{

View File

@ -28,7 +28,7 @@
namespace Calamares
{
class GlobalStorage;
}
} // namespace Calamares
namespace CalamaresUtils
{

View File

@ -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;

View File

@ -28,7 +28,7 @@
namespace YAML
{
class Node;
}
} // namespace YAML
namespace Calamares
{

View File

@ -30,9 +30,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "waitingspinnerwidget.h"
#include <qmath.h>
#include <QPainter>
#include <QTimer>
#include <qmath.h>
static bool
isAlignCenter( Qt::AlignmentFlag a )

View File

@ -22,11 +22,11 @@
namespace CalamaresUtils
{
class CommandList;
}
} // namespace CalamaresUtils
namespace Calamares
{
class GlobalStorage;
}
} // namespace Calamares
struct ValueCheck : public QPair< QString, CalamaresUtils::CommandList* >
{

View File

@ -20,7 +20,7 @@ class Config;
namespace Ui
{
class FinishedPage;
}
} // namespace Ui
class FinishedPage : public QWidget
{

View File

@ -25,7 +25,7 @@
namespace Ui
{
class Page_Keyboard;
}
} // namespace Ui
class Config;
class KeyBoardPreview;

View File

@ -21,7 +21,7 @@
namespace Ui
{
class LicensePage;
}
} // namespace Ui
class LicenseWidget;

View File

@ -17,8 +17,8 @@
#include "GlobalStorage.h"
#include "JobQueue.h"
#include <QRegularExpression>
#include <QDir>
#include <QRegularExpression>
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;
}
}

View File

@ -29,7 +29,7 @@ class QNetworkReply;
namespace Ui
{
class Page_NetInst;
}
} // namespace Ui
class NetInstallPage : public QWidget
{

View File

@ -20,7 +20,7 @@
namespace YAML
{
class Node;
}
} // namespace YAML
class PackageModel : public QAbstractItemModel
{

View File

@ -15,7 +15,7 @@
namespace AppStream
{
class Pool;
}
} // namespace AppStream
/** @brief Loads an item from AppStream data.
*

View File

@ -19,7 +19,7 @@
namespace Ui
{
class PackageChooserPage;
}
} // namespace Ui
class PackageChooserPage : public QWidget
{

View File

@ -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() )
{

View File

@ -27,7 +27,7 @@ class Partition;
namespace Logger
{
class Once;
}
} // namespace Logger
namespace PartUtils
{

View File

@ -33,7 +33,7 @@ namespace Calamares
namespace Widgets
{
class PrettyRadioButton;
}
} // namespace Widgets
} // namespace Calamares
class Config;

View File

@ -17,7 +17,7 @@
namespace Ui
{
class EncryptWidget;
}
} // namespace Ui
class EncryptWidget : public QWidget
{

View File

@ -17,7 +17,7 @@
namespace Ui
{
class VolumeGroupBaseDialog;
}
} // namespace Ui
class QComboBox;
class QLineEdit;

View File

@ -15,7 +15,7 @@
namespace Ui
{
class PlasmaLnfPage;
}
} // namespace Ui
class Config;

View File

@ -19,7 +19,7 @@
namespace Ui
{
class TrackingPage;
}
} // namespace Ui
class Config;
class TrackingStyleConfig;

View File

@ -25,7 +25,7 @@ class QLabel;
namespace Ui
{
class Page_UserSetup;
}
} // namespace Ui
class UsersPage : public QWidget
{

View File

@ -19,7 +19,7 @@
namespace Ui
{
class WelcomePage;
}
} // namespace Ui
class CheckerContainer;
class Config;

View File

@ -28,7 +28,7 @@ namespace CalamaresUtils
namespace GeoIP
{
class Handler;
}
} // namespace GeoIP
} // namespace CalamaresUtils
class PLUGINDLLEXPORT WelcomeViewStep : public Calamares::ViewStep

View File

@ -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)." ); },

View File

@ -26,7 +26,7 @@ namespace CalamaresUtils
namespace GeoIP
{
class Handler;
}
} // namespace GeoIP
} // namespace CalamaresUtils