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