From ff53ef9d9379d14d7a4edc162b02977ebc28e4b3 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 28 Oct 2018 20:45:16 +0100 Subject: [PATCH] do not fail on missing image or model plugin, they can be optional --- libs/modulesystem/modulesmap.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libs/modulesystem/modulesmap.h b/libs/modulesystem/modulesmap.h index a48a083b..fae4c2a6 100644 --- a/libs/modulesystem/modulesmap.h +++ b/libs/modulesystem/modulesmap.h @@ -99,6 +99,7 @@ class ModulesRef ModulesMap m_modules; public: ModulesRef( const char* names ){ + std::string type_name { typename Type::Name() }; if ( !globalModuleServer().getError() ) { if ( string_equal( names, "*" ) ) { InsertModules visitor( m_modules ); @@ -115,8 +116,14 @@ ModulesRef( const char* names ){ } Module* module = globalModuleServer().findModule( typename Type::Name(), typename Type::Version(), name ); if ( module == 0 ) { - globalModuleServer().setError( true ); - globalErrorStream() << "ModulesRef::initialise: type=" << makeQuoted( typename Type::Name() ) << " version=" << makeQuoted( typename Type::Version() ) << " name=" << makeQuoted( name ) << " - not found\n"; + // do not fail on missing image or model plugin, they can be optional + if ( type_name.compare("image") == 0 || type_name.compare("model") == 0 ) { + globalOutputStream() << "ModulesRef::initialise: type=" << makeQuoted( typename Type::Name() ) << " version=" << makeQuoted( typename Type::Version() ) << " name=" << makeQuoted( name ) << " - not found\n"; + } + else { + globalModuleServer().setError( true ); + globalErrorStream() << "ModulesRef::initialise: type=" << makeQuoted( typename Type::Name() ) << " version=" << makeQuoted( typename Type::Version() ) << " name=" << makeQuoted( name ) << " - not found\n"; + } break; } else -- 2.39.2