mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-16 17:44:36 +00:00
check if plugins are already loaded
This commit is contained in:
parent
3eb059aced
commit
e47fb90abb
@ -182,10 +182,13 @@ void PluginManager::loadPlugins(QDir pluginsDirectory)
|
||||
*/
|
||||
void PluginManager::loadPlugin(const QString& fileName)
|
||||
{
|
||||
QFileInfo fin(fileName);
|
||||
if (pluginFiles.find(fin.absoluteFilePath()) != pluginFiles.end())
|
||||
throw MLException(fin.fileName() + " has been already loaded.");
|
||||
|
||||
checkPlugin(fileName);
|
||||
|
||||
//load the plugin depending on the type (can be more than one type!)
|
||||
QFileInfo fin(fileName);
|
||||
QPluginLoader loader(fin.absoluteFilePath());
|
||||
QObject *plugin = loader.instance();
|
||||
PluginFileInterface* ifp = dynamic_cast<PluginFileInterface *>(plugin);
|
||||
@ -214,6 +217,7 @@ void PluginManager::loadPlugin(const QString& fileName)
|
||||
//of all plugins
|
||||
ifp->plugFileInfo = fin;
|
||||
allPlugins.push_back(ifp);
|
||||
pluginFiles.insert(fin.absoluteFilePath());
|
||||
}
|
||||
|
||||
void PluginManager::unloadPlugin(PluginFileInterface* ifp)
|
||||
|
||||
@ -98,8 +98,9 @@ public:
|
||||
EditPluginFactoryRangeIterator editPluginFactoryIterator(bool iterateAlsoDisabledPlugins = false) const;
|
||||
|
||||
private:
|
||||
//all plugins (except Edit plugins)
|
||||
//all plugins
|
||||
std::vector<PluginFileInterface*> allPlugins;
|
||||
std::set<QString> pluginFiles; //used to check if a plugin file has been already loaded
|
||||
|
||||
//IOMeshPlugins
|
||||
std::vector<IOMeshPluginInterface*> ioMeshPlugins;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user