X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fkdenlivedoc.cpp;h=20255581c93602f175211b9742e4ad5cafba78d5;hb=2bb3e6b046c0ecd26ced536bd2bfd0487bc7fb06;hp=4f098d2e61e232f62cd7dddfbb61325cdc9b4fd1;hpb=d1274597179fc48d6db0212336a251a401e1d61f;p=kdenlive diff --git a/src/kdenlivedoc.cpp b/src/kdenlivedoc.cpp index 4f098d2e..20255581 100644 --- a/src/kdenlivedoc.cpp +++ b/src/kdenlivedoc.cpp @@ -354,14 +354,14 @@ void KdenliveDoc::slotAutoSave() { kDebug() << "ERROR; CANNOT CREATE AUTOSAVE FILE"; } kDebug() << "// AUTOSAVE FILE: " << m_autosave->fileName(); - QDomDocument doc; + QString doc; if (KdenliveSettings::dropbframes()) { KdenliveSettings::setDropbframes(false); m_clipManager->updatePreviewSettings(); - doc.setContent(m_render->sceneList()); + doc = m_render->sceneList(); KdenliveSettings::setDropbframes(true); m_clipManager->updatePreviewSettings(); - } else doc.setContent(m_render->sceneList()); + } else doc = m_render->sceneList(); saveSceneList(m_autosave->fileName(), doc); } } @@ -917,10 +917,13 @@ QPoint KdenliveDoc::zone() const { return QPoint(m_zoneStart, m_zoneEnd); } -bool KdenliveDoc::saveSceneList(const QString &path, QDomDocument sceneList) { +bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene) { + QDomDocument sceneList; + sceneList.setContent(scene, true); QDomNode wes = sceneList.elementsByTagName("westley").at(0); - QDomElement addedXml = sceneList.createElement("kdenlivedoc"); + wes.appendChild(addedXml); + QDomElement markers = sceneList.createElement("markers"); addedXml.setAttribute("version", "0.82"); addedXml.setAttribute("profile", profilePath()); @@ -973,7 +976,6 @@ bool KdenliveDoc::saveSceneList(const QString &path, QDomDocument sceneList) { addedXml.appendChild(markers); if (!m_guidesXml.isNull()) addedXml.appendChild(sceneList.importNode(m_guidesXml, true)); - wes.appendChild(addedXml); //wes.appendChild(doc.importNode(kdenliveData, true)); QFile file(path); @@ -982,6 +984,7 @@ bool KdenliveDoc::saveSceneList(const QString &path, QDomDocument sceneList) { KMessageBox::error(kapp->activeWindow(), i18n("Cannot write to file %1", path)); return false; } + QTextStream out(&file); out << sceneList.toString(); file.close(); @@ -1035,7 +1038,7 @@ void KdenliveDoc::moveProjectData(KUrl url) { } } -QString KdenliveDoc::profilePath() const { +const QString &KdenliveDoc::profilePath() const { return m_profile.path; } @@ -1244,7 +1247,7 @@ bool KdenliveDoc::isModified() const { return m_modified; } -QString KdenliveDoc::description() const { +const QString KdenliveDoc::description() const { if (m_url.isEmpty()) return i18n("Untitled") + " / " + m_profile.description; else