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

Fix changing of title clip duration broken

BUG: 417505
parent 966add0e
...@@ -884,10 +884,14 @@ const QString ProjectClip::getFileHash() ...@@ -884,10 +884,14 @@ const QString ProjectClip::getFileHash()
fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5); fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5);
break; break;
case ClipType::Text: case ClipType::Text:
case ClipType::TextTemplate:
fileData = getProducerProperty(QStringLiteral("xmldata")).toUtf8(); fileData = getProducerProperty(QStringLiteral("xmldata")).toUtf8();
fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5); fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5);
break; break;
case ClipType::TextTemplate:
fileData = getProducerProperty(QStringLiteral("resource")).toUtf8();
fileData.append(getProducerProperty(QStringLiteral("templatetext")).toUtf8());
fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5);
break;
case ClipType::QText: case ClipType::QText:
fileData = getProducerProperty(QStringLiteral("text")).toUtf8(); fileData = getProducerProperty(QStringLiteral("text")).toUtf8();
fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5); fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5);
...@@ -1020,6 +1024,12 @@ void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool r ...@@ -1020,6 +1024,12 @@ void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool r
emit refreshAnalysisPanel(); emit refreshAnalysisPanel();
} }
if (properties.contains(QStringLiteral("length")) || properties.contains(QStringLiteral("kdenlive:duration"))) { if (properties.contains(QStringLiteral("length")) || properties.contains(QStringLiteral("kdenlive:duration"))) {
// Make sure length is >= kdenlive:duration
int producerLength = getProducerIntProperty(QStringLiteral("length"));
int kdenliveLength = getFramePlaytime();
if (producerLength < kdenliveLength) {
setProducerProperty(QStringLiteral("length"), kdenliveLength);
}
m_duration = getStringDuration(); m_duration = getStringDuration();
if (auto ptr = m_model.lock()) if (auto ptr = m_model.lock())
std::static_pointer_cast<ProjectItemModel>(ptr)->onItemUpdated(std::static_pointer_cast<ProjectClip>(shared_from_this()), std::static_pointer_cast<ProjectItemModel>(ptr)->onItemUpdated(std::static_pointer_cast<ProjectClip>(shared_from_this()),
......
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