Hello,
Using the selectionManager, I noticed that the deleteSelected() method seems to be malfunctioning.
I have selected a track ( tracktion_engine::Track ) and then call the deleteSelected() method from the SelectionManager.
This method at the end it gets to the findClassFor(…) method :
SelectableClass* SelectableClass::findClassFor (const Selectable& s)
{
#if ! JUCE_DEBUG
for (auto cls : getAllSelectableClasses())
if (auto c = cls->getClassForObject (&s))
return c;
#else
SelectableClass* result = nullptr;
for (auto cls : getAllSelectableClasses())
{
if (auto c = cls->getClassForObject (&s))
{
if (result == nullptr)
result = c;
else
jassertfalse; // more than one SelectableClass thinks it applies to this object
}
}
if (result != nullptr)
return result;
#endif
return {};
}
But the getAllSelectableClasses() method always returns a null array and thus the deleteSelected()
void SelectionManager::deleteSelected()
{
const juce::ScopedLock sl (lock);
if (auto cls = getFirstSelectableClass())
// use a local copy of the list, as it will change as things get deleted + deselected
cls->deleteSelected (SelectableList (selected), false);
}
never enters the if condition.
Could anyone help me ?