@@ -448,11 +448,18 @@ namespace swift::simplugin::msfs2024common
448448 const CSpecializedSimulatorSettings settings = this ->getSimulatorSettings ();
449449 CSimulatorSettings m_generic = settings.getGenericSettings ();
450450 QStringList excludePatterns = m_generic.getModelExcludeDirectoryPatterns ();
451+ QStringList filterList = m_generic.getModelDirectories ();
451452
452453 bool gui_application = true ;
454+ bool useFilterList = true ;
455+ bool matchFilter = false ;
456+
453457 QString guiName = sGui ->getApplicationName ();
454458 if (guiName.contains (" mapping" )) gui_application = false ;
455459
460+ const CAircraftMatcherSetup setup = m_matchingSettings.get ();
461+ bool skipExcluded = setup.getMatchingMode ().testFlag (CAircraftMatcherSetup::ExcludeNoExcluded);
462+
456463 CAircraftModelList newModels;
457464
458465 for (int i = 0 ; i < static_cast <int >(vSimObjectsAndLiveries.size ()); ++i)
@@ -463,6 +470,9 @@ namespace swift::simplugin::msfs2024common
463470 CAircraftModel modelFromDb =
464471 sGui ->getWebDataServices ()->getModelForModelString (modelLivery.szSimObjectCombinedTitle .trimmed ());
465472
473+ // model is marked as excluded in the database, so skip it
474+ if (modelFromDb.getModelMode () == CAircraftModel::Exclude && skipExcluded && gui_application) { continue ; }
475+
466476 // If the model is in the database, there is a DbKey
467477 int modelkey = modelFromDb.getDbKey ();
468478 if (modelkey) model = modelFromDb; // copy all data from db
@@ -487,6 +497,27 @@ namespace swift::simplugin::msfs2024common
487497 }
488498 if (excluded) continue ; // skip adding this model
489499
500+ if (useFilterList)
501+ {
502+ matchFilter = false ;
503+ for (const QString &rawFilter : filterList)
504+ {
505+ if (rawFilter.trimmed ().contains (" *" ))
506+ {
507+ // wildcard found, disable filter list
508+ useFilterList = false ;
509+ continue ;
510+ }
511+ const QString filter = rawFilter.trimmed ();
512+ if (model.getModelString ().contains (filter, Qt::CaseInsensitive))
513+ {
514+ matchFilter = true ;
515+ break ;
516+ }
517+ }
518+ }
519+ if (useFilterList && !matchFilter) continue ; // skip adding this model
520+
490521 newModels.replaceOrAddModelWithString (model, Qt::CaseInsensitive);
491522 }
492523
@@ -507,7 +538,7 @@ namespace swift::simplugin::msfs2024common
507538 bool givenDistributorsOnly = false ;
508539 bool dbDataOnly = false ;
509540 bool dbIcaoOnly = false ;
510- bool incremnental = true ;
541+ bool incremnental = false ;
511542 bool sortByDistributor = true ;
512543 bool consolidateWithDb = false ;
513544 bool ShowAllInstalledModells = true ; // msfs20424 always show all installed models
0 commit comments