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

Some additions and fixes to plugin scanning.

This commit is contained in:
jules 2014-02-09 17:42:52 +00:00
parent 3e1c6b6a65
commit 5f4c27d0c2
5 changed files with 57 additions and 12 deletions

View file

@ -215,18 +215,18 @@ bool PropertiesFile::loadAsXml()
bool PropertiesFile::saveAsXml()
{
XmlElement doc (PropertyFileConstants::fileTag);
const StringPairArray& props = getAllProperties();
for (int i = 0; i < getAllProperties().size(); ++i)
for (int i = 0; i < props.size(); ++i)
{
XmlElement* const e = doc.createNewChildElement (PropertyFileConstants::valueTag);
e->setAttribute (PropertyFileConstants::nameAttribute, getAllProperties().getAllKeys() [i]);
e->setAttribute (PropertyFileConstants::nameAttribute, props.getAllKeys() [i]);
// if the value seems to contain xml, store it as such..
if (XmlElement* const childElement = XmlDocument::parse (getAllProperties().getAllValues() [i]))
if (XmlElement* const childElement = XmlDocument::parse (props.getAllValues() [i]))
e->addChildElement (childElement);
else
e->setAttribute (PropertyFileConstants::valueAttribute,
getAllProperties().getAllValues() [i]);
e->setAttribute (PropertyFileConstants::valueAttribute, props.getAllValues() [i]);
}
ProcessScopedLock pl (createProcessLock());
@ -311,14 +311,17 @@ bool PropertiesFile::saveAsBinary()
out->writeInt (PropertyFileConstants::magicNumber);
}
const int numProperties = getAllProperties().size();
const StringPairArray& props = getAllProperties();
const int numProperties = props.size();
const StringArray& keys = props.getAllKeys();
const StringArray& values = props.getAllValues();
out->writeInt (numProperties);
for (int i = 0; i < numProperties; ++i)
{
out->writeString (getAllProperties().getAllKeys() [i]);
out->writeString (getAllProperties().getAllValues() [i]);
out->writeString (keys[i]);
out->writeString (values[i]);
}
out = nullptr;