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);
}
}
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());
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);
KMessageBox::error(kapp->activeWindow(), i18n("Cannot write to file %1", path));
return false;
}
+
QTextStream out(&file);
out << sceneList.toString();
file.close();
}
}
-QString KdenliveDoc::profilePath() const {
+const QString &KdenliveDoc::profilePath() const {
return m_profile.path;
}
return m_modified;
}
-QString KdenliveDoc::description() const {
+const QString KdenliveDoc::description() const {
if (m_url.isEmpty())
return i18n("Untitled") + " / " + m_profile.description;
else