Browse Source

Make ModuleBrowser hide "hidden" Models when refreshed instead of when initialized.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
0198539572
1 changed files with 4 additions and 6 deletions
  1. +4
    -6
      src/app/ModuleBrowser.cpp

+ 4
- 6
src/app/ModuleBrowser.cpp View File

@@ -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<int> tagIds) {
// Filter hidden
if (model->hidden)
return false;

// Filter brand
if (!brand.empty()) {
if (model->plugin->brand != brand)


Loading…
Cancel
Save