]> git.sesse.net Git - kdenlive/commitdiff
Mark project modified when updating clip location:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 11 Dec 2010 11:07:46 +0000 (11:07 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 11 Dec 2010 11:07:46 +0000 (11:07 +0000)
http://kdenlive.org/mantis/view.php?id=1913

svn path=/trunk/kdenlive/; revision=5157

src/documentchecker.cpp
src/kdenlivedoc.cpp

index 163ef8ca6d028b7d3dce4afaabedb02373f341b7..a998171113fe6634e12898c055899442e0c38fda 100644 (file)
@@ -59,7 +59,7 @@ const int LUMAPLACEHOLDER = 12;
 enum TITLECLIPTYPE { TITLE_IMAGE_ELEMENT = 20, TITLE_FONT_ELEMENT = 21 };
 
 DocumentChecker::DocumentChecker(QDomNodeList infoproducers, QDomDocument doc):
-        m_info(infoproducers), m_doc(doc), m_dialog(NULL)
+    m_info(infoproducers), m_doc(doc), m_dialog(NULL)
 {
 
 }
@@ -284,7 +284,7 @@ QString DocumentChecker::searchFileRecursively(const QDir &dir, const QString &m
                 * 1 MB = 1 second per 450 files (or faster)
                 * 10 MB = 9 seconds per 450 files (or faster)
                 */
-                if (file.size() > 1000000*2) {
+                if (file.size() > 1000000 * 2) {
                     fileData = file.read(1000000);
                     if (file.seek(file.size() - 1000000))
                         fileData.append(file.readAll());
@@ -343,6 +343,9 @@ void DocumentChecker::acceptDialog()
     // prepare transitions
     QDomNodeList trans = m_doc.elementsByTagName("transition");
 
+    // Mark document as modified
+    m_doc.documentElement().setAttribute("modified", 1);
+
     QTreeWidgetItem *child = m_ui.treeWidget->topLevelItem(ix);
     while (child) {
         int t = child->data(0, typeRole).toInt();
index 572389272e1913a0f1fcaea1c6531003cf545f6c..0275c2dc16ff66242c1669d2fb3b3c976f037dc5 100644 (file)
@@ -108,6 +108,7 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup
                         QDomNodeList infoproducers = m_document.elementsByTagName("kdenlive_producer");
                         success = checkDocumentClips(infoproducers);
                         if (success) {
+                            if (m_document.documentElement().attribute("modified") == "1") setModified(true);
                             parent->slotGotProgressInfo(i18n("Loading"), 0);
                             QDomElement mlt = m_document.firstChildElement("mlt");
                             QDomElement infoXml = mlt.firstChildElement("kdenlivedoc");
@@ -216,7 +217,7 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup
                                 for (int i = 0; i < props.count(); i++)
                                     m_documentProperties.insert(props.item(i).nodeName(), props.item(i).nodeValue());
                                 setProfilePath(infoXml.attribute("profile"));
-                                setModified(validator.isModified());
+                                if (validator.isModified()) setModified(true);
                                 kDebug() << "Reading file: " << url.path() << ", found clips: " << producers.count();
                             }
                         }