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 on effect deletion, fix mouse wheel not working on effect params

parent b130e1af
......@@ -81,6 +81,13 @@ void EffectStackModel::removeEffect(std::shared_ptr<EffectItemModel> effect)
Q_ASSERT(m_allItems.count(effect->getId()) > 0);
int parentId = -1;
if (auto ptr = effect->parentItem().lock()) parentId = ptr->getId();
int current = 0;
if (auto srv = m_service.lock()) {
current = srv->get_int("kdenlive:activeeffect");
if (current >= rootItem->childCount() - 1) {
srv->set("kdenlive:activeeffect", --current);
}
}
Fun undo = addItem_lambda(effect, parentId);
Fun redo = removeItem_lambda(effect->getId());
bool res = redo();
......@@ -447,6 +454,9 @@ KeyframeModel *EffectStackModel::getEffectKeyframeModel()
if (ptr) {
ix = ptr->get_int("kdenlive:activeeffect");
}
if (ix < 0) {
return nullptr;
}
std::shared_ptr<EffectItemModel> sourceEffect = std::static_pointer_cast<EffectItemModel>(rootItem->child(ix));
std::shared_ptr<KeyframeModelList> listModel = sourceEffect->getKeyframeModel();
if (listModel) {
......
......@@ -241,12 +241,9 @@ bool CollapsibleEffectView::eventFilter(QObject *o, QEvent *e)
return false;
}
if (qobject_cast<QAbstractSpinBox *>(o)) {
if (qobject_cast<QAbstractSpinBox *>(o)->focusPolicy() == Qt::WheelFocus) {
e->accept();
return false;
}
e->ignore();
return true;
//if (qobject_cast<QAbstractSpinBox *>(o)->focusPolicy() == Qt::WheelFocus) {
e->accept();
return false;
}
if (qobject_cast<KComboBox *>(o)) {
if (qobject_cast<KComboBox *>(o)->focusPolicy() == Qt::WheelFocus) {
......@@ -257,12 +254,9 @@ bool CollapsibleEffectView::eventFilter(QObject *o, QEvent *e)
return true;
}
if (qobject_cast<QProgressBar *>(o)) {
if (qobject_cast<QProgressBar *>(o)->focusPolicy() == Qt::WheelFocus) {
e->accept();
return false;
}
e->ignore();
return true;
//if (qobject_cast<QProgressBar *>(o)->focusPolicy() == Qt::WheelFocus)*/ {
e->accept();
return false;
}
}
return QWidget::eventFilter(o, e);
......
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