Fixed loading same plugin multiple times
[mdictionary] / trunk / src / base / backbone / backbone.cpp
index e05b042..a458852 100644 (file)
@@ -346,8 +346,15 @@ void Backbone::loadPlugins() {
         }
         QObject *pl = loader.instance();
 
+        bool exists = 0;
         CommonDictInterface *plugin = qobject_cast<CommonDictInterface*>(pl);
-        _plugins.append(plugin);
+        foreach(CommonDictInterface* pl, _plugins)
+            if(pl->type() == plugin->type()) {
+                exists = 1;
+                break;
+           }
+        if(!exists)
+            _plugins.append(plugin);
     }
 }