Remove description from PluginDescriptor...

... it was simply written to registry and read again, serving no other
purpose.

But still write a blank to registry for backwards compatibility of the .cfg
file.

This makes it irrelevant whether the value of IdentInterface::GetDescription()
ought to be localized (registry values should probably not be).

Therefore IdentInterface::GetDescription can return localized, and it's all
right that the return be computed (as in VST effects), rather than
an unlocalized msgid that we rely on as an internal identifier.
This commit is contained in:
Paul Licameli 2017-10-05 14:13:01 -04:00
parent ef25a1187c
commit 3b90538b84
2 changed files with 9 additions and 16 deletions

View File

@ -1160,11 +1160,6 @@ wxString PluginDescriptor::GetVendor(bool translate) const
return translate ? wxString(wxGetTranslation(mVendor)) : mVendor;
}
wxString PluginDescriptor::GetDescription(bool translate) const
{
return translate ? wxString(wxGetTranslation(mDescription)) : mDescription;
}
bool PluginDescriptor::IsEnabled() const
{
return mEnabled;
@ -1215,11 +1210,6 @@ void PluginDescriptor::SetVendor(const wxString & vendor)
mVendor = vendor;
}
void PluginDescriptor::SetDescription(const wxString & description)
{
mDescription = description;
}
void PluginDescriptor::SetEnabled(bool enable)
{
mEnabled = enable;
@ -2015,12 +2005,18 @@ void PluginManager::LoadGroup(wxFileConfig *pRegistry, PluginType type)
}
plug.SetVendor(strVal);
#if 0
// This was done before version 2.2.2, but the value was not really used
// But absence of a value will cause early versions to skip the group
// Therefore we still write a blank to keep pluginregistry.cfg
// backwards-compatible
// Get the description and bypass group if not found
if (!pRegistry->Read(KEY_DESCRIPTION, &strVal))
{
continue;
}
plug.SetDescription(strVal);
#endif
// Is it enabled...default to no if not found
pRegistry->Read(KEY_ENABLED, &boolVal, false);
@ -2212,7 +2208,8 @@ void PluginManager::SaveGroup(wxFileConfig *pRegistry, PluginType type)
pRegistry->Write(KEY_NAME, plug.GetName(false));
pRegistry->Write(KEY_VERSION, plug.GetVersion(false));
pRegistry->Write(KEY_VENDOR, plug.GetVendor(false));
pRegistry->Write(KEY_DESCRIPTION, plug.GetDescription(false));
// Write a blank -- see comments in LoadGroup:
pRegistry->Write(KEY_DESCRIPTION, wxString{});
pRegistry->Write(KEY_PROVIDERID, plug.GetProviderID());
pRegistry->Write(KEY_ENABLED, plug.IsEnabled());
pRegistry->Write(KEY_VALID, plug.IsValid());
@ -2660,7 +2657,6 @@ PluginDescriptor & PluginManager::CreatePlugin(const PluginID & id,
plug.SetName(ident->GetName());
plug.SetVendor(ident->GetVendor());
plug.SetVersion(ident->GetVersion());
plug.SetDescription(ident->GetDescription());
return plug;
}

View File

@ -66,7 +66,6 @@ public:
wxString GetName(bool translate = true) const;
wxString GetVersion(bool translate = true) const;
wxString GetVendor(bool translate = true) const;
wxString GetDescription(bool translate = true) const;
bool IsEnabled() const;
bool IsValid() const;
@ -81,7 +80,6 @@ public:
void SetName(const wxString & name);
void SetVersion(const wxString & version);
void SetVendor(const wxString & vendor);
void SetDescription(const wxString & description);
void SetEnabled(bool enable);
void SetValid(bool valid);
@ -135,7 +133,6 @@ private:
wxString mName;
wxString mVersion;
wxString mVendor;
wxString mDescription;
wxString mProviderID;
bool mEnabled;
bool mValid;