Browse Source

Added a new callback ValueTree::Listener::valueTreeRedirected()

tags/2021-05-28
jules 13 years ago
parent
commit
7f74968cef
2 changed files with 8 additions and 7 deletions
  1. +2
    -6
      modules/juce_data_structures/values/juce_ValueTree.cpp
  2. +6
    -1
      modules/juce_data_structures/values/juce_ValueTree.h

+ 2
- 6
modules/juce_data_structures/values/juce_ValueTree.cpp View File

@@ -663,6 +663,8 @@ ValueTree& ValueTree::operator= (const ValueTree& other)
}
object = other.object;
listeners.call (&ValueTree::Listener::valueTreeRedirected, *this);
return *this;
}
@@ -671,12 +673,6 @@ ValueTree::ValueTree (ValueTree&& other) noexcept
: object (static_cast <SharedObject::Ptr&&> (other.object))
{
}
ValueTree& ValueTree::operator= (ValueTree&& other) noexcept
{
object = static_cast <SharedObject::Ptr&&> (other.object);
return *this;
}
#endif
ValueTree::~ValueTree()


+ 6
- 1
modules/juce_data_structures/values/juce_ValueTree.h View File

@@ -93,7 +93,6 @@ public:
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
ValueTree (ValueTree&& other) noexcept;
ValueTree& operator= (ValueTree&& other) noexcept;
#endif
/** Destructor. */
@@ -412,6 +411,12 @@ public:
the listener is registered, and not to any of its children.
*/
virtual void valueTreeParentChanged (ValueTree& treeWhoseParentHasChanged) = 0;
/** This method is called when a tree is made to point to a different internal shared object.
When operator= is used to make a ValueTree refer to a different object, this callback
will be made.
*/
virtual void valueTreeRedirected (ValueTree& treeWhichHasBeenChanged) {}
};
/** Adds a listener to receive callbacks when this node is changed.


Loading…
Cancel
Save