1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-09 04:30:09 +00:00
This commit is contained in:
jules 2007-07-23 19:02:09 +00:00
parent 78b5d2994e
commit 08cde09921
9 changed files with 164 additions and 99 deletions

View file

@ -144,13 +144,23 @@ bool PropertiesFile::saveIfNeeded()
return (! needsWriting) || save();
}
bool PropertiesFile::needsToBeSaved() const throw()
{
const ScopedLock sl (getLock());
return needsWriting;
}
bool PropertiesFile::save()
{
const ScopedLock sl (getLock());
stopTimer();
if (file == File::nonexistent || file.isDirectory())
if (file == File::nonexistent
|| file.isDirectory()
|| ! file.getParentDirectory().createDirectory())
return false;
if ((options & storeAsXML) != 0)
@ -292,7 +302,9 @@ PropertiesFile* PropertiesFile::createDefaultAppPropertiesFile (const String& ap
folderName,
commonToAllUsers));
if (file == File::nonexistent || ! file.getParentDirectory().createDirectory())
jassert (file != File::nonexistent);
if (file == File::nonexistent)
return 0;
return new PropertiesFile (file, millisecondsBeforeSaving, propertiesFileOptions);