Browse Source

Make module property in manifest an array instead of object

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
dd7e71916c
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      src/plugin/Plugin.cpp

+ 7
- 2
src/plugin/Plugin.cpp View File

@@ -74,9 +74,14 @@ void Plugin::fromJson(json_t *rootJ) {

json_t *modulesJ = json_object_get(rootJ, "modules");
if (modulesJ) {
const char *slug;
size_t moduleId;
json_t *moduleJ;
json_object_foreach(modulesJ, slug, moduleJ) {
json_array_foreach(modulesJ, moduleId, moduleJ) {
json_t *slugJ = json_object_get(rootJ, "slug");
if (!slugJ)
continue;
std::string slug = json_string_value(slugJ);

Model *model = getModel(slug);
if (!model) {
WARN("plugin.json contains module \"%s\" but it is not defined in the plugin", slug);


Loading…
Cancel
Save