Only make a copy of the project file when not autosaving
This commit is contained in:
+3
-3
@@ -313,7 +313,7 @@ class GuiMain(QMainWindow):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def saveProject(self):
|
def saveProject(self, isAuto=False):
|
||||||
"""Save the current project.
|
"""Save the current project.
|
||||||
"""
|
"""
|
||||||
if not self.hasProject:
|
if not self.hasProject:
|
||||||
@@ -327,7 +327,7 @@ class GuiMain(QMainWindow):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
self.treeView.saveTreeOrder()
|
self.treeView.saveTreeOrder()
|
||||||
self.theProject.saveProject()
|
self.theProject.saveProject(isAuto)
|
||||||
self.theIndex.saveIndex()
|
self.theIndex.saveIndex()
|
||||||
self.mainMenu.updateRecentProjects()
|
self.mainMenu.updateRecentProjects()
|
||||||
|
|
||||||
@@ -703,7 +703,7 @@ class GuiMain(QMainWindow):
|
|||||||
def _autoSaveProject(self):
|
def _autoSaveProject(self):
|
||||||
if self.hasProject and self.theProject.projChanged and self.theProject.projPath is not None:
|
if self.hasProject and self.theProject.projChanged and self.theProject.projPath is not None:
|
||||||
logger.debug("Autosaving project")
|
logger.debug("Autosaving project")
|
||||||
self.saveProject()
|
self.saveProject(isAuto=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
def _autoSaveDocument(self):
|
def _autoSaveDocument(self):
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ class NWProject():
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def saveProject(self):
|
def saveProject(self, isAuto=False):
|
||||||
|
|
||||||
if self.projPath is None:
|
if self.projPath is None:
|
||||||
self.makeAlert("Project path not set, cannot save.", nwAlert.ERROR)
|
self.makeAlert("Project path not set, cannot save.", nwAlert.ERROR)
|
||||||
@@ -296,7 +296,8 @@ class NWProject():
|
|||||||
logger.debug("Saving project: %s" % self.projPath)
|
logger.debug("Saving project: %s" % self.projPath)
|
||||||
|
|
||||||
# Save a copy of the current file, just in case
|
# Save a copy of the current file, just in case
|
||||||
self._maintainPrevious()
|
if not isAuto:
|
||||||
|
self._maintainPrevious()
|
||||||
|
|
||||||
# Root element and project details
|
# Root element and project details
|
||||||
logger.debug("Writing project meta")
|
logger.debug("Writing project meta")
|
||||||
|
|||||||
Reference in New Issue
Block a user