1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-15 17:11:20 +01:00

Use type aliases RegistryPath, RegistryPaths...

... for wxString and vector thereof, holding strings that key into wxConfigBase;
to be replaced later with different types
This commit is contained in:
Paul Licameli
2019-03-01 12:20:51 -05:00
parent dcd211affa
commit df6a2cf479
20 changed files with 295 additions and 287 deletions

View File

@@ -1527,67 +1527,67 @@ void PluginManager::FindFilesInPathList(const wxString & pattern,
return;
}
bool PluginManager::HasSharedConfigGroup(const PluginID & ID, const wxString & group)
bool PluginManager::HasSharedConfigGroup(const PluginID & ID, const RegistryPath & group)
{
return HasGroup(SharedGroup(ID, group));
}
bool PluginManager::GetSharedConfigSubgroups(const PluginID & ID, const wxString & group, wxArrayString & subgroups)
bool PluginManager::GetSharedConfigSubgroups(const PluginID & ID, const RegistryPath & group, RegistryPaths & subgroups)
{
return GetSubgroups(SharedGroup(ID, group), subgroups);
}
bool PluginManager::GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval)
bool PluginManager::GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval)
{
return GetConfig(SharedKey(ID, group, key), value, defval);
}
bool PluginManager::GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval)
bool PluginManager::GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, int & value, int defval)
{
return GetConfig(SharedKey(ID, group, key), value, defval);
}
bool PluginManager::GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval)
bool PluginManager::GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, bool & value, bool defval)
{
return GetConfig(SharedKey(ID, group, key), value, defval);
}
bool PluginManager::GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval)
bool PluginManager::GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, float & value, float defval)
{
return GetConfig(SharedKey(ID, group, key), value, defval);
}
bool PluginManager::GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval)
bool PluginManager::GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, double & value, double defval)
{
return GetConfig(SharedKey(ID, group, key), value, defval);
}
bool PluginManager::SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value)
bool PluginManager::SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const wxString & value)
{
return SetConfig(SharedKey(ID, group, key), value);
}
bool PluginManager::SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value)
bool PluginManager::SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const int & value)
{
return SetConfig(SharedKey(ID, group, key), value);
}
bool PluginManager::SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value)
bool PluginManager::SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const bool & value)
{
return SetConfig(SharedKey(ID, group, key), value);
}
bool PluginManager::SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value)
bool PluginManager::SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const float & value)
{
return SetConfig(SharedKey(ID, group, key), value);
}
bool PluginManager::SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value)
bool PluginManager::SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const double & value)
{
return SetConfig(SharedKey(ID, group, key), value);
}
bool PluginManager::RemoveSharedConfigSubgroup(const PluginID & ID, const wxString & group)
bool PluginManager::RemoveSharedConfigSubgroup(const PluginID & ID, const RegistryPath & group)
{
bool result = GetSettings()->DeleteGroup(SharedGroup(ID, group));
if (result)
@@ -1598,7 +1598,7 @@ bool PluginManager::RemoveSharedConfigSubgroup(const PluginID & ID, const wxStri
return result;
}
bool PluginManager::RemoveSharedConfig(const PluginID & ID, const wxString & group, const wxString & key)
bool PluginManager::RemoveSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key)
{
bool result = GetSettings()->DeleteEntry(SharedKey(ID, group, key));
if (result)
@@ -1609,67 +1609,67 @@ bool PluginManager::RemoveSharedConfig(const PluginID & ID, const wxString & gro
return result;
}
bool PluginManager::HasPrivateConfigGroup(const PluginID & ID, const wxString & group)
bool PluginManager::HasPrivateConfigGroup(const PluginID & ID, const RegistryPath & group)
{
return HasGroup(PrivateGroup(ID, group));
}
bool PluginManager::GetPrivateConfigSubgroups(const PluginID & ID, const wxString & group, wxArrayString & subgroups)
bool PluginManager::GetPrivateConfigSubgroups(const PluginID & ID, const RegistryPath & group, RegistryPaths & subgroups)
{
return GetSubgroups(PrivateGroup(ID, group), subgroups);
}
bool PluginManager::GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval)
bool PluginManager::GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval)
{
return GetConfig(PrivateKey(ID, group, key), value, defval);
}
bool PluginManager::GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval)
bool PluginManager::GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, int & value, int defval)
{
return GetConfig(PrivateKey(ID, group, key), value, defval);
}
bool PluginManager::GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval)
bool PluginManager::GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, bool & value, bool defval)
{
return GetConfig(PrivateKey(ID, group, key), value, defval);
}
bool PluginManager::GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval)
bool PluginManager::GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, float & value, float defval)
{
return GetConfig(PrivateKey(ID, group, key), value, defval);
}
bool PluginManager::GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval)
bool PluginManager::GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, double & value, double defval)
{
return GetConfig(PrivateKey(ID, group, key), value, defval);
}
bool PluginManager::SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value)
bool PluginManager::SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const wxString & value)
{
return SetConfig(PrivateKey(ID, group, key), value);
}
bool PluginManager::SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value)
bool PluginManager::SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const int & value)
{
return SetConfig(PrivateKey(ID, group, key), value);
}
bool PluginManager::SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value)
bool PluginManager::SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const bool & value)
{
return SetConfig(PrivateKey(ID, group, key), value);
}
bool PluginManager::SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value)
bool PluginManager::SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const float & value)
{
return SetConfig(PrivateKey(ID, group, key), value);
}
bool PluginManager::SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value)
bool PluginManager::SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const double & value)
{
return SetConfig(PrivateKey(ID, group, key), value);
}
bool PluginManager::RemovePrivateConfigSubgroup(const PluginID & ID, const wxString & group)
bool PluginManager::RemovePrivateConfigSubgroup(const PluginID & ID, const RegistryPath & group)
{
bool result = GetSettings()->DeleteGroup(PrivateGroup(ID, group));
if (result)
@@ -1680,7 +1680,7 @@ bool PluginManager::RemovePrivateConfigSubgroup(const PluginID & ID, const wxStr
return result;
}
bool PluginManager::RemovePrivateConfig(const PluginID & ID, const wxString & group, const wxString & key)
bool PluginManager::RemovePrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key)
{
bool result = GetSettings()->DeleteEntry(PrivateKey(ID, group, key));
if (result)
@@ -2772,7 +2772,7 @@ wxFileConfig *PluginManager::GetSettings()
return mSettings.get();
}
bool PluginManager::HasGroup(const wxString & group)
bool PluginManager::HasGroup(const RegistryPath & group)
{
wxFileConfig *settings = GetSettings();
@@ -2789,7 +2789,7 @@ bool PluginManager::HasGroup(const wxString & group)
return res;
}
bool PluginManager::GetSubgroups(const wxString & group, wxArrayString & subgroups)
bool PluginManager::GetSubgroups(const RegistryPath & group, RegistryPaths & subgroups)
{
if (group.empty() || !HasGroup(group))
{
@@ -2814,7 +2814,7 @@ bool PluginManager::GetSubgroups(const wxString & group, wxArrayString & subgrou
return true;
}
bool PluginManager::GetConfig(const wxString & key, int & value, int defval)
bool PluginManager::GetConfig(const RegistryPath & key, int & value, int defval)
{
bool result = false;
@@ -2826,7 +2826,7 @@ bool PluginManager::GetConfig(const wxString & key, int & value, int defval)
return result;
}
bool PluginManager::GetConfig(const wxString & key, wxString & value, const wxString & defval)
bool PluginManager::GetConfig(const RegistryPath & key, wxString & value, const wxString & defval)
{
bool result = false;
@@ -2842,7 +2842,7 @@ bool PluginManager::GetConfig(const wxString & key, wxString & value, const wxSt
return result;
}
bool PluginManager::GetConfig(const wxString & key, bool & value, bool defval)
bool PluginManager::GetConfig(const RegistryPath & key, bool & value, bool defval)
{
bool result = false;
@@ -2854,7 +2854,7 @@ bool PluginManager::GetConfig(const wxString & key, bool & value, bool defval)
return result;
}
bool PluginManager::GetConfig(const wxString & key, float & value, float defval)
bool PluginManager::GetConfig(const RegistryPath & key, float & value, float defval)
{
bool result = false;
@@ -2870,7 +2870,7 @@ bool PluginManager::GetConfig(const wxString & key, float & value, float defval)
return result;
}
bool PluginManager::GetConfig(const wxString & key, double & value, double defval)
bool PluginManager::GetConfig(const RegistryPath & key, double & value, double defval)
{
bool result = false;
@@ -2882,7 +2882,7 @@ bool PluginManager::GetConfig(const wxString & key, double & value, double defva
return result;
}
bool PluginManager::SetConfig(const wxString & key, const wxString & value)
bool PluginManager::SetConfig(const RegistryPath & key, const wxString & value)
{
bool result = false;
@@ -2899,7 +2899,7 @@ bool PluginManager::SetConfig(const wxString & key, const wxString & value)
return result;
}
bool PluginManager::SetConfig(const wxString & key, const int & value)
bool PluginManager::SetConfig(const RegistryPath & key, const int & value)
{
bool result = false;
@@ -2915,7 +2915,7 @@ bool PluginManager::SetConfig(const wxString & key, const int & value)
return result;
}
bool PluginManager::SetConfig(const wxString & key, const bool & value)
bool PluginManager::SetConfig(const RegistryPath & key, const bool & value)
{
bool result = false;
@@ -2931,7 +2931,7 @@ bool PluginManager::SetConfig(const wxString & key, const bool & value)
return result;
}
bool PluginManager::SetConfig(const wxString & key, const float & value)
bool PluginManager::SetConfig(const RegistryPath & key, const float & value)
{
bool result = false;
@@ -2947,7 +2947,7 @@ bool PluginManager::SetConfig(const wxString & key, const float & value)
return result;
}
bool PluginManager::SetConfig(const wxString & key, const double & value)
bool PluginManager::SetConfig(const RegistryPath & key, const double & value)
{
bool result = false;
@@ -2964,7 +2964,7 @@ bool PluginManager::SetConfig(const wxString & key, const double & value)
}
/* Return value is a key for lookup in a config file */
wxString PluginManager::SettingsPath(const PluginID & ID, bool shared)
RegistryPath PluginManager::SettingsPath(const PluginID & ID, bool shared)
{
// All the strings reported by PluginDescriptor and used in this function
// persist in the plugin settings configuration file, so they should not
@@ -2994,7 +2994,7 @@ wxString PluginManager::SettingsPath(const PluginID & ID, bool shared)
}
/* Return value is a key for lookup in a config file */
wxString PluginManager::SharedGroup(const PluginID & ID, const wxString & group)
RegistryPath PluginManager::SharedGroup(const PluginID & ID, const RegistryPath & group)
{
wxString path = SettingsPath(ID, true);
@@ -3008,9 +3008,9 @@ wxString PluginManager::SharedGroup(const PluginID & ID, const wxString & group)
}
/* Return value is a key for lookup in a config file */
wxString PluginManager::SharedKey(const PluginID & ID, const wxString & group, const wxString & key)
RegistryPath PluginManager::SharedKey(const PluginID & ID, const RegistryPath & group, const RegistryPath & key)
{
wxString path = SharedGroup(ID, group);
auto path = SharedGroup(ID, group);
if (path.empty())
{
return path;
@@ -3020,9 +3020,9 @@ wxString PluginManager::SharedKey(const PluginID & ID, const wxString & group, c
}
/* Return value is a key for lookup in a config file */
wxString PluginManager::PrivateGroup(const PluginID & ID, const wxString & group)
RegistryPath PluginManager::PrivateGroup(const PluginID & ID, const RegistryPath & group)
{
wxString path = SettingsPath(ID, false);
auto path = SettingsPath(ID, false);
wxFileName ff(group);
if (!ff.GetName().empty())
@@ -3034,9 +3034,9 @@ wxString PluginManager::PrivateGroup(const PluginID & ID, const wxString & group
}
/* Return value is a key for lookup in a config file */
wxString PluginManager::PrivateKey(const PluginID & ID, const wxString & group, const wxString & key)
RegistryPath PluginManager::PrivateKey(const PluginID & ID, const RegistryPath & group, const RegistryPath & key)
{
wxString path = PrivateGroup(ID, group);
auto path = PrivateGroup(ID, group);
if (path.empty())
{
return path;