diff --git a/app/widget/timelinewidget/tool/import.cpp b/app/widget/timelinewidget/tool/import.cpp index 268873bc0..2a263560e 100644 --- a/app/widget/timelinewidget/tool/import.cpp +++ b/app/widget/timelinewidget/tool/import.cpp @@ -82,7 +82,7 @@ void ImportTool::DragEnter(TimelineViewMouseEvent *event) if (f && f->GetTotalStreamCount()) { // If the Item is Footage, we can create a Ghost from it - dragged_footage_.insert(f, enabled_streams); + dragged_footage_.append({f, enabled_streams}); } } @@ -175,16 +175,16 @@ void ImportTool::DragDrop(TimelineViewMouseEvent *event) void ImportTool::PlaceAt(const QVector &footage, const rational &start, bool insert) { - QMap > refs; + DraggedFootageData refs; foreach (ViewerOutput* f, footage) { - refs.insert(f, f->GetEnabledStreamsAsReferences()); + refs.append({f, f->GetEnabledStreamsAsReferences()}); } PlaceAt(refs, start, insert); } -void ImportTool::PlaceAt(const QMap > &footage, const rational &start, bool insert) +void ImportTool::PlaceAt(const DraggedFootageData &footage, const rational &start, bool insert) { dragged_footage_ = footage; @@ -196,10 +196,10 @@ void ImportTool::PlaceAt(const QMap > & DropGhosts(insert); } -void ImportTool::FootageToGhosts(rational ghost_start, const QMap > &sorted, const rational& dest_tb, const int& track_start) +void ImportTool::FootageToGhosts(rational ghost_start, const DraggedFootageData &sorted, const rational& dest_tb, const int& track_start) { for (auto it=sorted.cbegin(); it!=sorted.cend(); it++) { - ViewerOutput* footage = it.key(); + ViewerOutput* footage = it->first; if (footage == sequence()) { // Prevent cyclical dependency @@ -233,7 +233,7 @@ void ImportTool::FootageToGhosts(rational ghost_start, const QMapsecond) { Track::Type track_type = ref.type(); TimelineViewGhostItem* ghost = new TimelineViewGhostItem(); @@ -249,7 +249,7 @@ void ImportTool::FootageToGhosts(rational ghost_start, const QMapfirst, ref.ToString()}; ghost->SetData(TimelineViewGhostItem::kAttachedFootage, QVariant::fromValue(af)); ghost->SetMode(Timeline::kMove); @@ -331,8 +331,8 @@ void ImportTool::DropGhosts(bool insert) QVector footage_only; for (auto it=dragged_footage_.cbegin(); it!=dragged_footage_.cend(); it++) { - if (!footage_only.contains(it.key())) { - footage_only.append(it.key()); + if (!footage_only.contains(it->first)) { + footage_only.append(it->first); } } diff --git a/app/widget/timelinewidget/tool/import.h b/app/widget/timelinewidget/tool/import.h index 8baf868ba..70ad33676 100644 --- a/app/widget/timelinewidget/tool/import.h +++ b/app/widget/timelinewidget/tool/import.h @@ -35,8 +35,10 @@ public: virtual void DragLeave(QDragLeaveEvent *event) override; virtual void DragDrop(TimelineViewMouseEvent *event) override; + using DraggedFootageData = QVector > >; + void PlaceAt(const QVector &footage, const rational& start, bool insert); - void PlaceAt(const QMap > &footage, const rational& start, bool insert); + void PlaceAt(const DraggedFootageData &footage, const rational& start, bool insert); enum DropWithoutSequenceBehavior { kDWSAsk, @@ -46,13 +48,13 @@ public: }; private: - void FootageToGhosts(rational ghost_start, const QMap > &footage, const rational &dest_tb, const int &track_start); + void FootageToGhosts(rational ghost_start, const DraggedFootageData &footage, const rational &dest_tb, const int &track_start); void PrepGhosts(const rational &frame, const int &track_index); void DropGhosts(bool insert); - QMap > dragged_footage_; + DraggedFootageData dragged_footage_; int import_pre_buffer_;