Commit 57cf3082 authored by Victor Yacovlev's avatar Victor Yacovlev

Fixed actors settings availability

parent 860f1860
......@@ -29,7 +29,8 @@ namespace ActorDraw {
{
ExtensionSystem::PluginManager * pluginManager = ExtensionSystem::PluginManager::instance();
ExtensionSystem::KPlugin * plugin = pluginManager->loadedPlugins("ActorDraw")[0];
return pluginManager->settingsByObject(plugin);
return plugin->mySettings();
// return pluginManager->settingsByObject(plugin);
}//Get settings
static const qreal MAX_ZOOM = 1000000;
......
......@@ -42,7 +42,8 @@ static const qreal MAX_ZOOM = 1000000;
{
ExtensionSystem::PluginManager * pluginManager = ExtensionSystem::PluginManager::instance();
ExtensionSystem::KPlugin * plugin = pluginManager->loadedPlugins("ActorTurtle")[0];
return pluginManager->settingsByObject(plugin);
return plugin->mySettings();
// return pluginManager->settingsByObject(plugin);
}//Get settings
......
......@@ -227,14 +227,26 @@ QString PluginManager::initializePlugins()
{
QString error;
// Initialize plugins with exact order from starting entry point
// Initialize direct dependencies of startup module, but not startup itself
KPlugin * entryPoint = loadedPlugin(pImpl_->mainPluginName);
error = pImpl_->initializePlugin(entryPoint);
if (error.length() > 0) {
return error;
const PluginSpec & spec = entryPoint->pluginSpec();
QList<KPlugin*> directEntryPointDeps;
Q_FOREACH(const QByteArray & depName, spec.dependencies) {
Q_FOREACH(KPlugin* anotherPlugin, pImpl_->objects) {
const PluginSpec & anotherSpec = anotherPlugin->pluginSpec();
if (anotherSpec.name == depName || anotherSpec.provides.contains(depName)) {
directEntryPointDeps.append(anotherPlugin);
}
}
}
Q_FOREACH(KPlugin * dep, directEntryPointDeps) {
error = pImpl_->initializePlugin(dep);
if (error.length() > 0) {
return error;
}
}
// Initialize rest of plugins
// Initialize rest of plugins, but not startup
Q_FOREACH(KPlugin * plugin, pImpl_->objects) {
error = pImpl_->initializePlugin(plugin);
if (error.length() > 0) {
......@@ -242,6 +254,12 @@ QString PluginManager::initializePlugins()
}
}
// Initialize startup module itself
error = pImpl_->initializePlugin(entryPoint);
if (error.length() > 0) {
return error;
}
return "";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment