[usersq] Tidy job creation and unnecessary code
This commit is contained in:
parent
4ffa79d4cf
commit
e60f8bcd06
@ -12,16 +12,12 @@
|
||||
|
||||
#include "UsersQmlViewStep.h"
|
||||
|
||||
#include "SetHostNameJob.h"
|
||||
#include "SetPasswordJob.h"
|
||||
|
||||
#include "GlobalStorage.h"
|
||||
#include "JobQueue.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/NamedEnum.h"
|
||||
#include "utils/Variant.h"
|
||||
|
||||
#include "GlobalStorage.h"
|
||||
#include "JobQueue.h"
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( UsersQmlViewStepFactory, registerPlugin< UsersQmlViewStep >(); )
|
||||
|
||||
UsersQmlViewStep::UsersQmlViewStep( QObject* parent )
|
||||
@ -43,59 +39,41 @@ bool
|
||||
UsersQmlViewStep::isNextEnabled() const
|
||||
{
|
||||
return m_config->isReady();
|
||||
//return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
UsersQmlViewStep::isBackEnabled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
UsersQmlViewStep::isAtBeginning() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
UsersQmlViewStep::isAtEnd() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
QList< Calamares::job_ptr >
|
||||
Calamares::JobList
|
||||
UsersQmlViewStep::jobs() const
|
||||
{
|
||||
return m_jobs;
|
||||
return m_config->createJobs();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
UsersQmlViewStep::onActivate()
|
||||
{
|
||||
//m_config->onActivate();
|
||||
//QmlViewStep::onActivate();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
UsersQmlViewStep::onLeave()
|
||||
{
|
||||
m_jobs = m_config->createJobs();
|
||||
m_config->finalizeGlobalStorage();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
UsersQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
{
|
||||
m_config->setConfigurationMap( configurationMap );
|
||||
|
||||
Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last
|
||||
setContextProperty( "Users", m_config );
|
||||
}
|
||||
|
@ -12,14 +12,14 @@
|
||||
#ifndef USERSQMLVIEWSTEP_H
|
||||
#define USERSQMLVIEWSTEP_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <utils/PluginFactory.h>
|
||||
#include <viewpages/QmlViewStep.h>
|
||||
|
||||
#include <DllMacro.h>
|
||||
|
||||
// Config from users module
|
||||
#include "Config.h"
|
||||
|
||||
#include "DllMacro.h"
|
||||
#include "utils/PluginFactory.h"
|
||||
#include "viewpages/QmlViewStep.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
|
||||
class PLUGINDLLEXPORT UsersQmlViewStep : public Calamares::QmlViewStep
|
||||
@ -37,9 +37,8 @@ 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;
|
||||
|
||||
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
||||
@ -48,7 +47,6 @@ public:
|
||||
|
||||
private:
|
||||
Config* m_config;
|
||||
Calamares::JobList m_jobs;
|
||||
};
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( UsersQmlViewStepFactory )
|
||||
|
Loading…
Reference in New Issue
Block a user