Commit 92008157 authored by Mario's avatar Mario

Merge branch 'image_nofail' into 'master'

do not fail on missing image or model plugin, they can be optional

See merge request !105
parents d6105572 ff53ef9d
...@@ -99,6 +99,7 @@ class ModulesRef ...@@ -99,6 +99,7 @@ class ModulesRef
ModulesMap<Type> m_modules; ModulesMap<Type> m_modules;
public: public:
ModulesRef( const char* names ){ ModulesRef( const char* names ){
std::string type_name { typename Type::Name() };
if ( !globalModuleServer().getError() ) { if ( !globalModuleServer().getError() ) {
if ( string_equal( names, "*" ) ) { if ( string_equal( names, "*" ) ) {
InsertModules<Type> visitor( m_modules ); InsertModules<Type> visitor( m_modules );
...@@ -115,8 +116,14 @@ ModulesRef( const char* names ){ ...@@ -115,8 +116,14 @@ ModulesRef( const char* names ){
} }
Module* module = globalModuleServer().findModule( typename Type::Name(), typename Type::Version(), name ); Module* module = globalModuleServer().findModule( typename Type::Name(), typename Type::Version(), name );
if ( module == 0 ) { if ( module == 0 ) {
globalModuleServer().setError( true ); // do not fail on missing image or model plugin, they can be optional
globalErrorStream() << "ModulesRef::initialise: type=" << makeQuoted( typename Type::Name() ) << " version=" << makeQuoted( typename Type::Version() ) << " name=" << makeQuoted( name ) << " - not found\n"; 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; break;
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment