@ -95,16 +95,12 @@ ModuleManager::doInit()
QFileInfo descriptorFileInfo ( currentDir . absoluteFilePath ( QLatin1String ( " module.desc " ) ) ) ;
QFileInfo descriptorFileInfo ( currentDir . absoluteFilePath ( QLatin1String ( " module.desc " ) ) ) ;
if ( ! descriptorFileInfo . exists ( ) )
if ( ! descriptorFileInfo . exists ( ) )
{
{
cDebug ( ) < < bad_descriptor
cDebug ( ) < < bad_descriptor < < descriptorFileInfo . absoluteFilePath ( ) < < " (missing) " ;
< < descriptorFileInfo . absoluteFilePath ( )
< < " (missing) " ;
continue ;
continue ;
}
}
if ( ! descriptorFileInfo . isReadable ( ) )
if ( ! descriptorFileInfo . isReadable ( ) )
{
{
cDebug ( ) < < bad_descriptor
cDebug ( ) < < bad_descriptor < < descriptorFileInfo . absoluteFilePath ( ) < < " (unreadable) " ;
< < descriptorFileInfo . absoluteFilePath ( )
< < " (unreadable) " ;
continue ;
continue ;
}
}
@ -133,22 +129,16 @@ ModuleManager::doInit()
}
}
// At this point m_availableDescriptorsByModuleName is filled with
// At this point m_availableDescriptorsByModuleName is filled with
// the modules that were found in the search paths.
// the modules that were found in the search paths.
cDebug ( ) < < " Found "
cDebug ( ) < < " Found " < < m_availableDescriptorsByModuleName . count ( ) < < " modules "
< < m_availableDescriptorsByModuleName . count ( ) < < " modules "
< < m_moduleDirectoriesByModuleName . count ( ) < < " names " ;
< < m_moduleDirectoriesByModuleName . count ( ) < < " names " ;
emit initDone ( ) ;
emit initDone ( ) ;
}
}
Q StringList
Q List< ModuleSystem : : InstanceKey >
ModuleManager : : loadedInstanceKeys ( )
ModuleManager : : loadedInstanceKeys ( )
{
{
QStringList l ;
return m_loadedModulesByInstanceKey . keys ( ) ;
for ( const auto & m : m_loadedModulesByInstanceKey . keys ( ) )
{
l < < m . toString ( ) ;
}
return l ;
}
}
@ -188,15 +178,14 @@ findCustomInstance( const Settings::InstanceDescriptionList& customInstances, co
void
void
ModuleManager : : loadModules ( )
ModuleManager : : loadModules ( )
{
{
if ( checkDependencies ( ) )
if ( checkDependencies ( ) )
{
{
cWarning ( ) < < " Some installed modules have unmet dependencies. " ;
cWarning ( ) < < " Some installed modules have unmet dependencies. " ;
}
}
Settings : : InstanceDescriptionList customInstances = Settings : : instance ( ) - > customModuleInstances ( ) ;
Settings : : InstanceDescriptionList customInstances = Settings : : instance ( ) - > customModuleInstances ( ) ;
QStringList failedModules ;
QStringList failedModules ;
const auto modulesSequence
const auto modulesSequence = Settings : : instance ( ) - > modulesSequence ( ) ;
= Settings : : instance ( ) - > modulesSequence ( ) ;
for ( const auto & modulePhase : modulesSequence )
for ( const auto & modulePhase : modulesSequence )
{
{
ModuleSystem : : Action currentAction = modulePhase . first ;
ModuleSystem : : Action currentAction = modulePhase . first ;
@ -269,7 +258,8 @@ ModuleManager::loadModules()
m_moduleDirectoriesByModuleName . value ( instanceKey . module ( ) ) ) ;
m_moduleDirectoriesByModuleName . value ( instanceKey . module ( ) ) ) ;
if ( ! thisModule )
if ( ! thisModule )
{
{
cError ( ) < < " Module " < < instanceKey . toString ( ) < < " cannot be created from descriptor " < < configFileName ;
cError ( ) < < " Module " < < instanceKey . toString ( ) < < " cannot be created from descriptor "
< < configFileName ;
failedModules . append ( instanceKey . toString ( ) ) ;
failedModules . append ( instanceKey . toString ( ) ) ;
continue ;
continue ;
}
}