Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix crash dragging effect from a track to another

parent cac76dc5
......@@ -551,8 +551,7 @@ std::shared_ptr<EffectStackModel> Core::getItemEffectStack(int itemType, int ite
case (int)ObjectType::TimelineClip:
return m_mainWindow->getCurrentTimeline()->controller()->getModel()->getClipEffectStack(itemId);
case (int)ObjectType::TimelineTrack:
// TODO
return nullptr;
return m_mainWindow->getCurrentTimeline()->controller()->getModel()->getTrackEffectStackModel(itemId);
break;
case (int)ObjectType::BinClip:
return m_binWidget->getClipEffectStack(itemId);
......
......@@ -715,7 +715,7 @@ void EffectStackModel::setEffectStackEnabled(bool enabled)
std::shared_ptr<AbstractEffectItem> EffectStackModel::getEffectStackRow(int row, const std::shared_ptr<TreeItem> &parentItem)
{
return std::static_pointer_cast<AbstractEffectItem>(parentItem ? rootItem->child(row) : rootItem->child(row));
return std::static_pointer_cast<AbstractEffectItem>(parentItem ? parentItem->child(row) : rootItem->child(row));
}
bool EffectStackModel::importEffects(const std::shared_ptr<EffectStackModel> &sourceStack, PlaylistState::ClipState state)
......
......@@ -269,10 +269,11 @@ void EffectStackView::slotStartDrag(const QPixmap &pix, const std::shared_ptr<Ef
auto *mime = new QMimeData;
mime->setData(QStringLiteral("kdenlive/effect"), effectModel->getAssetId().toUtf8());
// TODO this will break if source effect is not on the stack of a timeline clip
ObjectId source = effectModel->getOwnerId();
QByteArray effectSource;
effectSource += QString::number((int)effectModel->getOwnerId().first).toUtf8();
effectSource += QString::number((int)source.first).toUtf8();
effectSource += '-';
effectSource += QString::number((int)effectModel->getOwnerId().second).toUtf8();
effectSource += QString::number((int)source.second).toUtf8();
effectSource += '-';
effectSource += QString::number(effectModel->row()).toUtf8();
mime->setData(QStringLiteral("kdenlive/effectsource"), effectSource);
......
......@@ -28,6 +28,7 @@
#include "core.h"
#include "doc/docundostack.hpp"
#include "effects/effectsrepository.hpp"
#include "effects/effectstack/model/effectstackmodel.hpp"
#include "groupsmodel.hpp"
#include "kdenlivesettings.h"
#include "logger.hpp"
......
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