diff --git a/src/controllers/plugins/PluginController.hpp b/src/controllers/plugins/PluginController.hpp index dab89dd15..0ca7f4b7f 100644 --- a/src/controllers/plugins/PluginController.hpp +++ b/src/controllers/plugins/PluginController.hpp @@ -66,6 +66,13 @@ struct PluginMeta { this->libraryPermissions.insert(t.toString()); } } + + bool hasDangerousLibraries() + { + const auto *perms = &this->libraryPermissions; + return perms->contains("io") || perms->contains("package") || + perms->contains("os"); + } }; class Plugin diff --git a/src/widgets/settingspages/PluginsPage.cpp b/src/widgets/settingspages/PluginsPage.cpp index 880b0015d..96471e1e9 100644 --- a/src/widgets/settingspages/PluginsPage.cpp +++ b/src/widgets/settingspages/PluginsPage.cpp @@ -93,19 +93,15 @@ void PluginsPage::rebuildContent() pl->addRow("License", new QLabel(plugin->meta.license)); QString libString; - bool hasDangerous = false; for (const auto &library : plugin->meta.libraryPermissions) { if (!libString.isEmpty()) { libString += ", "; } - if (library == "os" || library == "io" || library == "package") - { - hasDangerous = true; - } libString += library; } + bool hasDangerous = plugin->meta.hasDangerousLibraries(); if (hasDangerous) { libString += "\nDetected potentially dangerous libraries used, be "