X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fclipmanager.cpp;h=8eea860b1c9135bf09fbf2550b6119faba421e9c;hb=1a57025e45748243a7a6075f5df0be47f8ffbce2;hp=55a947f879ddc921eeb16d590a1cea1de5b26c0e;hpb=68c7f874ec7e30e78e857cb84401871ab4148b28;p=kdenlive diff --git a/src/clipmanager.cpp b/src/clipmanager.cpp index 55a947f8..8eea860b 100644 --- a/src/clipmanager.cpp +++ b/src/clipmanager.cpp @@ -738,16 +738,22 @@ void ClipManager::slotAddTextTemplateClip(QString titleName, const KUrl &path, c prod.setAttribute("transparency", "1"); prod.setAttribute("in", "0"); - int out = 0; + int duration = 0; QDomDocument titledoc; QFile txtfile(path.path()); if (txtfile.open(QIODevice::ReadOnly) && titledoc.setContent(&txtfile)) { txtfile.close(); - out = titledoc.documentElement().attribute("out").toInt(); + if (titledoc.documentElement().hasAttribute("duration")) { + duration = titledoc.documentElement().attribute("duration").toInt(); + } + else { + // keep some time for backwards compatibility - 26/12/12 + duration = titledoc.documentElement().attribute("out").toInt(); + } } else txtfile.close(); - if (out == 0) out = m_doc->getFramePos(KdenliveSettings::image_duration()); - prod.setAttribute("out", out); + if (duration == 0) duration = m_doc->getFramePos(KdenliveSettings::title_duration()); + prod.setAttribute("out", duration - 1); AddClipCommand *command = new AddClipCommand(m_doc, doc.documentElement(), QString::number(id), true); m_doc->commandStack()->push(command);