2017-12-20 14:39:09 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
2014-06-18 18:05:04 +02:00
|
|
|
*
|
2015-01-29 20:33:08 +01:00
|
|
|
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
2018-06-15 11:59:11 +02:00
|
|
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
2014-06-18 18:05:04 +02:00
|
|
|
*
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calamares is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2014-06-24 18:01:11 +02:00
|
|
|
#include "ModuleManager.h"
|
2014-06-18 18:05:04 +02:00
|
|
|
|
2015-09-09 19:01:56 +02:00
|
|
|
#include "ExecutionViewStep.h"
|
|
|
|
#include "Module.h"
|
2014-06-18 18:05:04 +02:00
|
|
|
#include "utils/Logger.h"
|
2015-09-09 19:01:56 +02:00
|
|
|
#include "utils/YamlUtils.h"
|
2014-06-27 13:58:53 +02:00
|
|
|
#include "Settings.h"
|
2015-09-09 19:01:56 +02:00
|
|
|
#include "ViewManager.h"
|
2014-06-18 18:05:04 +02:00
|
|
|
|
|
|
|
#include <yaml-cpp/yaml.h>
|
|
|
|
|
2014-06-27 13:58:53 +02:00
|
|
|
#include <QApplication>
|
2014-06-18 18:05:04 +02:00
|
|
|
#include <QDir>
|
2014-06-23 16:10:19 +02:00
|
|
|
#include <QTimer>
|
2014-06-18 18:05:04 +02:00
|
|
|
|
|
|
|
namespace Calamares
|
|
|
|
{
|
2015-03-10 19:48:11 +01:00
|
|
|
ModuleManager* ModuleManager::s_instance = nullptr;
|
|
|
|
|
|
|
|
ModuleManager*
|
|
|
|
ModuleManager::instance()
|
|
|
|
{
|
|
|
|
return s_instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-06-24 18:01:11 +02:00
|
|
|
ModuleManager::ModuleManager( const QStringList& paths, QObject* parent )
|
2014-06-18 18:05:04 +02:00
|
|
|
: QObject( parent )
|
|
|
|
, m_paths( paths )
|
|
|
|
{
|
2015-03-10 19:48:11 +01:00
|
|
|
Q_ASSERT( !s_instance );
|
|
|
|
s_instance = this;
|
2014-06-18 18:05:04 +02:00
|
|
|
}
|
|
|
|
|
2015-09-09 19:01:56 +02:00
|
|
|
|
2014-06-24 18:01:11 +02:00
|
|
|
ModuleManager::~ModuleManager()
|
2017-08-30 13:46:01 +02:00
|
|
|
{
|
|
|
|
// The map is populated with Module::fromDescriptor(), which allocates on the heap.
|
2018-06-18 16:56:10 +02:00
|
|
|
for ( auto moduleptr : m_loadedModulesByInstanceKey )
|
2017-08-30 13:46:01 +02:00
|
|
|
delete moduleptr;
|
|
|
|
}
|
2014-06-18 18:05:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
void
|
2014-06-27 13:58:53 +02:00
|
|
|
ModuleManager::init()
|
2014-06-23 16:10:19 +02:00
|
|
|
{
|
2015-08-25 12:39:34 +02:00
|
|
|
QTimer::singleShot( 0, this, &ModuleManager::doInit );
|
2014-06-23 16:10:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-06-27 13:58:53 +02:00
|
|
|
void
|
|
|
|
ModuleManager::doInit()
|
2014-06-18 18:05:04 +02:00
|
|
|
{
|
|
|
|
// We start from a list of paths in m_paths. Each of those is a directory that
|
|
|
|
// might (should) contain Calamares modules of any type/interface.
|
|
|
|
// For each modules search path (directory), it is expected that each module
|
|
|
|
// lives in its own subdirectory. This subdirectory must have the same name as
|
2014-08-05 18:18:57 +02:00
|
|
|
// the module name, and must contain a settings file named module.desc.
|
2014-06-18 18:05:04 +02:00
|
|
|
// If at any time the module loading procedure finds something unexpected, it
|
|
|
|
// silently skips to the next module or search path. --Teo 6/2014
|
2016-09-01 14:21:05 +02:00
|
|
|
for ( const QString& path : m_paths )
|
2014-06-18 18:05:04 +02:00
|
|
|
{
|
|
|
|
QDir currentDir( path );
|
|
|
|
if ( currentDir.exists() && currentDir.isReadable() )
|
|
|
|
{
|
2016-09-01 14:21:05 +02:00
|
|
|
const QStringList subdirs = currentDir.entryList( QDir::AllDirs | QDir::NoDotAndDotDot );
|
|
|
|
for ( const QString& subdir : subdirs )
|
2014-06-18 18:05:04 +02:00
|
|
|
{
|
2014-06-24 16:27:23 +02:00
|
|
|
currentDir.setPath( path );
|
2014-06-18 18:05:04 +02:00
|
|
|
bool success = currentDir.cd( subdir );
|
2014-06-24 16:27:23 +02:00
|
|
|
if ( success )
|
2014-06-18 18:05:04 +02:00
|
|
|
{
|
2019-02-18 16:19:06 +01:00
|
|
|
QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1Literal( "module.desc") ) );
|
2015-09-09 19:01:56 +02:00
|
|
|
if ( ! ( descriptorFileInfo.exists() && descriptorFileInfo.isReadable() ) )
|
2014-06-18 18:05:04 +02:00
|
|
|
{
|
|
|
|
cDebug() << Q_FUNC_INFO << "unreadable file: "
|
2015-09-09 19:01:56 +02:00
|
|
|
<< descriptorFileInfo.absoluteFilePath();
|
2014-06-18 18:05:04 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2018-02-26 15:06:13 +01:00
|
|
|
bool ok = false;
|
|
|
|
QVariantMap moduleDescriptorMap = CalamaresUtils::loadYaml( descriptorFileInfo, &ok );
|
|
|
|
QString moduleName = ok ? moduleDescriptorMap.value( "name" ).toString() : QString();
|
2015-09-09 19:01:56 +02:00
|
|
|
|
2018-02-26 15:06:13 +01:00
|
|
|
if ( ok && ( moduleName == currentDir.dirName() ) &&
|
|
|
|
!m_availableDescriptorsByModuleName.contains( moduleName ) )
|
2014-07-30 22:37:05 +02:00
|
|
|
{
|
2018-02-26 15:06:13 +01:00
|
|
|
m_availableDescriptorsByModuleName.insert( moduleName, moduleDescriptorMap );
|
|
|
|
m_moduleDirectoriesByModuleName.insert( moduleName,
|
|
|
|
descriptorFileInfo.absoluteDir().absolutePath() );
|
2014-07-30 22:37:05 +02:00
|
|
|
}
|
2014-06-18 18:05:04 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-02-12 16:46:57 +01:00
|
|
|
cWarning() << "Cannot cd into module directory "
|
2018-06-18 16:56:10 +02:00
|
|
|
<< path << "/" << subdir;
|
2014-06-18 18:05:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2014-10-30 17:36:56 +01:00
|
|
|
cDebug() << "ModuleManager bad search path" << path;
|
2014-06-18 18:05:04 +02:00
|
|
|
}
|
|
|
|
// At this point m_availableModules is filled with whatever was found in the
|
|
|
|
// search paths.
|
2014-06-27 13:58:53 +02:00
|
|
|
emit initDone();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-09-09 19:01:56 +02:00
|
|
|
QStringList
|
|
|
|
ModuleManager::loadedInstanceKeys()
|
|
|
|
{
|
|
|
|
return m_loadedModulesByInstanceKey.keys();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QVariantMap
|
|
|
|
ModuleManager::moduleDescriptor( const QString& name )
|
|
|
|
{
|
|
|
|
return m_availableDescriptorsByModuleName.value( name );
|
|
|
|
}
|
|
|
|
|
|
|
|
Module*
|
|
|
|
ModuleManager::moduleInstance( const QString& instanceKey )
|
|
|
|
{
|
|
|
|
return m_loadedModulesByInstanceKey.value( instanceKey );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-06-08 23:56:23 +02:00
|
|
|
/**
|
|
|
|
* @brief Search a list of instance descriptions for one matching @p module and @p id
|
|
|
|
*
|
|
|
|
* @return -1 on failure, otherwise index of the instance that matches.
|
|
|
|
*/
|
|
|
|
static int findCustomInstance( const Settings::InstanceDescriptionList& customInstances,
|
|
|
|
const QString& module,
|
|
|
|
const QString& id )
|
|
|
|
{
|
|
|
|
for ( int i = 0; i < customInstances.count(); ++i )
|
|
|
|
{
|
|
|
|
const auto& thisInstance = customInstances[ i ];
|
|
|
|
if ( thisInstance.value( "module" ) == module &&
|
|
|
|
thisInstance.value( "id" ) == id )
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-06-27 13:58:53 +02:00
|
|
|
void
|
2015-09-09 19:01:56 +02:00
|
|
|
ModuleManager::loadModules()
|
2014-06-27 13:58:53 +02:00
|
|
|
{
|
2015-09-09 19:01:56 +02:00
|
|
|
QTimer::singleShot( 0, this, [ this ]()
|
2015-06-14 01:02:50 +02:00
|
|
|
{
|
2018-06-26 14:29:33 +02:00
|
|
|
QStringList failedModules = checkDependencies();
|
2018-06-08 23:36:29 +02:00
|
|
|
Settings::InstanceDescriptionList customInstances =
|
2018-06-18 16:56:10 +02:00
|
|
|
Settings::instance()->customModuleInstances();
|
2015-09-09 19:01:56 +02:00
|
|
|
|
2018-06-26 14:43:23 +02:00
|
|
|
const auto modulesSequence = failedModules.isEmpty() ? Settings::instance()->modulesSequence() : Settings::ModuleSequence();
|
2018-06-18 16:56:10 +02:00
|
|
|
for ( const auto& modulePhase : modulesSequence )
|
2015-09-09 19:01:56 +02:00
|
|
|
{
|
|
|
|
ModuleAction currentAction = modulePhase.first;
|
|
|
|
|
|
|
|
foreach ( const QString& moduleEntry,
|
|
|
|
modulePhase.second )
|
|
|
|
{
|
|
|
|
QStringList moduleEntrySplit = moduleEntry.split( '@' );
|
|
|
|
QString moduleName;
|
|
|
|
QString instanceId;
|
|
|
|
QString configFileName;
|
|
|
|
if ( moduleEntrySplit.length() < 1 ||
|
2018-06-18 16:56:10 +02:00
|
|
|
moduleEntrySplit.length() > 2 )
|
2015-09-09 19:01:56 +02:00
|
|
|
{
|
2018-06-11 19:35:12 +02:00
|
|
|
cError() << "Wrong module entry format for module" << moduleEntry;
|
2018-06-11 11:59:56 +02:00
|
|
|
failedModules.append( moduleEntry );
|
|
|
|
continue;
|
2015-09-09 19:01:56 +02:00
|
|
|
}
|
|
|
|
moduleName = moduleEntrySplit.first();
|
|
|
|
instanceId = moduleEntrySplit.last();
|
|
|
|
configFileName = QString( "%1.conf" ).arg( moduleName );
|
|
|
|
|
|
|
|
if ( !m_availableDescriptorsByModuleName.contains( moduleName ) ||
|
2018-06-18 16:56:10 +02:00
|
|
|
m_availableDescriptorsByModuleName.value( moduleName ).isEmpty() )
|
2015-09-09 19:01:56 +02:00
|
|
|
{
|
2018-02-12 16:46:57 +01:00
|
|
|
cError() << "Module" << moduleName << "not found in module search paths."
|
2018-06-18 16:56:10 +02:00
|
|
|
<< Logger::DebugList( m_paths );
|
2018-06-11 11:59:56 +02:00
|
|
|
failedModules.append( moduleName );
|
|
|
|
continue;
|
2015-09-09 19:01:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( moduleName != instanceId ) //means this is a custom instance
|
|
|
|
{
|
2018-06-18 16:29:30 +02:00
|
|
|
int found = findCustomInstance( customInstances, moduleName, instanceId );
|
|
|
|
|
2018-06-18 16:44:28 +02:00
|
|
|
if ( found > -1 )
|
2018-06-08 23:56:23 +02:00
|
|
|
configFileName = customInstances[ found ].value( "config" );
|
2015-09-09 19:01:56 +02:00
|
|
|
else //ought to be a custom instance, but cannot find instance entry
|
|
|
|
{
|
2018-06-11 19:35:12 +02:00
|
|
|
cError() << "Custom instance" << moduleEntry << "not found in custom instances section.";
|
2018-06-11 11:59:56 +02:00
|
|
|
failedModules.append( moduleEntry );
|
|
|
|
continue;
|
2015-09-09 19:01:56 +02:00
|
|
|
}
|
|
|
|
}
|
2015-06-14 01:02:50 +02:00
|
|
|
|
2015-09-09 19:01:56 +02:00
|
|
|
// 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() )
|
|
|
|
{
|
2018-06-11 19:35:12 +02:00
|
|
|
cError() << "Module" << instanceKey << "exists but not loaded.";
|
2018-06-11 11:59:56 +02:00
|
|
|
failedModules.append( instanceKey );
|
|
|
|
continue;
|
2015-09-09 19:01:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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 )
|
|
|
|
{
|
2018-06-11 19:35:12 +02:00
|
|
|
cError() << "Module" << instanceKey << "cannot be created from descriptor" << configFileName;
|
2018-06-11 11:59:56 +02:00
|
|
|
failedModules.append( instanceKey );
|
|
|
|
continue;
|
2015-09-09 19:01:56 +02:00
|
|
|
}
|
2018-06-26 14:29:33 +02:00
|
|
|
|
|
|
|
if ( !checkDependencies( *thisModule ) )
|
|
|
|
{
|
|
|
|
// Error message is already printed
|
|
|
|
failedModules.append( instanceKey );
|
2015-09-09 19:01:56 +02:00
|
|
|
continue;
|
|
|
|
}
|
2018-06-26 14:29:33 +02:00
|
|
|
|
2015-09-09 19:01:56 +02:00
|
|
|
// If it's a ViewModule, it also appends the ViewStep to the ViewManager.
|
|
|
|
thisModule->loadSelf();
|
|
|
|
m_loadedModulesByInstanceKey.insert( instanceKey, thisModule );
|
|
|
|
if ( !thisModule->isLoaded() )
|
|
|
|
{
|
2018-06-11 19:35:12 +02:00
|
|
|
cError() << "Module" << instanceKey << "loading FAILED.";
|
2018-06-11 11:59:56 +02:00
|
|
|
failedModules.append( instanceKey );
|
2015-09-09 19:01:56 +02:00
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
|
|
|
evs->appendJobModuleInstanceKey( instanceKey );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-06-11 11:59:56 +02:00
|
|
|
if ( !failedModules.isEmpty() )
|
2018-06-13 11:11:31 +02:00
|
|
|
{
|
|
|
|
ViewManager::instance()->onInitFailed( failedModules );
|
2018-06-11 11:59:56 +02:00
|
|
|
emit modulesFailed( failedModules );
|
2018-06-13 11:11:31 +02:00
|
|
|
}
|
2018-06-11 11:59:56 +02:00
|
|
|
else
|
|
|
|
emit modulesLoaded();
|
2015-09-09 19:01:56 +02:00
|
|
|
} );
|
2014-06-23 16:10:19 +02:00
|
|
|
}
|
|
|
|
|
2017-11-30 18:01:11 +01:00
|
|
|
void
|
|
|
|
ModuleManager::checkRequirements()
|
|
|
|
{
|
2017-11-30 18:42:59 +01:00
|
|
|
cDebug() << "Checking module requirements ..";
|
2017-11-30 18:01:11 +01:00
|
|
|
QTimer::singleShot( 0, this, [ this ]()
|
|
|
|
{
|
2017-11-30 18:42:59 +01:00
|
|
|
bool acceptable = true;
|
|
|
|
|
2017-11-30 18:01:11 +01:00
|
|
|
for (const auto& module : m_loadedModulesByInstanceKey )
|
|
|
|
{
|
2019-02-15 20:53:55 +01:00
|
|
|
RequirementsList l = module->checkRequirements();
|
2017-11-30 18:42:59 +01:00
|
|
|
if ( l.length() > 0 )
|
|
|
|
{
|
2019-02-18 15:09:37 +01:00
|
|
|
cDebug() << " .." << module->name() << "has" << l.length() << "requirements";
|
2017-11-30 18:42:59 +01:00
|
|
|
emit requirementsResult( l );
|
|
|
|
}
|
2019-02-18 15:09:37 +01:00
|
|
|
int count = 0;
|
2017-11-30 18:42:59 +01:00
|
|
|
for (const auto& r : l)
|
|
|
|
{
|
2019-02-15 20:53:55 +01:00
|
|
|
if ( r.mandatory && !r.satisfied )
|
2019-02-18 15:09:37 +01:00
|
|
|
{
|
|
|
|
cDebug() << " .. requirement" << count << r.name << "is not satisfied.";
|
2017-11-30 18:42:59 +01:00
|
|
|
acceptable = false;
|
2019-02-18 15:09:37 +01:00
|
|
|
}
|
|
|
|
++count;
|
2017-11-30 18:42:59 +01:00
|
|
|
}
|
2017-11-30 18:01:11 +01:00
|
|
|
}
|
|
|
|
|
2017-11-30 18:42:59 +01:00
|
|
|
emit requirementsComplete( acceptable );
|
2017-11-30 18:01:11 +01:00
|
|
|
} );
|
|
|
|
}
|
|
|
|
|
2018-06-26 14:29:33 +02:00
|
|
|
QStringList
|
2014-06-24 18:01:11 +02:00
|
|
|
ModuleManager::checkDependencies()
|
2014-06-23 16:10:19 +02:00
|
|
|
{
|
2018-06-26 14:29:33 +02:00
|
|
|
QStringList failed;
|
|
|
|
|
2014-06-23 16:10:19 +02:00
|
|
|
// This goes through the map of available modules, and deletes those whose
|
|
|
|
// dependencies are not met, if any.
|
|
|
|
forever
|
|
|
|
{
|
2018-06-26 14:29:33 +02:00
|
|
|
bool somethingWasRemovedBecauseOfUnmetDependencies = false;
|
2015-09-09 19:01:56 +02:00
|
|
|
for ( auto it = m_availableDescriptorsByModuleName.begin();
|
2018-06-18 16:56:10 +02:00
|
|
|
it != m_availableDescriptorsByModuleName.end(); ++it )
|
2014-06-23 16:10:19 +02:00
|
|
|
{
|
2015-09-09 19:01:56 +02:00
|
|
|
foreach ( const QString& depName,
|
2018-06-26 14:29:33 +02:00
|
|
|
it->value( "requiredModules" ).toStringList() )
|
2014-06-23 16:10:19 +02:00
|
|
|
{
|
2015-09-09 19:01:56 +02:00
|
|
|
if ( !m_availableDescriptorsByModuleName.contains( depName ) )
|
2014-06-23 16:10:19 +02:00
|
|
|
{
|
2018-06-26 14:29:33 +02:00
|
|
|
QString moduleName = it->value( "name" ).toString();
|
2014-06-23 16:10:19 +02:00
|
|
|
somethingWasRemovedBecauseOfUnmetDependencies = true;
|
2015-09-09 19:01:56 +02:00
|
|
|
m_availableDescriptorsByModuleName.erase( it );
|
2018-06-26 14:29:33 +02:00
|
|
|
failed << moduleName;
|
2018-06-26 14:43:23 +02:00
|
|
|
cWarning() << "Module" << moduleName << "has unknown requirement" << depName;
|
2014-06-23 16:10:19 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( !somethingWasRemovedBecauseOfUnmetDependencies )
|
|
|
|
break;
|
|
|
|
}
|
2018-06-26 14:29:33 +02:00
|
|
|
|
|
|
|
return failed;
|
2014-06-18 18:05:04 +02:00
|
|
|
}
|
|
|
|
|
2018-06-26 14:29:33 +02:00
|
|
|
bool
|
|
|
|
ModuleManager::checkDependencies( const Module& m )
|
|
|
|
{
|
|
|
|
bool allRequirementsFound = true;
|
|
|
|
QStringList requiredModules = m_availableDescriptorsByModuleName[ m.name() ].value( "requiredModules" ).toStringList();
|
|
|
|
|
|
|
|
for ( const QString& required : requiredModules )
|
|
|
|
{
|
|
|
|
bool requirementFound = false;
|
|
|
|
for( const Module* v : m_loadedModulesByInstanceKey )
|
|
|
|
if ( required == v->name() )
|
|
|
|
{
|
|
|
|
requirementFound = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if ( !requirementFound )
|
|
|
|
{
|
|
|
|
cError() << "Module" << m.name() << "requires" << required << "before it in sequence.";
|
|
|
|
allRequirementsFound = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return allRequirementsFound;
|
|
|
|
}
|
2014-06-27 13:58:53 +02:00
|
|
|
|
2017-09-27 11:34:06 +02:00
|
|
|
} // namespace
|