Extended the plugin system to allow for dynamic runtime bindings between modules.

As a test implementation, this allows the TablesPage to open a CrudTab for a table/view without
the need for TablesPage, CrudTab and DatabaseWindow to know anything about each other.
This commit is contained in:
eelke 2018-12-31 15:20:55 +01:00
parent f996703937
commit b0cd47ef46
17 changed files with 209 additions and 55 deletions

View file

@ -25,5 +25,13 @@ PluginRegister::PluginRegister() = default;
void PluginRegister::registerModule(PluginModuleSPtr module)
{
qDebug() << "Register called for " << module->identifier();
m_moduleMap.emplace(module->identifier(), module);
}
const PluginModule* PluginRegister::findModule(const QString &module_ident) const
{
auto res = m_moduleMap.find(module_ident);
if (res == m_moduleMap.end())
return nullptr;
return res->second.get();
}