| 610 | } |
| 611 | |
| 612 | void PluginManager::LoadGroup(audacity::BasicSettings *pRegistry, PluginType type) |
| 613 | { |
| 614 | #ifdef __WXMAC__ |
| 615 | // Bug 1590: On Mac, we should purge the registry of Nyquist plug-ins |
| 616 | // bundled with other versions of Audacity, assuming both versions |
| 617 | // were properly installed in /Applications (or whatever it is called in |
| 618 | // your locale) |
| 619 | |
| 620 | const auto fullExePath = |
| 621 | wxString { PlatformCompatibility::GetExecutablePath() }; |
| 622 | |
| 623 | // Strip rightmost path components up to *.app |
| 624 | wxFileName exeFn{ fullExePath }; |
| 625 | exeFn.SetEmptyExt(); |
| 626 | exeFn.SetName(wxString{}); |
| 627 | while(exeFn.GetDirCount() && !exeFn.GetDirs().back().EndsWith(".app")) |
| 628 | exeFn.RemoveLastDir(); |
| 629 | |
| 630 | const auto goodPath = exeFn.GetPath(); |
| 631 | |
| 632 | if(exeFn.GetDirCount()) |
| 633 | exeFn.RemoveLastDir(); |
| 634 | const auto possiblyBadPath = exeFn.GetPath(); |
| 635 | |
| 636 | auto AcceptPath = [&](const wxString &path) { |
| 637 | if (!path.StartsWith(possiblyBadPath)) |
| 638 | // Assume it's not under /Applications |
| 639 | return true; |
| 640 | if (path.StartsWith(goodPath)) |
| 641 | // It's bundled with this executable |
| 642 | return true; |
| 643 | return false; |
| 644 | }; |
| 645 | #else |
| 646 | auto AcceptPath = [](const wxString&){ return true; }; |
| 647 | #endif |
| 648 | |
| 649 | wxString strVal; |
| 650 | bool boolVal; |
| 651 | wxString cfgPath = REGROOT + GetPluginTypeString(type) + wxCONFIG_PATH_SEPARATOR; |
| 652 | |
| 653 | const auto cfgGroup = pRegistry->BeginGroup(cfgPath); |
| 654 | for(const auto& group : pRegistry->GetChildGroups()) |
| 655 | { |
| 656 | PluginDescriptor plug; |
| 657 | const auto effectGroup = pRegistry->BeginGroup(group); |
| 658 | |
| 659 | auto groupName = ConvertID(group); |
| 660 | |
| 661 | // Bypass group if the ID is already in use |
| 662 | if (mRegisteredPlugins.count(groupName)) |
| 663 | continue; |
| 664 | |
| 665 | // Set the ID and type |
| 666 | plug.SetID(groupName); |
| 667 | plug.SetPluginType(type); |
| 668 | |
| 669 | // Get the provider ID and bypass group if not found |
nothing calls this directly
no test coverage detected