From 327fc86ff208cdedbc28b5312fa1ca0287224b7b Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 22 Apr 2021 13:12:10 +0100 Subject: [PATCH] PluginDescription: Also check deprecatedUid when matching plugin identifier strings --- .../processors/juce_PluginDescription.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/juce_audio_processors/processors/juce_PluginDescription.cpp b/modules/juce_audio_processors/processors/juce_PluginDescription.cpp index 6e61ae7017..63f22e23d5 100644 --- a/modules/juce_audio_processors/processors/juce_PluginDescription.cpp +++ b/modules/juce_audio_processors/processors/juce_PluginDescription.cpp @@ -36,20 +36,25 @@ bool PluginDescription::isDuplicateOf (const PluginDescription& other) const noe return tie (*this) == tie (other); } -static String getPluginDescSuffix (const PluginDescription& d) +static String getPluginDescSuffix (const PluginDescription& d, int uid) { return "-" + String::toHexString (d.fileOrIdentifier.hashCode()) - + "-" + String::toHexString (d.uniqueId); + + "-" + String::toHexString (uid); } bool PluginDescription::matchesIdentifierString (const String& identifierString) const { - return identifierString.endsWithIgnoreCase (getPluginDescSuffix (*this)); + const auto matches = [&] (int uid) + { + return identifierString.endsWithIgnoreCase (getPluginDescSuffix (*this, uid)); + }; + + return matches (uniqueId) || matches (deprecatedUid); } String PluginDescription::createIdentifierString() const { - return pluginFormatName + "-" + name + getPluginDescSuffix (*this); + return pluginFormatName + "-" + name + getPluginDescSuffix (*this, uniqueId); } std::unique_ptr PluginDescription::createXml() const