Add initial support for persisting a lsit inactive plugins

This commit is contained in:
Maschell
2024-08-04 20:59:07 +02:00
parent ab7169e3c9
commit a92dae2574
12 changed files with 236 additions and 56 deletions

View File

@@ -26,7 +26,8 @@
#include <set>
#include <sys/dirent.h>
std::vector<PluginLoadWrapper> PluginDataFactory::loadDir(std::string_view path) {
std::vector<PluginLoadWrapper> PluginDataFactory::loadDir(std::string_view path, const std::vector<std::string> &inactivePluginsFilenames) {
std::vector<PluginLoadWrapper> result;
dirent *dp;
DIR *dfd;
@@ -54,15 +55,9 @@ std::vector<PluginLoadWrapper> PluginDataFactory::loadDir(std::string_view path)
DEBUG_FUNCTION_LINE("Loading plugin: %s", full_file_path.c_str());
if (auto pluginData = load(full_file_path)) {
// TODO: This is only for testing. Remove me!c
bool shouldBeLoadedAndLinked = false;
if (full_file_path.ends_with("AromaBasePlugin.wps") ||
full_file_path.ends_with("drc_region_free.wps") ||
full_file_path.ends_with("regionfree.wps") ||
full_file_path.ends_with("ftpiiu.wps") ||
full_file_path.ends_with("wiiload.wps") ||
full_file_path.ends_with("homebrew_on_menu.wps")) {
shouldBeLoadedAndLinked = true;
bool shouldBeLoadedAndLinked = true;
if (std::ranges::find(inactivePluginsFilenames, dp->d_name) != inactivePluginsFilenames.end()) {
shouldBeLoadedAndLinked = false;
}
result.emplace_back(std::move(pluginData), shouldBeLoadedAndLinked);
} else {

View File

@@ -25,7 +25,7 @@
class PluginDataFactory {
public:
static std::vector<PluginLoadWrapper> loadDir(std::string_view path);
static std::vector<PluginLoadWrapper> loadDir(std::string_view path, const std::vector<std::string> &inactivePluginsFilenames);
static std::unique_ptr<PluginData> load(std::string_view path);