From 5864aea3d325238e2fcc3c076a3f6d81454a4015 Mon Sep 17 00:00:00 2001 From: IanCaio Date: Sun, 25 Oct 2020 09:59:39 -0300 Subject: [PATCH] Fixes bug with cloning Automation Tracks Fixes bug from issue #5595. When cloning an automation track, the IDs from the recently created AutomationPatterns weren't being resolved, causing them to show as disconnected automations. This PR fixes the issue by adding a call to AutomationPattern::resolveAllIDs() on the Track::clone() method. It also fixes the code style on that method. --- src/core/Track.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 70da1e1d7..f2630b318 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -2554,12 +2554,15 @@ Track * Track::create( const QDomElement & element, TrackContainer * tc ) /*! \brief Clone a track from this track * */ -Track * Track::clone() +Track* Track::clone() { QDomDocument doc; - QDomElement parent = doc.createElement( "clone" ); - saveState( doc, parent ); - return create( parent.firstChild().toElement(), m_trackContainer ); + QDomElement parent = doc.createElement("clone"); + saveState(doc, parent); + Track* t = create(parent.firstChild().toElement(), m_trackContainer); + + AutomationPattern::resolveAllIDs(); + return t; }