[welcomeq] Coding style

- Apply coding style tool
- Remove commented-out cruft
- Drop TODO's that don't apply anymore
This commit is contained in:
Adriaan de Groot 2020-05-12 14:47:31 +02:00
parent ab6c6a6748
commit e930c74e85
2 changed files with 27 additions and 36 deletions

View File

@ -22,9 +22,9 @@
#include "checker/GeneralRequirements.h" #include "checker/GeneralRequirements.h"
#include "locale/LabelModel.h" #include "locale/LabelModel.h"
#include "utils/Dirs.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "utils/Variant.h" #include "utils/Variant.h"
#include "utils/Dirs.h"
#include "Branding.h" #include "Branding.h"
#include "modulesystem/ModuleManager.h" #include "modulesystem/ModuleManager.h"
@ -33,17 +33,10 @@
CALAMARES_PLUGIN_FACTORY_DEFINITION( WelcomeQmlViewStepFactory, registerPlugin< WelcomeQmlViewStep >(); ) CALAMARES_PLUGIN_FACTORY_DEFINITION( WelcomeQmlViewStepFactory, registerPlugin< WelcomeQmlViewStep >(); )
WelcomeQmlViewStep::WelcomeQmlViewStep( QObject* parent ) WelcomeQmlViewStep::WelcomeQmlViewStep( QObject* parent )
: Calamares::QmlViewStep(parent ) : Calamares::QmlViewStep( parent )
, m_config( new Config( this ) ) // the qml singleton takes ownership and deletes it , m_config( new Config( this ) )
// , m_nextEnabled( false )
, m_requirementsChecker( new GeneralRequirements( this ) ) , m_requirementsChecker( new GeneralRequirements( this ) )
{ {
// connect( m_config,
// &Config::isNextEnabledChanged,
// this,
// &WelcomeQmlViewStep::nextStatusChanged );
// emit nextStatusChanged(true);
} }
@ -57,7 +50,7 @@ bool
WelcomeQmlViewStep::isNextEnabled() const WelcomeQmlViewStep::isNextEnabled() const
{ {
// TODO: should return true // TODO: should return true
// return m_config->property("isNextEnabled").toBool(); // return m_config->property("isNextEnabled").toBool();
return true; return true;
} }
@ -96,16 +89,16 @@ WelcomeQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
{ {
m_config->setConfigurationMap( configurationMap ); m_config->setConfigurationMap( configurationMap );
// TODO: figure out how the requirements (held by ModuleManager) should be accessible
// to QML as a model. //will be model as a qvariantmap containing a alert level and the message string
if ( configurationMap.contains( "requirements" ) if ( configurationMap.contains( "requirements" )
&& configurationMap.value( "requirements" ).type() == QVariant::Map ) && configurationMap.value( "requirements" ).type() == QVariant::Map )
{ {
m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() ); m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() );
} }
else else
cWarning() << "no valid requirements map found in welcome " {
cWarning() << "no valid requirements map found in welcomeq "
"module configuration."; "module configuration.";
}
Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last
setContextProperty( "Welcome", m_config ); setContextProperty( "Welcome", m_config );
@ -122,4 +115,3 @@ WelcomeQmlViewStep::getConfig()
{ {
return m_config; return m_config;
} }

View File

@ -47,7 +47,6 @@ class PLUGINDLLEXPORT WelcomeQmlViewStep : public Calamares::QmlViewStep
Q_OBJECT Q_OBJECT
public: public:
explicit WelcomeQmlViewStep( QObject* parent = nullptr ); explicit WelcomeQmlViewStep( QObject* parent = nullptr );
QString prettyName() const override; QString prettyName() const override;
@ -75,7 +74,7 @@ public:
private: private:
// TODO: a generic QML viewstep should return a config object from a method // TODO: a generic QML viewstep should return a config object from a method
Config *m_config; Config* m_config;
GeneralRequirements* m_requirementsChecker; GeneralRequirements* m_requirementsChecker;
}; };