r13790 by jghali - #8081 : error in reasoning in autosave feature Autosave now writes to a .autosave file so that original file is only overwritten by user action

scribus-commit scribus-commit at lists.scribus.net
Wed Jul 22 23:30:13 CEST 2009


Revision: 13790
Author: jghali
Date: 2009-07-22T21:25:19.592379Z
Commit message: #8081 : error in reasoning in autosave feature
Autosave now writes to a .autosave file so that original file is only overwritten by user action

Changeset: 
M  /trunk/Scribus/scribus/scribuswin.cpp

Diffs:
Index: scribus/scribuswin.cpp
===================================================================
--- scribus/scribuswin.cpp	(revision 13789)
+++ scribus/scribuswin.cpp	(revision 13790)
@@ -92,11 +92,14 @@
 {
 	if ((m_Doc->hasName) && (m_Doc->isModified()))
 	{
-		moveFile(m_Doc->DocName, m_Doc->DocName+".bak");
+		//#8081 : change behavior of autosave, autosave writes now to an .autosave file
+		//instead of overwriting source document
+		//moveFile(m_Doc->DocName, m_Doc->DocName+".bak");
 		FileLoader fl(m_Doc->DocName);
-		if (fl.SaveFile(m_Doc->DocName, m_Doc, 0))
+		if (fl.SaveFile(m_Doc->DocName+".autosave", m_Doc, 0))
 		{
-			m_Doc->setModified(false);
+			//#8081 related : do not unset modified flag until user really save file
+			//m_Doc->setModified(false);
 			setWindowTitle(QDir::convertSeparators(m_Doc->DocName));
 			qApp->processEvents();
 			emit AutoSaved();




More information about the scribus-commit mailing list