From 0198539572a5652f0c2a235794fba962598ffe3c Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 2 Aug 2021 09:38:41 -0400 Subject: [PATCH] Make ModuleBrowser hide "hidden" Models when refreshed instead of when initialized. --- src/app/ModuleBrowser.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/app/ModuleBrowser.cpp b/src/app/ModuleBrowser.cpp index 6b450e58..909de09b 100644 --- a/src/app/ModuleBrowser.cpp +++ b/src/app/ModuleBrowser.cpp @@ -52,9 +52,6 @@ static void fuzzySearchInit() { for (plugin::Plugin* plugin : plugin::plugins) { // Iterate model in plugin for (plugin::Model* model : plugin->models) { - if (model->hidden) - continue; - // Get search fields for model std::string tagStr; for (int tagId : model->tagIds) { @@ -534,9 +531,6 @@ struct ModuleBrowser : widget::OpaqueWidget { // Iterate models in plugin int modelIndex = 0; for (plugin::Model* model : plugin->models) { - if (model->hidden) - continue; - // Don't show module if plugin whitelist exists but the module is not in it. if (pluginIt != settings::moduleWhitelist.end()) { auto moduleIt = std::find(pluginIt->second.begin(), pluginIt->second.end(), model->slug); @@ -586,6 +580,10 @@ struct ModuleBrowser : widget::OpaqueWidget { } bool isModelVisible(plugin::Model* model, const std::string& brand, std::set tagIds) { + // Filter hidden + if (model->hidden) + return false; + // Filter brand if (!brand.empty()) { if (model->plugin->brand != brand)