Skip to content

Commit e9b603d

Browse files
authored
Release 2.0 RC 2 (#1231)
2 parents 8a9b79a + d93b3aa commit e9b603d

File tree

4 files changed

+18
-28
lines changed

4 files changed

+18
-28
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ opened, a request to update the file format will show up.
7474
reader class is capable of reading all file formats that have been used thus far. The various
7575
data classes have been improved, and a new XML file formart version 1.5 added. Issue #1189.
7676
PRs #1221 and #1232.
77+
* The index is now automatically rebuilt when the project file format is updated. Issue #1235.
78+
PR #1236.
7779
* The project folder on disk is now wrapped in a storage class that the project accesses files
7880
through. It also handles lock files and archiving used for backup. The change is in preparation
7981
for adding a potential single file format. Issue #1222. PR #1225.
@@ -83,6 +85,8 @@ opened, a request to update the file format will show up.
8385
Issue #1152. PR #1225.
8486
* The Config class has been refactored extensively and now also uses pathlib for all paths. Tests
8587
are also switched to using pathlib. Issue #1224. PRs #1228 and #1229.
88+
* The updating of tree order method of the project tree class has been updated for better
89+
performance. PR #1236.
8690

8791
----
8892

novelwriter/core/project.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def __init__(self, mainGui):
7474
# Project Status
7575
self._projOpened = 0 # The time stamp of when the project file was opened
7676
self._projChanged = False # The project has unsaved changes
77-
self._projAltered = False # The project has been altered this session
7877
self._lockedBy = None # Data on which computer has the project open
7978
self._projFiles = [] # A list of all files in the content folder on load
8079

@@ -118,10 +117,6 @@ def projOpened(self):
118117
def projChanged(self):
119118
return self._projChanged
120119

121-
@property
122-
def projAltered(self):
123-
return self._projAltered
124-
125120
@property
126121
def projFiles(self):
127122
return self._projFiles
@@ -236,7 +231,6 @@ def clearProject(self):
236231
# Project Status
237232
self._projOpened = 0
238233
self._projChanged = False
239-
self._projAltered = False
240234

241235
# Project Tree
242236
self._storage.clear()
@@ -375,7 +369,6 @@ def openProject(self, projPath, overrideLock=False):
375369

376370
self.updateWordCounts()
377371
self._projOpened = time()
378-
self._projAltered = False
379372

380373
self._storage.writeLockFile()
381374
self.setProjectChanged(False)
@@ -559,9 +552,6 @@ def setProjectChanged(self, value):
559552
if isinstance(value, bool):
560553
self._projChanged = value
561554
self.projectStatusChanged.emit(self._projChanged)
562-
if value:
563-
# If we've changed the project at all, this should be True
564-
self._projAltered = True
565555
return self._projChanged
566556

567557
##

novelwriter/guimain.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -404,22 +404,20 @@ def closeProject(self, isYes=False):
404404
if self.docEditor.docChanged():
405405
self.saveDocument()
406406

407-
if self.theProject.projAltered:
408-
saveOK = self.saveProject()
409-
doBackup = False
410-
if self.theProject.data.doBackup and self.mainConf.backupOnClose:
411-
doBackup = True
412-
if self.mainConf.askBeforeBackup:
413-
msgYes = self.askQuestion(
414-
self.tr("Backup Project"),
415-
self.tr("Backup the current project?")
416-
)
417-
if not msgYes:
418-
doBackup = False
419-
if doBackup:
420-
self.theProject.backupProject(False)
421-
else:
422-
saveOK = True
407+
saveOK = self.saveProject()
408+
doBackup = False
409+
if self.theProject.data.doBackup and self.mainConf.backupOnClose:
410+
doBackup = True
411+
if self.mainConf.askBeforeBackup:
412+
msgYes = self.askQuestion(
413+
self.tr("Backup Project"),
414+
self.tr("Backup the current project?")
415+
)
416+
if not msgYes:
417+
doBackup = False
418+
419+
if doBackup:
420+
self.theProject.backupProject(False)
423421

424422
if saveOK:
425423
self.closeDocument()

tests/test_core/test_core_project.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,11 +516,9 @@ def testCoreProject_Methods(monkeypatch, mockGUI, fncPath, mockRnd):
516516

517517
# Spell check
518518
theProject.setProjectChanged(False)
519-
theProject._projAltered = False
520519
theProject.data.setSpellCheck(True)
521520
theProject.data.setSpellCheck(False)
522521
assert theProject.projChanged is True
523-
assert theProject.projAltered is True
524522
assert theProject.projOpened > 0
525523

526524
# Spell language

0 commit comments

Comments
 (0)