diff --git a/src/common/meshlabdocumentxml.cpp b/src/common/meshlabdocumentxml.cpp index 3a37c3972..bd44da2fd 100644 --- a/src/common/meshlabdocumentxml.cpp +++ b/src/common/meshlabdocumentxml.cpp @@ -67,7 +67,7 @@ bool MeshDocumentFromXML(MeshDocument &md, QString filename) //return true; filen=mesh.attributes().namedItem("filename").nodeValue(); label=mesh.attributes().namedItem("label").nodeValue(); - MeshModel* mm = md.addNewMesh(filen,label); + /*MeshModel* mm = */md.addNewMesh(filen,label); QDomNode tr=mesh.firstChild(); if(!tr.isNull() && QString::compare(tr.nodeName(),"MLMatrix44")==0) diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index 3ae9e2395..de9386686 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -204,39 +204,34 @@ QString PluginManager::getPluginDirPath() void PluginManager::knownIOFormats() { - //currentFormats[IMPORT] currentFormats[EXPORT] - QVector< QList > currentFormats(2); - - QString allKnownFormatsFilter = QObject::tr("All known formats ("); - - QVector::iterator itIOPlugin = meshIOPlug.begin(); - for (int i = 0; itIOPlugin != meshIOPlug.end(); ++itIOPlugin, ++i) // cycle among loaded IO plugins + for(int inpOut = 0;inpOut < 2;++inpOut) { - MeshIOInterface* pMeshIOPlugin = *itIOPlugin; - currentFormats[IMPORT].append(pMeshIOPlugin->importFormats()); - currentFormats[EXPORT].append(pMeshIOPlugin->exportFormats()); - - for(int inpOut = 0;inpOut < 2;++inpOut) + QStringList* formatFilters = NULL; + QString allKnownFormatsFilter = QObject::tr("All known formats ("); + for(QVector::iterator itIOPlugin = meshIOPlug.begin();itIOPlugin != meshIOPlug.end();++itIOPlugin) { + MeshIOInterface* pMeshIOPlugin = *itIOPlugin; + QList format; QMap* map = NULL; - QStringList* filt = NULL; - if (inpOut == int(IMPORT)) + if(inpOut== int(IMPORT)) { map = &allKnowInputFormats; - filt = &inpFilters; + formatFilters = &inpFilters; + format = pMeshIOPlugin->importFormats(); } else { map = &allKnowOutputFormats; - filt = &outFilters; + formatFilters = &outFilters; + format = pMeshIOPlugin->exportFormats(); } - QList::iterator itFormat = currentFormats[inpOut].begin(); - while(itFormat != currentFormats[inpOut].end()) + for(QList::iterator itf = format.begin();itf != format.end();++itf) { - MeshIOInterface::Format currentFormat = *itFormat; + MeshIOInterface::Format currentFormat = *itf; QString currentFilterEntry = currentFormat.description + " ("; + //a particular file format could be associated with more than one file extension QStringListIterator itExtension(currentFormat.extensions); while (itExtension.hasNext()) { @@ -251,12 +246,12 @@ void PluginManager::knownIOFormats() currentFilterEntry.append(currentExtension); } currentFilterEntry.append(')'); - filt->append(currentFilterEntry); - ++itFormat; + formatFilters->append(currentFilterEntry); } - allKnownFormatsFilter.append(')'); - filt->push_front(allKnownFormatsFilter); + } + allKnownFormatsFilter.append(')'); + formatFilters->push_front(allKnownFormatsFilter); } }