Browse Source

Change `settings::moduleWhitelist` from a map of vectors to a map of sets.

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
c2e7ee4f28
2 changed files with 4 additions and 3 deletions
  1. +2
    -1
      include/settings.hpp
  2. +2
    -2
      src/settings.cpp

+ 2
- 1
include/settings.hpp View File

@@ -1,5 +1,6 @@
#pragma once
#include <vector>
#include <set>
#include <map>
#include <list>
#include <tuple>
@@ -51,7 +52,7 @@ extern std::string patchPath;
extern std::list<std::string> recentPatchPaths;
extern std::vector<NVGcolor> cableColors;
// pluginSlug -> moduleSlugs
extern std::map<std::string, std::vector<std::string>> moduleWhitelist;
extern std::map<std::string, std::set<std::string>> moduleWhitelist;

json_t* toJson();
void fromJson(json_t* rootJ);


+ 2
- 2
src/settings.cpp View File

@@ -49,7 +49,7 @@ std::vector<NVGcolor> cableColors = {
color::fromHexString("#0f8df4ff"), // blue
color::fromHexString("#8c1889ff"), // purple
};
std::map<std::string, std::vector<std::string>> moduleWhitelist = {};
std::map<std::string, std::set<std::string>> moduleWhitelist = {};


json_t* toJson() {
@@ -238,7 +238,7 @@ void fromJson(json_t* rootJ) {
json_t* moduleSlugJ;
json_array_foreach(moduleSlugsJ, i, moduleSlugJ) {
std::string moduleSlug = json_string_value(moduleSlugJ);
moduleSlugs.push_back(moduleSlug);
moduleSlugs.insert(moduleSlug);
}
}
}


Loading…
Cancel
Save