From 8917d153dac5de60822f31da66971c2cdff2e324 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 27 Sep 2017 05:34:06 -0400 Subject: [PATCH] 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. --- src/libcalamaresui/modulesystem/Module.cpp | 7 ---- src/libcalamaresui/modulesystem/Module.h | 9 +---- .../modulesystem/ModuleManager.cpp | 36 +------------------ .../modulesystem/ModuleManager.h | 2 -- 4 files changed, 2 insertions(+), 52 deletions(-) diff --git a/src/libcalamaresui/modulesystem/Module.cpp b/src/libcalamaresui/modulesystem/Module.cpp index 96ec0cceb..7af5dbb75 100644 --- a/src/libcalamaresui/modulesystem/Module.cpp +++ b/src/libcalamaresui/modulesystem/Module.cpp @@ -233,13 +233,6 @@ Module::instanceKey() const } -QStringList -Module::requiredModules() const -{ - return m_requiredModules; -} - - QString Module::location() const { diff --git a/src/libcalamaresui/modulesystem/Module.h b/src/libcalamaresui/modulesystem/Module.h index 5f756938f..b32d14a8e 100644 --- a/src/libcalamaresui/modulesystem/Module.h +++ b/src/libcalamaresui/modulesystem/Module.h @@ -106,13 +106,6 @@ public: */ virtual QString instanceKey() const final; - /** - * @brief requiredModules a list of names of modules required by this one. - * @return the list of names. - * The module dependencies system is currently incomplete and unused. - */ - virtual QStringList requiredModules() const; - /** * @brief location returns the full path of this module's directory. * @return the path. @@ -176,8 +169,8 @@ protected: private: void loadConfigurationFile( const QString& configFileName ); //throws YAML::Exception + QString m_name; - QStringList m_requiredModules; QString m_directory; QString m_instanceId; diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index 44eed30f0..f5eed42b0 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -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 diff --git a/src/libcalamaresui/modulesystem/ModuleManager.h b/src/libcalamaresui/modulesystem/ModuleManager.h index 05ad15178..daa988064 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.h +++ b/src/libcalamaresui/modulesystem/ModuleManager.h @@ -88,8 +88,6 @@ private slots: void doInit(); private: - void checkDependencies(); - QMap< QString, QVariantMap > m_availableDescriptorsByModuleName; QMap< QString, QString > m_moduleDirectoriesByModuleName; QMap< QString, Module* > m_loadedModulesByInstanceKey;