Commit 94f0398b authored by luyikei's avatar luyikei

ClipLibraryView: Try to add a sub clip when its parent is actually created

Because otherwise clipItems might not have its parent
parent a81ef7d3
......@@ -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: {
......
......@@ -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: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment