Drop the (inter-)module dependencies system.

- Was marked incomplete and unused; none of the existing modules
   set any requirements, and the descriptors are not set up to
   hold the requirements information anyway.
 - Dependencies are generally through globalStorage values, or if
   there are dependent jobs they should be created in-order by one
   source (e.g. though a View or a subclass of CppJob which overrides
   jobs() ).
 - It is the responsibility of deployers to formulate a settings.conf
   that includes all the required modules.
 - A 'real' dependency system is going to lead to the introduction
   of interface-definitions and a great deal of complexity, for a
   use case that can be handled with careful deployment instead.
This commit is contained in:
Adriaan de Groot 2017-09-27 05:34:06 -04:00
parent d2cce926de
commit 8917d153da
4 changed files with 2 additions and 52 deletions

View file

@ -150,9 +150,6 @@ ModuleManager::doInit()
cDebug() << "ModuleManager bad search path" << path;
}
}
// At this point m_availableModules is filled with whatever was found in the
// search paths.
checkDependencies();
emit initDone();
}
@ -318,35 +315,4 @@ ModuleManager::loadModules()
} );
}
void
ModuleManager::checkDependencies()
{
// This goes through the map of available modules, and deletes those whose
// dependencies are not met, if any.
bool somethingWasRemovedBecauseOfUnmetDependencies = false;
forever
{
for ( auto it = m_availableDescriptorsByModuleName.begin();
it != m_availableDescriptorsByModuleName.end(); ++it )
{
foreach ( const QString& depName,
(*it).value( "requiredModules" ).toStringList() )
{
if ( !m_availableDescriptorsByModuleName.contains( depName ) )
{
somethingWasRemovedBecauseOfUnmetDependencies = true;
m_availableDescriptorsByModuleName.erase( it );
break;
}
}
if ( somethingWasRemovedBecauseOfUnmetDependencies )
break;
}
if ( !somethingWasRemovedBecauseOfUnmetDependencies )
break;
}
}
}
} // namespace