[vlmc-devel] ClipLibraryView: Try to add a sub clip when its parent is actually created
Yikai Lu
git at videolan.org
Wed Jun 21 12:56:40 CEST 2017
vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Wed Jun 21 19:52:23 2017 +0900| [94f0398ba0f07ea25289669132440e050620b5ae] | committer: Yikai Lu
ClipLibraryView: Try to add a sub clip when its parent is actually created
Because otherwise clipItems might not have its parent
> https://code.videolan.org/videolan/vlmc/commit/94f0398ba0f07ea25289669132440e050620b5ae
---
src/Gui/library/ui/ClipItem.qml | 10 +++++++++-
src/Gui/library/ui/ClipLibraryView.qml | 8 --------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/Gui/library/ui/ClipItem.qml b/src/Gui/library/ui/ClipItem.qml
index 3236bbc7..df4ac7a6 100644
--- a/src/Gui/library/ui/ClipItem.qml
+++ b/src/Gui/library/ui/ClipItem.qml
@@ -48,7 +48,15 @@ Rectangle {
}
Component.onCompleted: {
- clipLibraryView.clipItems.push( this )
+ clipLibraryView.clipItems.push( this );
+ if ( !isBaseClip ) {
+ for ( var i = 0; i < clipItems.length; ++i ) {
+ if ( clipItems[i].mediaId === mediaId && clipItems[i].isBaseClip ) {
+ clipItems[i].addSubClip( uuid );
+ break;
+ }
+ }
+ }
}
Component.onDestruction: {
diff --git a/src/Gui/library/ui/ClipLibraryView.qml b/src/Gui/library/ui/ClipLibraryView.qml
index c42d2c0e..e90e54e2 100644
--- a/src/Gui/library/ui/ClipLibraryView.qml
+++ b/src/Gui/library/ui/ClipLibraryView.qml
@@ -46,14 +46,6 @@ Rectangle {
onClipAdded: {
var clip = view.clip( uuid );
clips.append( clip );
- if ( !clip.isBaseClip ) {
- for ( var i = 0; i < clipItems.length; ++i ) {
- if ( clipItems[i].mediaId === clip.mediaId && clipItems[i].isBaseClip ) {
- clipItems[i].addSubClip( uuid );
- break;
- }
- }
- }
}
onClipOnTimelineChanged: {
More information about the Vlmc-devel
mailing list