Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -1038,12 +1038,10 @@ Application::Application( · 1037 unmodified lines | |||
| 1038 | DependencyManager::set<PathUtils>(); | 1038 | DependencyManager::set<PathUtils>(); |
| 1039 | } | 1039 | } |
| 1040 | 1040 | ||
| 1041 | void Application::initializePluginManager() { | 1041 | void Application::initializePluginManager(const QCommandLineParser& parser) { |
| 1042 | DependencyManager::set<PluginManager>(); | 1042 | DependencyManager::set<PluginManager>(); |
| 1043 | auto pluginManager = PluginManager::getInstance(); | 1043 | auto pluginManager = PluginManager::getInstance(); |
| 1044 | 1044 | ||
| 1045 | qWarning() << "Input plugins: " << getInputPlugins().size(); | ||
| 1046 | |||
| 1047 | // To avoid any confusion: the getInputPlugins and getDisplayPlugins are not the ones | 1045 | // To avoid any confusion: the getInputPlugins and getDisplayPlugins are not the ones |
| 1048 | // from PluginManager, but functions exported by input-plugins/InputPlugin.cpp and | 1046 | // from PluginManager, but functions exported by input-plugins/InputPlugin.cpp and |
| 1049 | // display-plugins/DisplayPlugin.cpp. | 1047 | // display-plugins/DisplayPlugin.cpp. |
| @@ -1052,6 +1050,30 @@ void Application::initializePluginManager() { · 2 unmodified lines | |||
| 1052 | pluginManager->setInputPluginProvider([] { return getInputPlugins(); }); | 1050 | pluginManager->setInputPluginProvider([] { return getInputPlugins(); }); |
| 1053 | pluginManager->setDisplayPluginProvider([] { return getDisplayPlugins(); }); | 1051 | pluginManager->setDisplayPluginProvider([] { return getDisplayPlugins(); }); |
| 1054 | pluginManager->setInputPluginSettingsPersister([](const InputPluginList& plugins) { saveInputPluginSettings(plugins); }); | 1052 | pluginManager->setInputPluginSettingsPersister([](const InputPluginList& plugins) { saveInputPluginSettings(plugins); }); |
| 1053 | |||
| 1054 | |||
| 1055 | // This must be a member function -- PluginManager must exist, and for that | ||
| 1056 | // QApplication must exist, or it can't find the plugin path, as QCoreApplication:applicationDirPath | ||
| 1057 | // won't work yet. | ||
| 1058 | |||
| 1059 | if (parser.isSet("display")) { | ||
| 1060 | auto preferredDisplays = parser.value("display").split(',', Qt::SkipEmptyParts); | ||
| 1061 | qInfo() << "Setting prefered display plugins:" << preferredDisplays; | ||
| 1062 | PluginManager::getInstance()->setPreferredDisplayPlugins(preferredDisplays); | ||
| 1063 | } | ||
| 1064 | |||
| 1065 | if (parser.isSet("disableDisplays")) { | ||
| 1066 | auto disabledDisplays = parser.value("disableDisplays").split(',', Qt::SkipEmptyParts); | ||
| 1067 | qInfo() << "Disabling following display plugins:" << disabledDisplays; | ||
| 1068 | PluginManager::getInstance()->disableDisplays(disabledDisplays); | ||
| 1069 | } | ||
| 1070 | |||
| 1071 | if (parser.isSet("disableInputs")) { | ||
| 1072 | auto disabledInputs = parser.value("disableInputs").split(',', Qt::SkipEmptyParts); | ||
| 1073 | qInfo() << "Disabling following input plugins:" << disabledInputs; | ||
| 1074 | PluginManager::getInstance()->disableInputs(disabledInputs); | ||
| 1075 | } | ||
| 1076 | |||
| 1055 | } | 1077 | } |
| 1056 | 1078 | ||
| 1057 | void Application::initialize(const QCommandLineParser &parser) { | 1079 | void Application::initialize(const QCommandLineParser &parser) { |
| @@ -8818,31 +8840,6 @@ void Application::sendLambdaEvent(const std::function<void()>& f) { · 7760 unmodified lines | |||
| 8818 | } | 8840 | } |
| 8819 | } | 8841 | } |
| 8820 | 8842 | ||
| 8821 | void Application::configurePlugins(const QCommandLineParser& parser) { | ||
| 8822 | // This must be a member function -- PluginManager must exist, and for that | ||
| 8823 | // QApplication must exist, or it can't find the plugin path, as QCoreApplication:applicationDirPath | ||
| 8824 | // won't work yet. | ||
| 8825 | |||
| 8826 | if (parser.isSet("display")) { | ||
| 8827 | auto preferredDisplays = parser.value("display").split(',', Qt::SkipEmptyParts); | ||
| 8828 | qInfo() << "Setting prefered display plugins:" << preferredDisplays; | ||
| 8829 | PluginManager::getInstance()->setPreferredDisplayPlugins(preferredDisplays); | ||
| 8830 | } | ||
| 8831 | |||
| 8832 | if (parser.isSet("disable-displays")) { | ||
| 8833 | auto disabledDisplays = parser.value("disable-displays").split(',', Qt::SkipEmptyParts); | ||
| 8834 | qInfo() << "Disabling following display plugins:" << disabledDisplays; | ||
| 8835 | PluginManager::getInstance()->disableDisplays(disabledDisplays); | ||
| 8836 | } | ||
| 8837 | |||
| 8838 | if (parser.isSet("disable-inputs")) { | ||
| 8839 | auto disabledInputs = parser.value("disable-inputs").split(',', Qt::SkipEmptyParts); | ||
| 8840 | qInfo() << "Disabling following input plugins:" << disabledInputs; | ||
| 8841 | PluginManager::getInstance()->disableInputs(disabledInputs); | ||
| 8842 | } | ||
| 8843 | |||
| 8844 | } | ||
| 8845 | |||
| 8846 | void Application::shutdownPlugins() { | 8843 | void Application::shutdownPlugins() { |
| 8847 | } | 8844 | } |
| 8848 | 8845 | ||