Use new effect.ParentClip() for more efficient property lookup, fix cutting closeEvent() #3817
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When getting properties for an effect, we also need its parent clip's parameters for positioning.
I realized I'd left a hole in the libopenshot Timeline lookup APIs by not providing a way to easily look that up. Fortunately, @jonoomph was nice enough to fill that hole with recent libopenshot changes.
So, this PR uses
effect.ParentClip()
to grab the corresponding clip data at the same time it looks up the effect data, preventing us having to chase it down later.It also fixes a bug that #3784 created with the cutting module ("Split Clip..." window). It seems that calling
event.accept()
in acloseEvent()
handler, then going on to do more cleanup work on your local data, is a bad idea and leaves you with a window that won't close. Removing theevent.accept()
fixed it, though possibly just callingsuper().close()
would have as well. I haven't explored that possibility.