Cleanup + fix another QDomDocument usage

svn path=/trunk/kdenlive/; revision=3190
parent 8110aa66
......@@ -325,22 +325,22 @@ QDomDocument KdenliveDoc::createEmptyDocument(const int videotracks, const int a
void KdenliveDoc::syncGuides(QList <Guide *> guides) {
QDomDocument doc;
QDomElement e;
m_guidesXml.clear();
m_guidesXml = doc.createElement("guides");
QDomElement guideNode = m_guidesXml.createElement("guides");
m_guidesXml.appendChild(guideNode);
QDomElement e;
for (int i = 0; i < guides.count(); i++) {
e = doc.createElement("guide");
e = m_guidesXml.createElement("guide");
e.setAttribute("time", guides.at(i)->position().ms() / 1000);
e.setAttribute("comment", guides.at(i)->label());
m_guidesXml.appendChild(e);
guideNode.appendChild(e);
}
emit guidesUpdated();
}
QDomElement KdenliveDoc::guidesXml() const {
return m_guidesXml;
return m_guidesXml.documentElement();
}
void KdenliveDoc::slotAutoSave() {
......@@ -986,7 +986,7 @@ bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene) {
addedXml.appendChild(markers);
// Add guides
if (!m_guidesXml.isNull()) addedXml.appendChild(sceneList.importNode(m_guidesXml, true));
if (!m_guidesXml.isNull()) addedXml.appendChild(sceneList.importNode(m_guidesXml.documentElement(), true));
// Add clip groups
addedXml.appendChild(sceneList.importNode(m_clipManager->groupsXml(), true));
......@@ -1206,14 +1206,6 @@ int KdenliveDoc::getProducerDuration(const QString &id) {
return result;
}
QDomDocument KdenliveDoc::generateSceneList() {
QDomDocument doc;
QDomElement westley = doc.createElement("westley");
doc.appendChild(westley);
QDomElement prod = doc.createElement("producer");
}
QDomDocument KdenliveDoc::toXml() {
return m_document;
}
......
......@@ -64,7 +64,7 @@ Q_OBJECT public:
void setProducerDuration(const QString &id, int duration);
int getProducerDuration(const QString &id);
Render *renderer();
QDomElement m_guidesXml;
QDomDocument m_guidesXml;
QDomElement guidesXml() const;
ClipManager *clipManager();
void addClip(QDomElement elem, QString clipId, bool createClipItem = true);
......@@ -128,7 +128,6 @@ private:
Timecode m_timecode;
Render *m_render;
QUndoStack *m_commandStack;
QDomDocument generateSceneList();
ClipManager *m_clipManager;
MltVideoProfile m_profile;
QTimer *m_autoSaveTimer;
......
......@@ -214,7 +214,6 @@ void ProjectListView::mouseMoveEvent(QMouseEvent *event) {
if (clickItem) {
QDrag *drag = new QDrag(this);
QMimeData *mimeData = new QMimeData;
QDomDocument doc;
const QList <QTreeWidgetItem *> list = selectedItems();
QStringList ids;
foreach(const QTreeWidgetItem *item, list) {
......
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