History

Remove dependency between codec plugins and UI

Brad Davis committed 9 years ago

Commit fe7d4b11 parent 63279f411 files · +58 −29Browse files

Showing the changes to interface/src/Application.cpp (1 of 11 files). Show all

Unified · Split

interface/src/Application.cpp+10−0
@@ -441,6 +441,11 @@ static const QString STATE_ADVANCED_MOVEMENT_CONTROLS = "AdvancedMovement"; · 440 unmodified lines
441441 static const QString STATE_GROUNDED = "Grounded";
442442 static const QString STATE_NAV_FOCUSED = "NavigationFocused";
443443
444+// Statically provided display and input plugins
445+extern DisplayPluginList getDisplayPlugins();
446+extern InputPluginList getInputPlugins();
447+extern void saveInputPluginSettings(const InputPluginList& plugins);
448+
444449 bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) {
445450 const char** constArgv = const_cast<const char**>(argv);
446451
@@ -480,6 +485,11 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 33 unmodified lines
480485
481486 Setting::init();
482487
488+ // Tell the plugin manager about our statically linked plugins
489+ PluginManager::setInputPluginProvider([] { return getInputPlugins(); });
490+ PluginManager::setDisplayPluginProvider([] { return getDisplayPlugins(); });
491+ PluginManager::setInputPluginSettingsPersister([](const InputPluginList& plugins) { saveInputPluginSettings(plugins); });
492+
483493 if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) {
484494 steamClient->init();
485495 }