mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-17 10:04:38 +00:00
added check for existence of the xml file
This commit is contained in:
parent
1607858518
commit
0ff5c8a627
@ -60,25 +60,32 @@ void PluginManager::loadPlugins(RichParameterSet& defaultGlobal)
|
||||
QString withoutext = fileName.left(res);
|
||||
QString xmlFile = getPluginDirPath() + "/" + withoutext + QObject::tr(".xml");
|
||||
qDebug("Loading XMLFile: %s",qPrintable(xmlFile));
|
||||
XMLMessageHandler xmlErr;
|
||||
fc.xmlInfo = XMLFilterInfo::createXMLFileInfo(xmlFile,xmlSchemaFile(),xmlErr);
|
||||
if (fc.xmlInfo != NULL)
|
||||
{
|
||||
QStringList fn = fc.xmlInfo->filterNames();
|
||||
foreach(QString filtName,fn)
|
||||
{
|
||||
fc.act = new QAction(filtName,plugin);
|
||||
stringXMLFilterMap.insert(filtName,fc);
|
||||
if(!QFileInfo(xmlFile).exists())
|
||||
{
|
||||
qDebug("Error XMLFile: %s does not exist",qPrintable(xmlFile));
|
||||
}
|
||||
else
|
||||
{
|
||||
XMLMessageHandler xmlErr;
|
||||
fc.xmlInfo = XMLFilterInfo::createXMLFileInfo(xmlFile,xmlSchemaFile(),xmlErr);
|
||||
if (fc.xmlInfo != NULL)
|
||||
{
|
||||
QStringList fn = fc.xmlInfo->filterNames();
|
||||
foreach(QString filtName,fn)
|
||||
{
|
||||
fc.act = new QAction(filtName,plugin);
|
||||
stringXMLFilterMap.insert(filtName,fc);
|
||||
|
||||
//SHOULD INITIALIZE GLOBALS FOR FILTERS
|
||||
//SHOULD INITIALIZE GLOBALS FOR FILTERS
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QString err = xmlErr.statusMessage();
|
||||
qDebug("Error in XMLFile: %s - line: %d, column: %d - %s",qPrintable(xmlFile),xmlErr.line(),xmlErr.column(),qPrintable(err));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QString err = xmlErr.statusMessage();
|
||||
qDebug("Error in XMLFile: %s - line: %d, column: %d - %s",qPrintable(xmlFile),xmlErr.line(),xmlErr.column(),qPrintable(err));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MeshIOInterface *iIO = qobject_cast<MeshIOInterface *>(plugin);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user