From ba8811c62851f0412ac753d8fd1c633f7220ebdb Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 26 Mar 2020 11:08:55 +0100 Subject: [PATCH] [keyboard] Apply coding style - Include order - ci/calamaresstyle - modern alias for job-list --- src/modules/keyboard/KeyboardViewStep.cpp | 44 +++++++++++++---------- src/modules/keyboard/KeyboardViewStep.h | 11 +++--- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/modules/keyboard/KeyboardViewStep.cpp b/src/modules/keyboard/KeyboardViewStep.cpp index 40a5385a3..472ffbe7e 100644 --- a/src/modules/keyboard/KeyboardViewStep.cpp +++ b/src/modules/keyboard/KeyboardViewStep.cpp @@ -18,12 +18,12 @@ #include "KeyboardViewStep.h" -#include "JobQueue.h" -#include "GlobalStorage.h" - #include "KeyboardPage.h" -CALAMARES_PLUGIN_FACTORY_DEFINITION( KeyboardViewStepFactory, registerPlugin(); ) +#include "GlobalStorage.h" +#include "JobQueue.h" + +CALAMARES_PLUGIN_FACTORY_DEFINITION( KeyboardViewStepFactory, registerPlugin< KeyboardViewStep >(); ) KeyboardViewStep::KeyboardViewStep( QObject* parent ) : Calamares::ViewStep( parent ) @@ -40,7 +40,9 @@ KeyboardViewStep::KeyboardViewStep( QObject* parent ) KeyboardViewStep::~KeyboardViewStep() { if ( m_widget && m_widget->parent() == nullptr ) + { m_widget->deleteLater(); + } } @@ -111,9 +113,7 @@ void KeyboardViewStep::onLeave() { m_widget->finalize(); - m_jobs = m_widget->createJobs( m_xOrgConfFileName, - m_convertedKeymapPath, - m_writeEtcDefaultKeyboard ); + m_jobs = m_widget->createJobs( m_xOrgConfFileName, m_convertedKeymapPath, m_writeEtcDefaultKeyboard ); m_prettyStatus = m_widget->prettyStatus(); } @@ -121,29 +121,35 @@ KeyboardViewStep::onLeave() void KeyboardViewStep::setConfigurationMap( const QVariantMap& configurationMap ) { - if ( configurationMap.contains( "xOrgConfFileName" ) && - configurationMap.value( "xOrgConfFileName" ).type() == QVariant::String && - !configurationMap.value( "xOrgConfFileName" ).toString().isEmpty() ) + if ( configurationMap.contains( "xOrgConfFileName" ) + && configurationMap.value( "xOrgConfFileName" ).type() == QVariant::String + && !configurationMap.value( "xOrgConfFileName" ).toString().isEmpty() ) { - m_xOrgConfFileName = configurationMap.value( "xOrgConfFileName" ) - .toString(); + m_xOrgConfFileName = configurationMap.value( "xOrgConfFileName" ).toString(); } else + { m_xOrgConfFileName = "00-keyboard.conf"; + } - if ( configurationMap.contains( "convertedKeymapPath" ) && - configurationMap.value( "convertedKeymapPath" ).type() == QVariant::String && - !configurationMap.value( "convertedKeymapPath" ).toString().isEmpty() ) + if ( configurationMap.contains( "convertedKeymapPath" ) + && configurationMap.value( "convertedKeymapPath" ).type() == QVariant::String + && !configurationMap.value( "convertedKeymapPath" ).toString().isEmpty() ) { - m_convertedKeymapPath = configurationMap.value( "convertedKeymapPath" ) - .toString(); + m_convertedKeymapPath = configurationMap.value( "convertedKeymapPath" ).toString(); } else + { m_convertedKeymapPath = QString(); + } - if ( configurationMap.contains( "writeEtcDefaultKeyboard" ) && - configurationMap.value( "writeEtcDefaultKeyboard" ).type() == QVariant::Bool ) + if ( configurationMap.contains( "writeEtcDefaultKeyboard" ) + && configurationMap.value( "writeEtcDefaultKeyboard" ).type() == QVariant::Bool ) + { m_writeEtcDefaultKeyboard = configurationMap.value( "writeEtcDefaultKeyboard" ).toBool(); + } else + { m_writeEtcDefaultKeyboard = true; + } } diff --git a/src/modules/keyboard/KeyboardViewStep.h b/src/modules/keyboard/KeyboardViewStep.h index ed072c834..208d50686 100644 --- a/src/modules/keyboard/KeyboardViewStep.h +++ b/src/modules/keyboard/KeyboardViewStep.h @@ -20,12 +20,11 @@ #ifndef KEYBOARDVIEWSTEP_H #define KEYBOARDVIEWSTEP_H -#include - +#include "DllMacro.h" #include "utils/PluginFactory.h" #include "viewpages/ViewStep.h" -#include "DllMacro.h" +#include class KeyboardPage; @@ -48,7 +47,7 @@ public: bool isAtBeginning() const override; bool isAtEnd() const override; - QList< Calamares::job_ptr > jobs() const override; + Calamares::JobList jobs() const override; void onActivate() override; void onLeave() override; @@ -64,9 +63,9 @@ private: QString m_convertedKeymapPath; bool m_writeEtcDefaultKeyboard; - QList< Calamares::job_ptr > m_jobs; + Calamares::JobList m_jobs; }; CALAMARES_PLUGIN_FACTORY_DECLARATION( KeyboardViewStepFactory ) -#endif // KEYBOARDVIEWSTEP_H +#endif // KEYBOARDVIEWSTEP_H