Commit b9900ba7 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Merge branch 'master' of invent.kde.org:multimedia/kdenlive

parents 7cca6189 f824ed70
Pipeline #90610 passed with stage
in 8 minutes and 59 seconds
......@@ -43,5 +43,25 @@ void SwitchParamWidget::slotShowComment(bool show)
void SwitchParamWidget::slotRefresh()
{
const QSignalBlocker bk(m_checkBox);
m_checkBox->setChecked(m_model->data(m_index, AssetParameterModel::ValueRole) == m_model->data(m_index, AssetParameterModel::MaxRole));
QString max = m_model->data(m_index, AssetParameterModel::MaxRole).toString();
QString val = m_model->data(m_index, AssetParameterModel::ValueRole).toString();
if (val == max) {
m_checkBox->setChecked(true);
} else {
QString min = m_model->data(m_index, AssetParameterModel::MinRole).toString();
if (val == min) {
m_checkBox->setChecked(false);
return;
}
if (val.contains(QLatin1Char(';'))) {
// Value is not equal to min/max, might be caused by a frame > timecode replacement
max = max.section(QLatin1Char(';'), 0, 0);
val = val.section(QLatin1Char(';'), 0, 0);
if (val.endsWith(max.section(QLatin1Char(' '), -1))) {
m_checkBox->setChecked(true);
} else {
m_checkBox->setChecked(false);
}
}
}
}
......@@ -157,9 +157,11 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
QString id(t->get("kdenlive_id"));
int compoId;
int aTrack = t->get_a_track();
if (!timeline->isTrack(t->get_b_track() - 1)) {
if (!timeline->isTrack(timeline->getTrackIndexFromPosition(t->get_b_track() - 1))) {
QString tcInfo = QString("<a href=\"%1\">%2</a>").arg(QString::number(t->get_in()), pCore->timecode().getTimecodeFromFrames(t->get_in()));
m_notesLog << i18n("%1 Composition (%2) with invalid track reference found and removed.", tcInfo, t->get("id"));
m_errorMessage << i18n("Invalid composition %1 found on track %2 at %3, compositing with track %4.", t->get("id"), t->get_b_track(),
t->get_in(), t->get_a_track());
continue;
}
if (aTrack > tractor.count()) {
......
......@@ -150,6 +150,36 @@ bool CompositionModel::requestResize(int size, bool right, Fun &undo, Fun &redo,
};
refresh();
UPDATE_UNDO_REDO(refresh, refresh, undo, redo);
} else {
if (m_assetId == QLatin1String("slide")) {
// Slide composition uses a keyframe at end of composition, so update last keyframe
Fun refresh = [this]() {
QString animation(m_asset->get("rect"));
if (animation.contains(QLatin1Char(';'))) {
QString result = animation.section(QLatin1Char(';'), 0, 0);
result.append(QStringLiteral(";-1="));
result.append(animation.section(QLatin1Char('='), -1));
m_asset->set("rect", result.toUtf8().constData());
}
return true;
};
refresh();
UPDATE_UNDO_REDO(refresh, refresh, undo, redo);
} else if (m_assetId == QLatin1String("wipe")) {
// Slide composition uses a keyframe at end of composition, so update last keyframe
Fun refresh = [this]() {
QString animation(m_asset->get("geometry"));
if (animation.contains(QLatin1Char(';'))) {
QString result = animation.section(QLatin1Char(';'), 0, 0);
result.append(QStringLiteral(";-1="));
result.append(animation.section(QLatin1Char('='), -1));
m_asset->set("geometry", result.toUtf8().constData());
}
return true;
};
refresh();
UPDATE_UNDO_REDO(refresh, refresh, undo, redo);
}
}
}
UPDATE_UNDO_REDO(operation, reverse, undo, redo);
......
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