mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-16 17:44:36 +00:00
more robust management of reading global parameters
This commit is contained in:
parent
a89037fd7b
commit
ae8a955ca9
@ -373,7 +373,7 @@ bool RichParameterFactory::create( const QDomElement& np,RichParameter** par )
|
||||
if(type=="RichBool")
|
||||
{
|
||||
QString val = np.attribute("value").toLower();
|
||||
if ((val != QString("true")) || (val != QString("false")))
|
||||
if ((val != QString("true")) && (val != QString("false")))
|
||||
return false;
|
||||
*par = new RichBool(name,np.attribute("value")!=QString("false"),desc,tooltip);
|
||||
return true;
|
||||
|
||||
@ -689,11 +689,16 @@ void MainWindow::loadMeshLabSettings()
|
||||
RichParameter* rpar = NULL;
|
||||
if(!docElem.isNull())
|
||||
{
|
||||
RichParameterFactory::create(docElem,&rpar);
|
||||
bool ret = RichParameterFactory::create(docElem,&rpar);
|
||||
if (!ret)
|
||||
{
|
||||
qDebug("Warning Ignored parameter '%s' = '%s'. Malformed.", qPrintable(docElem.attribute("name")),qPrintable(docElem.attribute("value")));
|
||||
continue;
|
||||
}
|
||||
if (!defaultGlobalParams.hasParameter(rpar->name))
|
||||
{
|
||||
qDebug("Warning in the saved parameters there were parameters that are not in the HardWired ones.\n"
|
||||
"This should not happen. Ignored parameter %s",qPrintable(rpar->name));
|
||||
qDebug("Warning Ignored parameter %s. In the saved parameters there are ones that are not in the HardWired ones. "
|
||||
"It happens if you are running MeshLab with only a subset of the plugins. ",qPrintable(rpar->name));
|
||||
}
|
||||
else currentGlobalParams.addParam(rpar);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user