mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-25 02:04:23 +00:00
Modified PluginListComponent so that if all paths to scan are deleted, it reverts to the default set of paths for the given format (otherwise there was no way to make it reset to default)
This commit is contained in:
parent
fd855f851e
commit
9d120bf481
1 changed files with 12 additions and 3 deletions
|
|
@ -328,14 +328,23 @@ void PluginListComponent::filesDropped (const StringArray& files, int, int)
|
|||
|
||||
FileSearchPath PluginListComponent::getLastSearchPath (PropertiesFile& properties, AudioPluginFormat& format)
|
||||
{
|
||||
return FileSearchPath (properties.getValue ("lastPluginScanPath_" + format.getName(),
|
||||
format.getDefaultLocationsToSearch().toString()));
|
||||
auto key = "lastPluginScanPath_" + format.getName();
|
||||
|
||||
if (properties.containsKey (key) && properties.getValue (key, {}).trim().isEmpty())
|
||||
properties.removeValue (key);
|
||||
|
||||
return FileSearchPath (properties.getValue (key, format.getDefaultLocationsToSearch().toString()));
|
||||
}
|
||||
|
||||
void PluginListComponent::setLastSearchPath (PropertiesFile& properties, AudioPluginFormat& format,
|
||||
const FileSearchPath& newPath)
|
||||
{
|
||||
properties.setValue ("lastPluginScanPath_" + format.getName(), newPath.toString());
|
||||
auto key = "lastPluginScanPath_" + format.getName();
|
||||
|
||||
if (newPath.getNumPaths() == 0)
|
||||
properties.removeValue (key);
|
||||
else
|
||||
properties.setValue (key, newPath.toString());
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue