[libcalamaresui] Only load config file if there is one

- finally, no more warnings for modules that are NO_CONFIG
   (or noconfig: true) and don't have a config file.
This commit is contained in:
Adriaan de Groot 2020-01-24 21:47:54 +01:00
parent f366e3840f
commit 83ffbd5126

View File

@ -155,14 +155,17 @@ Module::fromDescriptor( const Calamares::ModuleSystem::Descriptor& moduleDescrip
} }
m->initFrom( moduleDescriptor ); m->initFrom( moduleDescriptor );
try if ( !configFileName.isEmpty() )
{ {
m->loadConfigurationFile( configFileName ); try
} {
catch ( YAML::Exception& e ) m->loadConfigurationFile( configFileName );
{ }
cError() << "YAML parser error " << e.what(); catch ( YAML::Exception& e )
return nullptr; {
cError() << "YAML parser error " << e.what();
return nullptr;
}
} }
return m.release(); return m.release();
} }