[keyboard] Apply coding style

- Include order
- ci/calamaresstyle
- modern alias for job-list
This commit is contained in:
Adriaan de Groot 2020-03-26 11:08:55 +01:00
parent df0a98b2a4
commit ba8811c628
2 changed files with 30 additions and 25 deletions

View File

@ -18,12 +18,12 @@
#include "KeyboardViewStep.h"
#include "JobQueue.h"
#include "GlobalStorage.h"
#include "KeyboardPage.h"
CALAMARES_PLUGIN_FACTORY_DEFINITION( KeyboardViewStepFactory, registerPlugin<KeyboardViewStep>(); )
#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;
}
}

View File

@ -20,12 +20,11 @@
#ifndef KEYBOARDVIEWSTEP_H
#define KEYBOARDVIEWSTEP_H
#include <QObject>
#include "DllMacro.h"
#include "utils/PluginFactory.h"
#include "viewpages/ViewStep.h"
#include "DllMacro.h"
#include <QObject>
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