Merge pull request #31810 from merumelu/plugin-config-warnings
Warn about all missing keys in plugin.cfg
This commit is contained in:
commit
61eeace972
@ -96,18 +96,31 @@ void EditorPluginSettings::update_plugins() {
|
|||||||
|
|
||||||
if (err2 != OK) {
|
if (err2 != OK) {
|
||||||
WARN_PRINTS("Can't load plugin config: " + path);
|
WARN_PRINTS("Can't load plugin config: " + path);
|
||||||
} else if (!cf->has_section_key("plugin", "name")) {
|
|
||||||
WARN_PRINTS("Plugin misses plugin/name: " + path);
|
|
||||||
} else if (!cf->has_section_key("plugin", "author")) {
|
|
||||||
WARN_PRINTS("Plugin misses plugin/author: " + path);
|
|
||||||
} else if (!cf->has_section_key("plugin", "version")) {
|
|
||||||
WARN_PRINTS("Plugin misses plugin/version: " + path);
|
|
||||||
} else if (!cf->has_section_key("plugin", "description")) {
|
|
||||||
WARN_PRINTS("Plugin misses plugin/description: " + path);
|
|
||||||
} else if (!cf->has_section_key("plugin", "script")) {
|
|
||||||
WARN_PRINTS("Plugin misses plugin/script: " + path);
|
|
||||||
} else {
|
} else {
|
||||||
|
bool key_missing = false;
|
||||||
|
|
||||||
|
if (!cf->has_section_key("plugin", "name")) {
|
||||||
|
WARN_PRINTS("Plugin config misses \"plugin/name\" key: " + path);
|
||||||
|
key_missing = true;
|
||||||
|
}
|
||||||
|
if (!cf->has_section_key("plugin", "author")) {
|
||||||
|
WARN_PRINTS("Plugin config misses \"plugin/author\" key: " + path);
|
||||||
|
key_missing = true;
|
||||||
|
}
|
||||||
|
if (!cf->has_section_key("plugin", "version")) {
|
||||||
|
WARN_PRINTS("Plugin config misses \"plugin/version\" key: " + path);
|
||||||
|
key_missing = true;
|
||||||
|
}
|
||||||
|
if (!cf->has_section_key("plugin", "description")) {
|
||||||
|
WARN_PRINTS("Plugin config misses \"plugin/description\" key: " + path);
|
||||||
|
key_missing = true;
|
||||||
|
}
|
||||||
|
if (!cf->has_section_key("plugin", "script")) {
|
||||||
|
WARN_PRINTS("Plugin config misses \"plugin/script\" key: " + path);
|
||||||
|
key_missing = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!key_missing) {
|
||||||
String d2 = plugins[i];
|
String d2 = plugins[i];
|
||||||
String name = cf->get_value("plugin", "name");
|
String name = cf->get_value("plugin", "name");
|
||||||
String author = cf->get_value("plugin", "author");
|
String author = cf->get_value("plugin", "author");
|
||||||
@ -117,7 +130,7 @@ void EditorPluginSettings::update_plugins() {
|
|||||||
|
|
||||||
TreeItem *item = plugin_list->create_item(root);
|
TreeItem *item = plugin_list->create_item(root);
|
||||||
item->set_text(0, name);
|
item->set_text(0, name);
|
||||||
item->set_tooltip(0, "Name: " + name + "\nPath: " + path + "\nMain Script: " + script + "\nDescription: " + description);
|
item->set_tooltip(0, TTR("Name:") + " " + name + "\n" + TTR("Path:") + " " + path + "\n" + TTR("Main Script:") + " " + script + "\n" + TTR("Description:") + " " + description);
|
||||||
item->set_metadata(0, d2);
|
item->set_metadata(0, d2);
|
||||||
item->set_text(1, version);
|
item->set_text(1, version);
|
||||||
item->set_metadata(1, script);
|
item->set_metadata(1, script);
|
||||||
@ -138,6 +151,7 @@ void EditorPluginSettings::update_plugins() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updating = false;
|
updating = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user