1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-21 01:24:21 +00:00

Ignore empty unique ID when checking for juce::PluginDescription duplicates

This commit is contained in:
Sebastian Kraft 2022-12-07 13:49:59 +01:00
parent e5fc50908e
commit 04f41b670d

View file

@ -28,12 +28,21 @@ namespace juce
bool PluginDescription::isDuplicateOf (const PluginDescription& other) const noexcept
{
const auto tie = [] (const PluginDescription& d)
if ((other.fileOrIdentifier == fileOrIdentifier) &&
(other.deprecatedUid == deprecatedUid))
{
return std::tie (d.fileOrIdentifier, d.deprecatedUid, d.uniqueId);
};
// Only compare uniqueId field if it is set in both descriptions
if ((other.uniqueId > 0) && (uniqueId > 0))
{
return (other.uniqueId == uniqueId);
}
else
{
return true;
}
}
return tie (*this) == tie (other);
return false;
}
static String getPluginDescSuffix (const PluginDescription& d, int uid)