mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Removed a few more places where static objects could cause problems for people who do unwise amounts of work in their static constructors.
This commit is contained in:
parent
fb15840f61
commit
a316bd5f6f
21 changed files with 44 additions and 44 deletions
|
|
@ -90,8 +90,8 @@ File PropertiesFile::Options::getDefaultFile() const
|
|||
File dir (File::getSpecialLocation (commonToAllUsers ? File::commonApplicationDataDirectory
|
||||
: File::userApplicationDataDirectory));
|
||||
|
||||
if (dir == File::nonexistent)
|
||||
return File::nonexistent;
|
||||
if (dir == File())
|
||||
return File();
|
||||
|
||||
dir = dir.getChildFile (folderName.isNotEmpty() ? folderName
|
||||
: applicationName);
|
||||
|
|
@ -165,7 +165,7 @@ bool PropertiesFile::save()
|
|||
stopTimer();
|
||||
|
||||
if (options.doNotSave
|
||||
|| file == File::nonexistent
|
||||
|| file == File()
|
||||
|| file.isDirectory()
|
||||
|| ! file.getParentDirectory().createDirectory())
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
undoManager->perform (new SetPropertyAction (this, name, newValue, var::null, true, false));
|
||||
undoManager->perform (new SetPropertyAction (this, name, newValue, var(), true, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -188,7 +188,7 @@ public:
|
|||
else
|
||||
{
|
||||
if (properties.contains (name))
|
||||
undoManager->perform (new SetPropertyAction (this, name, var::null, properties [name], false, true));
|
||||
undoManager->perform (new SetPropertyAction (this, name, var(), properties [name], false, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ public:
|
|||
else
|
||||
{
|
||||
for (int i = properties.size(); --i >= 0;)
|
||||
undoManager->perform (new SetPropertyAction (this, properties.getName(i), var::null,
|
||||
undoManager->perform (new SetPropertyAction (this, properties.getName(i), var(),
|
||||
properties.getValueAt(i), false, true));
|
||||
}
|
||||
}
|
||||
|
|
@ -230,7 +230,7 @@ public:
|
|||
return ValueTree (s);
|
||||
}
|
||||
|
||||
return ValueTree::invalid;
|
||||
return ValueTree();
|
||||
}
|
||||
|
||||
ValueTree getOrCreateChildWithName (const Identifier typeToMatch, UndoManager* undoManager)
|
||||
|
|
@ -257,7 +257,7 @@ public:
|
|||
return ValueTree (s);
|
||||
}
|
||||
|
||||
return ValueTree::invalid;
|
||||
return ValueTree();
|
||||
}
|
||||
|
||||
bool isAChildOf (const SharedObject* const possibleParent) const noexcept
|
||||
|
|
@ -846,17 +846,17 @@ ValueTree ValueTree::getChild (int index) const
|
|||
|
||||
ValueTree ValueTree::getChildWithName (const Identifier type) const
|
||||
{
|
||||
return object != nullptr ? object->getChildWithName (type) : ValueTree::invalid;
|
||||
return object != nullptr ? object->getChildWithName (type) : ValueTree();
|
||||
}
|
||||
|
||||
ValueTree ValueTree::getOrCreateChildWithName (const Identifier type, UndoManager* undoManager)
|
||||
{
|
||||
return object != nullptr ? object->getOrCreateChildWithName (type, undoManager) : ValueTree::invalid;
|
||||
return object != nullptr ? object->getOrCreateChildWithName (type, undoManager) : ValueTree();
|
||||
}
|
||||
|
||||
ValueTree ValueTree::getChildWithProperty (const Identifier propertyName, const var& propertyValue) const
|
||||
{
|
||||
return object != nullptr ? object->getChildWithProperty (propertyName, propertyValue) : ValueTree::invalid;
|
||||
return object != nullptr ? object->getChildWithProperty (propertyName, propertyValue) : ValueTree();
|
||||
}
|
||||
|
||||
bool ValueTree::isAChildOf (const ValueTree& possibleParent) const
|
||||
|
|
@ -976,7 +976,7 @@ ValueTree ValueTree::readFromStream (InputStream& input)
|
|||
const String type (input.readString());
|
||||
|
||||
if (type.isEmpty())
|
||||
return ValueTree::invalid;
|
||||
return ValueTree();
|
||||
|
||||
ValueTree v (type);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue