Massive refactor of module loading, configuration, startup, management.
This commit is contained in:
parent
c74c67805e
commit
fb44fb97b6
@ -86,7 +86,7 @@ CalamaresApplication::init()
|
|||||||
setWindowIcon( QIcon( Calamares::Branding::instance()->
|
setWindowIcon( QIcon( Calamares::Branding::instance()->
|
||||||
imagePath( Calamares::Branding::ProductIcon ) ) );
|
imagePath( Calamares::Branding::ProductIcon ) ) );
|
||||||
|
|
||||||
initPlugins(); //also shows main window
|
initModuleManager(); //also shows main window
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -133,13 +133,6 @@ CalamaresApplication::mainWindow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
CalamaresApplication::startPhase( Calamares::Phase phase )
|
|
||||||
{
|
|
||||||
m_moduleManager->loadModules( phase );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CalamaresApplication::initQmlPath()
|
CalamaresApplication::initQmlPath()
|
||||||
{
|
{
|
||||||
@ -322,62 +315,40 @@ CalamaresApplication::initBranding()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CalamaresApplication::initPlugins()
|
CalamaresApplication::initModuleManager()
|
||||||
{
|
{
|
||||||
m_moduleManager = new Calamares::ModuleManager(
|
m_moduleManager = new Calamares::ModuleManager(
|
||||||
Calamares::Settings::instance()->modulesSearchPaths(), this );
|
Calamares::Settings::instance()->modulesSearchPaths(), this );
|
||||||
connect( m_moduleManager, &Calamares::ModuleManager::initDone,
|
connect( m_moduleManager, &Calamares::ModuleManager::initDone,
|
||||||
this, &CalamaresApplication::onPluginsReady );
|
this, &CalamaresApplication::initView );
|
||||||
m_moduleManager->init();
|
m_moduleManager->init();
|
||||||
|
|
||||||
connect( m_moduleManager, &Calamares::ModuleManager::modulesLoaded,
|
|
||||||
this, [this]( Calamares::Phase phase )
|
|
||||||
{
|
|
||||||
if ( phase == Calamares::Prepare )
|
|
||||||
{
|
|
||||||
m_mainwindow->show();
|
|
||||||
|
|
||||||
ProgressTreeModel* m = new ProgressTreeModel( this );
|
|
||||||
ProgressTreeView::instance()->setModel( m );
|
|
||||||
|
|
||||||
Calamares::ViewManager::instance()->setUpInstallationStep();
|
|
||||||
}
|
|
||||||
else if ( phase == Calamares::Install )
|
|
||||||
{
|
|
||||||
Calamares::ViewManager* vm = Calamares::ViewManager::instance();
|
|
||||||
Calamares::JobQueue* queue = Calamares::JobQueue::instance();
|
|
||||||
|
|
||||||
for( const QString& name : Calamares::Settings::instance()->modules( Calamares::Install ) )
|
|
||||||
{
|
|
||||||
Calamares::Module* module = m_moduleManager->module( name );
|
|
||||||
queue->enqueue( module->jobs() );
|
|
||||||
}
|
|
||||||
connect( queue, &Calamares::JobQueue::failed,
|
|
||||||
vm, &Calamares::ViewManager::onInstallationFailed );
|
|
||||||
|
|
||||||
queue->start();
|
|
||||||
}
|
|
||||||
else if ( phase == Calamares::PostInstall )
|
|
||||||
{
|
|
||||||
Calamares::ViewManager::instance()->next();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CalamaresApplication::onPluginsReady()
|
CalamaresApplication::initView()
|
||||||
{
|
{
|
||||||
initJobQueue();
|
initJobQueue();
|
||||||
|
|
||||||
m_mainwindow = new CalamaresWindow(); //also creates ViewManager
|
m_mainwindow = new CalamaresWindow(); //also creates ViewManager
|
||||||
connect( Calamares::ViewManager::instance(), &Calamares::ViewManager::phaseChangeRequested,
|
|
||||||
this, &CalamaresApplication::startPhase );
|
|
||||||
|
|
||||||
startPhase( Calamares::Prepare );
|
connect( m_moduleManager, &Calamares::ModuleManager::modulesLoaded,
|
||||||
|
this, &CalamaresApplication::initViewSteps );
|
||||||
|
|
||||||
|
m_moduleManager->loadModules();
|
||||||
|
|
||||||
m_mainwindow->move(
|
m_mainwindow->move(
|
||||||
this->desktop()->availableGeometry().center() - m_mainwindow->rect().center()
|
this->desktop()->availableGeometry().center() -
|
||||||
);
|
m_mainwindow->rect().center() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
CalamaresApplication::initViewSteps()
|
||||||
|
{
|
||||||
|
m_mainwindow->show();
|
||||||
|
ProgressTreeModel* m = new ProgressTreeModel( this );
|
||||||
|
ProgressTreeView::instance()->setModel( m );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||||
*
|
*
|
||||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||||
*
|
*
|
||||||
* Calamares is free software: you can redistribute it and/or modify
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -47,16 +47,15 @@ public:
|
|||||||
|
|
||||||
CalamaresWindow* mainWindow();
|
CalamaresWindow* mainWindow();
|
||||||
|
|
||||||
void startPhase( Calamares::Phase phase );
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onPluginsReady();
|
void initView();
|
||||||
|
void initViewSteps();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initQmlPath();
|
void initQmlPath();
|
||||||
void initSettings();
|
void initSettings();
|
||||||
void initBranding();
|
void initBranding();
|
||||||
void initPlugins();
|
void initModuleManager();
|
||||||
void initJobQueue();
|
void initJobQueue();
|
||||||
|
|
||||||
CalamaresWindow* m_mainwindow;
|
CalamaresWindow* m_mainwindow;
|
||||||
|
@ -46,12 +46,6 @@ name: "foo" #the module name. must be unique and same as the parent di
|
|||||||
interface: "qtplugin" #can be: qtplugin, python, process, ...
|
interface: "qtplugin" #can be: qtplugin, python, process, ...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
|
||||||
operator>>( const YAML::Node& node, Calamares::Module* m )
|
|
||||||
{
|
|
||||||
m->m_name = QString::fromStdString( node[ "name" ].as< std::string >() );
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -59,83 +53,76 @@ Module::~Module()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
Module*
|
Module*
|
||||||
Module::fromDescriptorFile( const QString& path )
|
Module::fromDescriptor( const QVariantMap& moduleDescriptor,
|
||||||
|
const QString& instanceId,
|
||||||
|
const QString& configFileName,
|
||||||
|
const QString& moduleDirectory )
|
||||||
{
|
{
|
||||||
Module* m = nullptr;
|
Module* m = nullptr;
|
||||||
QFile descriptorFile( path );
|
|
||||||
if ( descriptorFile.exists() && descriptorFile.open( QFile::ReadOnly | QFile::Text ) )
|
QString typeString = moduleDescriptor.value( "type" ).toString();
|
||||||
|
QString intfString = moduleDescriptor.value( "interface" ).toString();
|
||||||
|
|
||||||
|
if ( typeString.isEmpty() ||
|
||||||
|
intfString.isEmpty() )
|
||||||
{
|
{
|
||||||
QByteArray ba = descriptorFile.readAll();
|
cLog() << Q_FUNC_INFO << "bad module descriptor format"
|
||||||
cDebug() << "Loading module.desc for" << QFileInfo( descriptorFile ).dir().dirName();
|
<< instanceId;
|
||||||
|
return nullptr;
|
||||||
try
|
}
|
||||||
|
if ( typeString == "view" && intfString == "qtplugin" )
|
||||||
|
{
|
||||||
|
m = new ViewModule();
|
||||||
|
}
|
||||||
|
else if ( typeString == "job" )
|
||||||
|
{
|
||||||
|
if ( intfString == "process" )
|
||||||
{
|
{
|
||||||
YAML::Node doc = YAML::Load( ba.constData() );
|
m = new ProcessJobModule();
|
||||||
if ( !doc.IsMap() )
|
}
|
||||||
{
|
|
||||||
cLog() << Q_FUNC_INFO << "bad module descriptor format"
|
|
||||||
<< path;
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !doc[ "type" ] ||
|
|
||||||
!doc[ "interface" ] )
|
|
||||||
{
|
|
||||||
cLog() << Q_FUNC_INFO << "bad module descriptor format"
|
|
||||||
<< path;
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString typeString = QString::fromStdString( doc[ "type" ].as< std::string >() );
|
|
||||||
QString intfString = QString::fromStdString( doc[ "interface" ].as< std::string >() );
|
|
||||||
|
|
||||||
if ( typeString == "view" && intfString == "qtplugin" )
|
|
||||||
{
|
|
||||||
m = new ViewModule();
|
|
||||||
}
|
|
||||||
else if ( typeString == "job" )
|
|
||||||
{
|
|
||||||
if ( intfString == "process" )
|
|
||||||
{
|
|
||||||
m = new ProcessJobModule();
|
|
||||||
}
|
|
||||||
#ifdef WITH_PYTHON
|
#ifdef WITH_PYTHON
|
||||||
else if ( intfString == "python" )
|
else if ( intfString == "python" )
|
||||||
{
|
|
||||||
m = new PythonJobModule();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !m )
|
|
||||||
{
|
|
||||||
cLog() << Q_FUNC_INFO << "bad module type or interface string"
|
|
||||||
<< path << typeString << intfString;
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
QFileInfo mfi( path );
|
|
||||||
m->m_directory = mfi.absoluteDir().absolutePath();
|
|
||||||
|
|
||||||
m->initFrom( doc );
|
|
||||||
m->loadConfigurationFile();
|
|
||||||
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
catch ( YAML::Exception& e )
|
|
||||||
{
|
{
|
||||||
cDebug() << "WARNING: YAML parser error " << e.what();
|
m = new PythonJobModule();
|
||||||
delete m;
|
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if ( !m )
|
||||||
|
{
|
||||||
|
cLog() << Q_FUNC_INFO << "bad module type or interface string"
|
||||||
|
<< instanceId << typeString << intfString;
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
QDir moduleDir( moduleDirectory );
|
||||||
|
if ( moduleDir.exists() && moduleDir.isReadable() )
|
||||||
|
m->m_directory = moduleDir.absolutePath();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cLog() << Q_FUNC_INFO << "bad module directory"
|
||||||
|
<< instanceId;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
m->m_instanceId = instanceId;
|
||||||
|
|
||||||
|
m->initFrom( moduleDescriptor );
|
||||||
|
try
|
||||||
|
{
|
||||||
|
m->loadConfigurationFile( configFileName );
|
||||||
|
}
|
||||||
|
catch ( YAML::Exception& e )
|
||||||
|
{
|
||||||
|
cDebug() << "WARNING: YAML parser error " << e.what();
|
||||||
|
delete m;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Module::loadConfigurationFile() //throws YAML::Exception
|
Module::loadConfigurationFile( const QString& configFileName ) //throws YAML::Exception
|
||||||
{
|
{
|
||||||
QStringList configFilesByPriority;
|
QStringList configFilesByPriority;
|
||||||
|
|
||||||
@ -143,7 +130,7 @@ Module::loadConfigurationFile() //throws YAML::Exception
|
|||||||
{
|
{
|
||||||
configFilesByPriority.append(
|
configFilesByPriority.append(
|
||||||
CalamaresUtils::appDataDir().absoluteFilePath(
|
CalamaresUtils::appDataDir().absoluteFilePath(
|
||||||
QString( "modules/%1.conf" ).arg( m_name ) ) );
|
QString( "modules/%1" ).arg( configFileName ) ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -151,14 +138,15 @@ Module::loadConfigurationFile() //throws YAML::Exception
|
|||||||
{
|
{
|
||||||
configFilesByPriority.append(
|
configFilesByPriority.append(
|
||||||
QDir( QDir::currentPath() ).absoluteFilePath(
|
QDir( QDir::currentPath() ).absoluteFilePath(
|
||||||
QString( "src/modules/%1/%1.conf" ).arg( m_name ) ) );
|
QString( "src/modules/%1/%2" ).arg( m_name )
|
||||||
|
.arg( configFileName ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
configFilesByPriority.append(
|
configFilesByPriority.append(
|
||||||
QString( "/etc/calamares/modules/%1.conf" ).arg( m_name ) );
|
QString( "/etc/calamares/modules/%1" ).arg( configFileName ) );
|
||||||
configFilesByPriority.append(
|
configFilesByPriority.append(
|
||||||
CalamaresUtils::appDataDir().absoluteFilePath(
|
CalamaresUtils::appDataDir().absoluteFilePath(
|
||||||
QString( "modules/%1.conf" ).arg( m_name ) ) );
|
QString( "modules/%2" ).arg( configFileName ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ( const QString& path, configFilesByPriority )
|
foreach ( const QString& path, configFilesByPriority )
|
||||||
@ -192,6 +180,21 @@ Module::name() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString
|
||||||
|
Module::instanceId() const
|
||||||
|
{
|
||||||
|
return m_instanceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString
|
||||||
|
Module::instanceKey() const
|
||||||
|
{
|
||||||
|
return QString( "%1@%2" ).arg( m_name )
|
||||||
|
.arg( m_instanceId );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QStringList
|
QStringList
|
||||||
Module::requiredModules() const
|
Module::requiredModules() const
|
||||||
{
|
{
|
||||||
@ -226,9 +229,9 @@ Module::Module()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Module::initFrom( const YAML::Node& node )
|
Module::initFrom( const QVariantMap& moduleDescriptor )
|
||||||
{
|
{
|
||||||
node >> this;
|
m_name = moduleDescriptor.value( "name" ).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
} //ns
|
} //ns
|
||||||
|
@ -27,17 +27,12 @@
|
|||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
|
||||||
namespace YAML
|
|
||||||
{
|
|
||||||
class Node;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
class Module;
|
class Module;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator>>( const YAML::Node& node, Calamares::Module* m );
|
void operator>>( const QVariantMap& moduleDescriptor, Calamares::Module* m );
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
@ -59,11 +54,16 @@ public:
|
|||||||
};
|
};
|
||||||
virtual ~Module();
|
virtual ~Module();
|
||||||
|
|
||||||
static Module* fromDescriptorFile( const QString& path );
|
static Module* fromDescriptor( const QVariantMap& moduleDescriptor,
|
||||||
|
const QString& instanceId,
|
||||||
|
const QString& configFileName,
|
||||||
|
const QString& moduleDirectory );
|
||||||
|
|
||||||
virtual QString name() const;
|
virtual QString name() const final;
|
||||||
|
virtual QString instanceId() const final;
|
||||||
|
virtual QString instanceKey() const final;
|
||||||
virtual QStringList requiredModules() const;
|
virtual QStringList requiredModules() const;
|
||||||
virtual QString location() const;
|
virtual QString location() const final;
|
||||||
virtual Type type() const = 0;
|
virtual Type type() const = 0;
|
||||||
virtual Interface interface() const = 0;
|
virtual Interface interface() const = 0;
|
||||||
|
|
||||||
@ -77,17 +77,19 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit Module();
|
explicit Module();
|
||||||
virtual void initFrom( const YAML::Node& node );
|
virtual void initFrom( const QVariantMap& moduleDescriptor );
|
||||||
bool m_loaded;
|
bool m_loaded;
|
||||||
QVariantMap m_configurationMap;
|
QVariantMap m_configurationMap;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadConfigurationFile(); //throws YAML::Exception
|
void loadConfigurationFile( const QString& configFileName ); //throws YAML::Exception
|
||||||
QString m_name;
|
QString m_name;
|
||||||
QStringList m_requiredModules;
|
QStringList m_requiredModules;
|
||||||
QString m_directory;
|
QString m_directory;
|
||||||
|
QString m_instanceId;
|
||||||
|
|
||||||
friend void ::operator>>( const YAML::Node& node, Calamares::Module* m );
|
friend void ::operator>>( const QVariantMap& moduleDescriptor,
|
||||||
|
Calamares::Module* m );
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,12 @@
|
|||||||
|
|
||||||
#include "ModuleManager.h"
|
#include "ModuleManager.h"
|
||||||
|
|
||||||
|
#include "ExecutionViewStep.h"
|
||||||
|
#include "Module.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
#include "utils/YamlUtils.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
#include "ViewManager.h"
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
#include <yaml-cpp/yaml.h>
|
||||||
|
|
||||||
@ -46,19 +50,14 @@ ModuleManager::instance()
|
|||||||
ModuleManager::ModuleManager( const QStringList& paths, QObject* parent )
|
ModuleManager::ModuleManager( const QStringList& paths, QObject* parent )
|
||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
, m_paths( paths )
|
, m_paths( paths )
|
||||||
, m_lastPhaseLoaded( Phase_NULL )
|
|
||||||
{
|
{
|
||||||
Q_ASSERT( !s_instance );
|
Q_ASSERT( !s_instance );
|
||||||
s_instance = this;
|
s_instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ModuleManager::~ModuleManager()
|
ModuleManager::~ModuleManager()
|
||||||
{
|
{}
|
||||||
foreach ( Module* m, m_availableModules )
|
|
||||||
{
|
|
||||||
delete m;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -68,70 +67,6 @@ ModuleManager::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QStringList
|
|
||||||
ModuleManager::availableModules()
|
|
||||||
{
|
|
||||||
return m_availableModules.keys();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Module*
|
|
||||||
ModuleManager::module( const QString& name )
|
|
||||||
{
|
|
||||||
return m_availableModules.value( name );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Phase
|
|
||||||
ModuleManager::currentPhase()
|
|
||||||
{
|
|
||||||
return m_lastPhaseLoaded;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
ModuleManager::loadModules( Phase phase )
|
|
||||||
{
|
|
||||||
//FIXME: When we depend on Qt 5.4 this ugly hack should be replaced with
|
|
||||||
// QTimer::singleShot.
|
|
||||||
QTimer* timer = new QTimer();
|
|
||||||
timer->setSingleShot( true );
|
|
||||||
connect( timer, &QTimer::timeout,
|
|
||||||
this, [ this, timer, phase ]()
|
|
||||||
{
|
|
||||||
foreach ( const QString& moduleName, Settings::instance()->modules( phase ) )
|
|
||||||
{
|
|
||||||
if ( !m_availableModules.contains( moduleName ) ||
|
|
||||||
!m_availableModules.value( moduleName ) )
|
|
||||||
{
|
|
||||||
cDebug() << "Module" << moduleName << "not found in module search paths."
|
|
||||||
<< "\nCalamares will now quit.";
|
|
||||||
qApp->exit( 1 );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Module* thisModule = m_availableModules.value( moduleName );
|
|
||||||
if ( thisModule && thisModule->isLoaded() )
|
|
||||||
{
|
|
||||||
cDebug() << "Module" << moduleName << "already loaded.";
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
doLoad( moduleName );
|
|
||||||
}
|
|
||||||
emit modulesLoaded( phase );
|
|
||||||
m_lastPhaseLoaded = phase;
|
|
||||||
// Loading sequence:
|
|
||||||
// 1) deps are already fine. check if we have all the modules needed by the roster
|
|
||||||
// 2) ask ModuleManager to load them from the list provided by Settings
|
|
||||||
// 3) MM must load them asyncly but one at a time, by calling Module::loadSelf
|
|
||||||
// 4) Module must have subclasses that reimplement loadSelf for various module types
|
|
||||||
|
|
||||||
timer->deleteLater();
|
|
||||||
});
|
|
||||||
timer->start( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ModuleManager::doInit()
|
ModuleManager::doInit()
|
||||||
{
|
{
|
||||||
@ -154,25 +89,47 @@ ModuleManager::doInit()
|
|||||||
bool success = currentDir.cd( subdir );
|
bool success = currentDir.cd( subdir );
|
||||||
if ( success )
|
if ( success )
|
||||||
{
|
{
|
||||||
QFileInfo metadataFileInfo( currentDir.absoluteFilePath( MODULE_CONFIG_FILENAME ) );
|
QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( MODULE_CONFIG_FILENAME ) );
|
||||||
if ( ! ( metadataFileInfo.exists() && metadataFileInfo.isReadable() ) )
|
if ( ! ( descriptorFileInfo.exists() && descriptorFileInfo.isReadable() ) )
|
||||||
{
|
{
|
||||||
cDebug() << Q_FUNC_INFO << "unreadable file: "
|
cDebug() << Q_FUNC_INFO << "unreadable file: "
|
||||||
<< metadataFileInfo.absoluteFilePath();
|
<< descriptorFileInfo.absoluteFilePath();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Module* moduleInfo = Module::fromDescriptorFile( metadataFileInfo.absoluteFilePath() );
|
QFile descriptorFile( descriptorFileInfo.absoluteFilePath() );
|
||||||
|
QVariant moduleDescriptor;
|
||||||
|
if ( descriptorFile.exists() && descriptorFile.open( QFile::ReadOnly | QFile::Text ) )
|
||||||
|
{
|
||||||
|
QByteArray ba = descriptorFile.readAll();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
YAML::Node doc = YAML::Load( ba.constData() );
|
||||||
|
|
||||||
if ( moduleInfo &&
|
moduleDescriptor = CalamaresUtils::yamlToVariant( doc );
|
||||||
( moduleInfo->name() == currentDir.dirName() ) &&
|
}
|
||||||
( !m_availableModules.contains( moduleInfo->name() ) ) )
|
catch ( YAML::Exception& e )
|
||||||
{
|
{
|
||||||
m_availableModules.insert( moduleInfo->name(), moduleInfo );
|
cDebug() << "WARNING: YAML parser error " << e.what();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
|
||||||
|
if ( moduleDescriptor.isValid() &&
|
||||||
|
!moduleDescriptor.isNull() &&
|
||||||
|
moduleDescriptor.type() == QVariant::Map )
|
||||||
{
|
{
|
||||||
delete moduleInfo;
|
QVariantMap moduleDescriptorMap = moduleDescriptor.toMap();
|
||||||
|
|
||||||
|
if ( moduleDescriptorMap.value( "name" ) == currentDir.dirName() &&
|
||||||
|
!m_availableDescriptorsByModuleName.contains( moduleDescriptorMap.value( "name" ).toString() ) )
|
||||||
|
{
|
||||||
|
m_availableDescriptorsByModuleName.insert( moduleDescriptorMap.value( "name" ).toString(),
|
||||||
|
moduleDescriptorMap );
|
||||||
|
m_moduleDirectoriesByModuleName.insert( moduleDescriptorMap.value( "name" ).toString(),
|
||||||
|
descriptorFileInfo.absoluteDir().absolutePath() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -194,19 +151,169 @@ ModuleManager::doInit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
QStringList
|
||||||
ModuleManager::doLoad( const QString& moduleName )
|
ModuleManager::loadedInstanceKeys()
|
||||||
{
|
{
|
||||||
Module* thisModule = m_availableModules.value( moduleName );
|
return m_loadedModulesByInstanceKey.keys();
|
||||||
if ( !thisModule )
|
}
|
||||||
{
|
|
||||||
cDebug() << "Module" << moduleName << "loading IMPOSSIBLE, module does not exist";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
thisModule->loadSelf();
|
|
||||||
if ( !thisModule->isLoaded() )
|
QVariantMap
|
||||||
cDebug() << "Module" << moduleName << "loading FAILED";
|
ModuleManager::moduleDescriptor( const QString& name )
|
||||||
|
{
|
||||||
|
return m_availableDescriptorsByModuleName.value( name );
|
||||||
|
}
|
||||||
|
|
||||||
|
Module*
|
||||||
|
ModuleManager::moduleInstance( const QString& instanceKey )
|
||||||
|
{
|
||||||
|
return m_loadedModulesByInstanceKey.value( instanceKey );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ModuleManager::loadModules()
|
||||||
|
{
|
||||||
|
QTimer::singleShot( 0, this, [ this ]()
|
||||||
|
{
|
||||||
|
QList< QMap< QString, QString > > customInstances =
|
||||||
|
Settings::instance()->customModuleInstances();
|
||||||
|
|
||||||
|
for ( const QPair< ModuleAction, QStringList >& modulePhase :
|
||||||
|
Settings::instance()->modulesSequence() )
|
||||||
|
{
|
||||||
|
ModuleAction currentAction = modulePhase.first;
|
||||||
|
|
||||||
|
foreach ( const QString& moduleEntry,
|
||||||
|
modulePhase.second )
|
||||||
|
{
|
||||||
|
QStringList moduleEntrySplit = moduleEntry.split( '@' );
|
||||||
|
QString moduleName;
|
||||||
|
QString instanceId;
|
||||||
|
QString configFileName;
|
||||||
|
if ( moduleEntrySplit.length() < 1 ||
|
||||||
|
moduleEntrySplit.length() > 2 )
|
||||||
|
{
|
||||||
|
cDebug() << "Wrong module entry format for module" << moduleEntry << "."
|
||||||
|
<< "\nCalamares will now quit.";
|
||||||
|
qApp->exit( 1 );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
moduleName = moduleEntrySplit.first();
|
||||||
|
instanceId = moduleEntrySplit.last();
|
||||||
|
configFileName = QString( "%1.conf" ).arg( moduleName );
|
||||||
|
|
||||||
|
if ( !m_availableDescriptorsByModuleName.contains( moduleName ) ||
|
||||||
|
m_availableDescriptorsByModuleName.value( moduleName ).isEmpty() )
|
||||||
|
{
|
||||||
|
cDebug() << "Module" << moduleName << "not found in module search paths."
|
||||||
|
<< "\nCalamares will now quit.";
|
||||||
|
qApp->exit( 1 );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto findCustomInstance =
|
||||||
|
[ customInstances ]( const QString& moduleName,
|
||||||
|
const QString& instanceId ) -> int
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < customInstances.count(); ++i )
|
||||||
|
{
|
||||||
|
auto thisInstance = customInstances[ i ];
|
||||||
|
if ( thisInstance.value( "module" ) == moduleName &&
|
||||||
|
thisInstance.value( "id" ) == instanceId )
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
if ( moduleName != instanceId ) //means this is a custom instance
|
||||||
|
{
|
||||||
|
if ( findCustomInstance( moduleName, instanceId ) > -1 )
|
||||||
|
{
|
||||||
|
configFileName = customInstances[ findCustomInstance( moduleName, instanceId ) ].value( "config" );
|
||||||
|
}
|
||||||
|
else //ought to be a custom instance, but cannot find instance entry
|
||||||
|
{
|
||||||
|
cDebug() << "Custom instance" << moduleEntry << "not found in custom instances section."
|
||||||
|
<< "\nCalamares will now quit.";
|
||||||
|
qApp->exit( 1 );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// So now we can assume that the module entry is at least valid,
|
||||||
|
// that we have a descriptor on hand (and therefore that the
|
||||||
|
// module exists), and that the instance is either default or
|
||||||
|
// defined in the custom instances section.
|
||||||
|
// We still don't know whether the config file for the entry
|
||||||
|
// exists and is valid, but that's the only thing that could fail
|
||||||
|
// from this point on. -- Teo 8/2015
|
||||||
|
|
||||||
|
QString instanceKey = QString( "%1@%2" )
|
||||||
|
.arg( moduleName )
|
||||||
|
.arg( instanceId );
|
||||||
|
|
||||||
|
Module* thisModule =
|
||||||
|
m_loadedModulesByInstanceKey.value( instanceKey, nullptr );
|
||||||
|
if ( thisModule && !thisModule->isLoaded() )
|
||||||
|
{
|
||||||
|
cDebug() << "Module" << instanceKey << "exists but not loaded."
|
||||||
|
<< "\nCalamares will now quit.";
|
||||||
|
qApp->exit( 1 );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( thisModule && thisModule->isLoaded() )
|
||||||
|
{
|
||||||
|
cDebug() << "Module" << instanceKey << "already loaded.";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
thisModule =
|
||||||
|
Module::fromDescriptor( m_availableDescriptorsByModuleName.value( moduleName ),
|
||||||
|
instanceId,
|
||||||
|
configFileName,
|
||||||
|
m_moduleDirectoriesByModuleName.value( moduleName ) );
|
||||||
|
if ( !thisModule )
|
||||||
|
{
|
||||||
|
cDebug() << "Module" << instanceKey << "cannot be created from descriptor.";
|
||||||
|
Q_ASSERT( thisModule );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// If it's a ViewModule, it also appends the ViewStep to the ViewManager.
|
||||||
|
thisModule->loadSelf();
|
||||||
|
m_loadedModulesByInstanceKey.insert( instanceKey, thisModule );
|
||||||
|
Q_ASSERT( thisModule->isLoaded() );
|
||||||
|
if ( !thisModule->isLoaded() )
|
||||||
|
{
|
||||||
|
cDebug() << "Module" << moduleName << "loading FAILED";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// At this point we most certainly have a pointer to a loaded module in
|
||||||
|
// thisModule. We now need to enqueue jobs info into an EVS.
|
||||||
|
if ( currentAction == Calamares::Exec )
|
||||||
|
{
|
||||||
|
ExecutionViewStep* evs =
|
||||||
|
qobject_cast< ExecutionViewStep* >(
|
||||||
|
Calamares::ViewManager::instance()->viewSteps().last() );
|
||||||
|
if ( !evs ) // If the last step is not an EVS, we must create it.
|
||||||
|
{
|
||||||
|
evs = new ExecutionViewStep( ViewManager::instance() );
|
||||||
|
ViewManager::instance()->addViewStep( evs );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cDebug() << "LAST VS IS EVS!";
|
||||||
|
}
|
||||||
|
|
||||||
|
evs->appendJobModuleInstanceKey( instanceKey );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
emit modulesLoaded();
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -218,15 +325,16 @@ ModuleManager::checkDependencies()
|
|||||||
bool somethingWasRemovedBecauseOfUnmetDependencies = false;
|
bool somethingWasRemovedBecauseOfUnmetDependencies = false;
|
||||||
forever
|
forever
|
||||||
{
|
{
|
||||||
for ( auto it = m_availableModules.begin();
|
for ( auto it = m_availableDescriptorsByModuleName.begin();
|
||||||
it != m_availableModules.end(); ++it )
|
it != m_availableDescriptorsByModuleName.end(); ++it )
|
||||||
{
|
{
|
||||||
foreach ( QString depName, (*it)->requiredModules() )
|
foreach ( const QString& depName,
|
||||||
|
(*it).value( "requiredModules" ).toStringList() )
|
||||||
{
|
{
|
||||||
if ( !m_availableModules.contains( depName ) )
|
if ( !m_availableDescriptorsByModuleName.contains( depName ) )
|
||||||
{
|
{
|
||||||
somethingWasRemovedBecauseOfUnmetDependencies = true;
|
somethingWasRemovedBecauseOfUnmetDependencies = true;
|
||||||
m_availableModules.erase( it );
|
m_availableDescriptorsByModuleName.erase( it );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,12 +19,11 @@
|
|||||||
#ifndef MODULELOADER_H
|
#ifndef MODULELOADER_H
|
||||||
#define MODULELOADER_H
|
#define MODULELOADER_H
|
||||||
|
|
||||||
#include "Module.h"
|
|
||||||
#include "Typedefs.h"
|
#include "Typedefs.h"
|
||||||
|
|
||||||
#include <QMap>
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include <QVariantMap>
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
@ -47,27 +46,27 @@ public:
|
|||||||
*/
|
*/
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
QStringList availableModules();
|
QStringList loadedInstanceKeys();
|
||||||
Module* module( const QString& name );
|
QVariantMap moduleDescriptor( const QString& name );
|
||||||
|
|
||||||
Phase currentPhase();
|
Module* moduleInstance( const QString& instanceKey );
|
||||||
|
|
||||||
void loadModules( Phase phase );
|
void loadModules();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void initDone();
|
void initDone();
|
||||||
void modulesLoaded( Phase );
|
void modulesLoaded();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void doInit();
|
void doInit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void doLoad( const QString& moduleName );
|
|
||||||
void checkDependencies();
|
void checkDependencies();
|
||||||
|
|
||||||
QMap< QString, Module* > m_availableModules;
|
QMap< QString, QVariantMap > m_availableDescriptorsByModuleName;
|
||||||
|
QMap< QString, QString > m_moduleDirectoriesByModuleName;
|
||||||
|
QMap< QString, Module* > m_loadedModulesByInstanceKey;
|
||||||
QStringList m_paths;
|
QStringList m_paths;
|
||||||
Phase m_lastPhaseLoaded;
|
|
||||||
|
|
||||||
static ModuleManager* s_instance;
|
static ModuleManager* s_instance;
|
||||||
};
|
};
|
||||||
|
@ -22,8 +22,6 @@
|
|||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
namespace Calamares {
|
namespace Calamares {
|
||||||
|
|
||||||
|
|
||||||
@ -47,10 +45,10 @@ ProcessJobModule::loadSelf()
|
|||||||
if ( m_loaded )
|
if ( m_loaded )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_job = Calamares::job_ptr( new ProcessJob( m_command,
|
m_job = job_ptr( new ProcessJob( m_command,
|
||||||
m_workingPath,
|
m_workingPath,
|
||||||
m_runInChroot,
|
m_runInChroot,
|
||||||
m_secondsTimeout ) );
|
m_secondsTimeout ) );
|
||||||
m_loaded = true;
|
m_loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,27 +61,29 @@ ProcessJobModule::jobs() const
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ProcessJobModule::initFrom( const YAML::Node& node )
|
ProcessJobModule::initFrom( const QVariantMap& moduleDescriptor )
|
||||||
{
|
{
|
||||||
Module::initFrom( node );
|
Module::initFrom( moduleDescriptor );
|
||||||
QDir directory( location() );
|
QDir directory( location() );
|
||||||
m_workingPath = directory.absolutePath();
|
m_workingPath = directory.absolutePath();
|
||||||
|
|
||||||
if ( node[ "command" ] )
|
if ( !moduleDescriptor.value( "command" ).toString().isEmpty() )
|
||||||
{
|
{
|
||||||
m_command = QString::fromStdString( node[ "command" ].as< std::string >() );
|
m_command = moduleDescriptor.value( "command" ).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_secondsTimeout = 30;
|
m_secondsTimeout = 30;
|
||||||
if ( node[ "timeout" ] )
|
if ( moduleDescriptor.contains( "timeout" ) &&
|
||||||
|
!moduleDescriptor.value( "timeout" ).isNull() )
|
||||||
{
|
{
|
||||||
m_secondsTimeout = node[ "timeout" ].as< int >();
|
m_secondsTimeout = moduleDescriptor.value( "timeout" ).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_runInChroot = false;
|
m_runInChroot = false;
|
||||||
if ( node[ "chroot" ] )
|
if ( moduleDescriptor.contains( "chroot" )&&
|
||||||
|
!moduleDescriptor.value( "chroot" ).isNull() )
|
||||||
{
|
{
|
||||||
m_runInChroot = node[ "chroot" ].as< bool >();
|
m_runInChroot = moduleDescriptor.value( "chroot" ).toBool();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
QList< job_ptr > jobs() const override;
|
QList< job_ptr > jobs() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initFrom( const YAML::Node& node ) override;
|
void initFrom( const QVariantMap& moduleDescriptor ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Module;
|
friend class Module;
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
|
|
||||||
#include "PythonJob.h"
|
#include "PythonJob.h"
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
|
|
||||||
@ -63,15 +61,15 @@ PythonJobModule::jobs() const
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PythonJobModule::initFrom( const YAML::Node& node )
|
PythonJobModule::initFrom( const QVariantMap& moduleDescriptor )
|
||||||
{
|
{
|
||||||
Module::initFrom( node );
|
Module::initFrom( moduleDescriptor );
|
||||||
QDir directory( location() );
|
QDir directory( location() );
|
||||||
m_workingPath = directory.absolutePath();
|
m_workingPath = directory.absolutePath();
|
||||||
|
|
||||||
if ( node[ "script" ] )
|
if ( !moduleDescriptor.value( "script" ).toString().isEmpty() )
|
||||||
{
|
{
|
||||||
m_scriptFileName = QString::fromStdString( node[ "script" ].as< std::string >() );
|
m_scriptFileName = moduleDescriptor.value( "script" ).toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
QList< job_ptr > jobs() const override;
|
QList< job_ptr > jobs() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initFrom( const YAML::Node& node ) override;
|
void initFrom( const QVariantMap& moduleDescriptor ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Module;
|
friend class Module;
|
||||||
|
@ -18,12 +18,11 @@
|
|||||||
|
|
||||||
#include "ViewModule.h"
|
#include "ViewModule.h"
|
||||||
|
|
||||||
|
#include "utils/PluginFactory.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "viewpages/ViewStep.h"
|
#include "viewpages/ViewStep.h"
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QPluginLoader>
|
#include <QPluginLoader>
|
||||||
|
|
||||||
@ -49,12 +48,25 @@ ViewModule::loadSelf()
|
|||||||
{
|
{
|
||||||
if ( m_loader )
|
if ( m_loader )
|
||||||
{
|
{
|
||||||
m_viewStep = qobject_cast< ViewStep* >( m_loader->instance() );
|
PluginFactory* pf = qobject_cast< PluginFactory* >( m_loader->instance() );
|
||||||
if ( !m_viewStep )
|
if ( !pf )
|
||||||
{
|
{
|
||||||
cLog() << Q_FUNC_INFO << m_loader->errorString();
|
cDebug() << Q_FUNC_INFO << m_loader->errorString();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_viewStep = pf->create< Calamares::ViewStep >();
|
||||||
|
if ( !m_viewStep )
|
||||||
|
{
|
||||||
|
cDebug() << Q_FUNC_INFO << m_loader->errorString();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cDebug() << "ViewModule loading self for instance" << instanceKey()
|
||||||
|
<< "\nViewModule at address" << this
|
||||||
|
<< "\nCalamares::PluginFactory at address" << pf
|
||||||
|
<< "\nViewStep at address" << m_viewStep;
|
||||||
|
|
||||||
|
m_viewStep->setModuleInstanceKey( instanceKey() );
|
||||||
m_viewStep->setConfigurationMap( m_configurationMap );
|
m_viewStep->setConfigurationMap( m_configurationMap );
|
||||||
ViewManager::instance()->addViewStep( m_viewStep );
|
ViewManager::instance()->addViewStep( m_viewStep );
|
||||||
m_loaded = true;
|
m_loaded = true;
|
||||||
@ -70,14 +82,14 @@ ViewModule::jobs() const
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ViewModule::initFrom( const YAML::Node& node )
|
ViewModule::initFrom( const QVariantMap& moduleDescriptor )
|
||||||
{
|
{
|
||||||
Module::initFrom( node );
|
Module::initFrom( moduleDescriptor );
|
||||||
QDir directory( location() );
|
QDir directory( location() );
|
||||||
QString load;
|
QString load;
|
||||||
if ( node[ "load" ] )
|
if ( !moduleDescriptor.value( "load" ).toString().isEmpty() )
|
||||||
{
|
{
|
||||||
load = QString::fromStdString( node[ "load" ].as< std::string >() );
|
load = moduleDescriptor.value( "load" ).toString();
|
||||||
load = directory.absoluteFilePath( load );
|
load = directory.absoluteFilePath( load );
|
||||||
}
|
}
|
||||||
// If a load path is not specified, we look for a plugin to load in the directory.
|
// If a load path is not specified, we look for a plugin to load in the directory.
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
QList< job_ptr > jobs() const override;
|
QList< job_ptr > jobs() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initFrom( const YAML::Node& node ) override;
|
void initFrom( const QVariantMap& moduleDescriptor ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Module; //so only the superclass can instantiate
|
friend class Module; //so only the superclass can instantiate
|
||||||
|
Loading…
Reference in New Issue
Block a user