Merge 1.6.2 (#1025)
This commit is contained in:
+28
-3
@@ -1,12 +1,37 @@
|
|||||||
# novelWriter Changelog
|
# novelWriter Changelog
|
||||||
|
|
||||||
|
## Version 1.6.2 [2022-03-20]
|
||||||
|
|
||||||
|
### Release Notes
|
||||||
|
|
||||||
|
This is a bugfix release that fixes a couple of minor issues. Projects containing one or more empty
|
||||||
|
documents would trigger a rebuild of the index each time the project was opened. This has now been
|
||||||
|
fixed. Another fix resolves an error message being written to the console logging output when a new
|
||||||
|
document was created. Both errors were harmless.
|
||||||
|
|
||||||
|
### Detailed Changelog
|
||||||
|
|
||||||
|
**Bugfixes**
|
||||||
|
|
||||||
|
* Fixed an issue where projects containing empty documents would trigger an index rebuild on open,
|
||||||
|
but the empty document would be skipped due to a check that skips empty documents. As a
|
||||||
|
consequence, the index would be rebuilt each time the project was opened. Empty documents are now
|
||||||
|
added to the index, resolving this issue. Issue #1020. PR #1022.
|
||||||
|
* Fixed an issue where the shasum calculation would be performed when a new document was created,
|
||||||
|
which would fail as the file did not yet exist. The error was handled, but an error message was
|
||||||
|
printed to the console log. The shasum is now no longer called if the file doesn't already exist.
|
||||||
|
Issue #1021. PR #1023.
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
## Version 1.6.1 [2022-03-16]
|
## Version 1.6.1 [2022-03-16]
|
||||||
|
|
||||||
### Release Notes
|
### Release Notes
|
||||||
|
|
||||||
This is a bugfix and patch release that fixes two recursion/loop issues. One can cause a crash if
|
This is a bugfix and patch release that fixes two recursion/loop issues. One would potentially
|
||||||
the window is resized rapidly, and one can cause a hang with certain search parameters in the
|
cause a crash if the window was resized rapidly, and one would cause a hang with certain search
|
||||||
editor's search box. The Latin American Spanish translation has also been updated.
|
parameters in the editor's search box. The Latin American Spanish translation has also been
|
||||||
|
updated.
|
||||||
|
|
||||||
### Detailed Changelog
|
### Detailed Changelog
|
||||||
|
|
||||||
|
|||||||
@@ -41,9 +41,17 @@ not compatible.</p>
|
|||||||
|
|
||||||
<h3>Patch 1.6.1 – 16 March 2022</h3>
|
<h3>Patch 1.6.1 – 16 March 2022</h3>
|
||||||
|
|
||||||
<p>This is a bugfix and patch release that fixes two recursion/loop issues. One can cause a crash
|
<p>This is a bugfix and patch release that fixes two recursion/loop issues. One would potentially
|
||||||
if the window is resized rapidly, and one can cause a hang with certain search parameters in the
|
cause a crash if the window was resized rapidly, and one would cause a hang with certain search
|
||||||
editor's search box. The Latin American Spanish translation has also been updated.</p>
|
parameters in the editor's search box. The Latin American Spanish translation has also been
|
||||||
|
updated.</p>
|
||||||
|
|
||||||
|
<h3>Patch 1.6.2 – 20 March 2022</h3>
|
||||||
|
|
||||||
|
<p>This is a bugfix release that fixes a couple of minor issues. Projects containing one or more
|
||||||
|
empty documents would trigger a rebuild of the index each time the project was opened. This has now
|
||||||
|
been fixed. Another fix resolves an error message being written to the console logging output when
|
||||||
|
a new document was created. Both errors were harmless.</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -89,9 +89,10 @@ class NWDoc():
|
|||||||
|
|
||||||
theText = ""
|
theText = ""
|
||||||
self._docMeta = {}
|
self._docMeta = {}
|
||||||
self._prevHash = sha256sum(docPath)
|
self._prevHash = None
|
||||||
|
|
||||||
if os.path.isfile(docPath):
|
if os.path.isfile(docPath):
|
||||||
|
self._prevHash = sha256sum(docPath)
|
||||||
try:
|
try:
|
||||||
with open(docPath, mode="r", encoding="utf-8") as inFile:
|
with open(docPath, mode="r", encoding="utf-8") as inFile:
|
||||||
# Check the first <= 10 lines for metadata
|
# Check the first <= 10 lines for metadata
|
||||||
|
|||||||
@@ -112,8 +112,7 @@ class NWIndex():
|
|||||||
|
|
||||||
theDoc = NWDoc(self.theProject, tHandle)
|
theDoc = NWDoc(self.theProject, tHandle)
|
||||||
theText = theDoc.readDocument()
|
theText = theDoc.readDocument()
|
||||||
if theText:
|
self.scanText(tHandle, theText if theText is not None else "")
|
||||||
self.scanText(tHandle, theText)
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -217,18 +216,19 @@ class NWIndex():
|
|||||||
if theItem.itemType != nwItemType.FILE:
|
if theItem.itemType != nwItemType.FILE:
|
||||||
logger.info("Not indexing non-file item '%s'", tHandle)
|
logger.info("Not indexing non-file item '%s'", tHandle)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# Run word counter for the whole text
|
||||||
|
cC, wC, pC = countWords(theText)
|
||||||
|
self._fileMeta[tHandle] = ["H0", cC, wC, pC]
|
||||||
|
|
||||||
|
# If the file's meta data is missing, or the file is out of the
|
||||||
|
# main project, we don't index the content
|
||||||
if theItem.itemLayout == nwItemLayout.NO_LAYOUT:
|
if theItem.itemLayout == nwItemLayout.NO_LAYOUT:
|
||||||
logger.info("Not indexing no-layout item '%s'", tHandle)
|
logger.info("Not indexing no-layout item '%s'", tHandle)
|
||||||
return False
|
return False
|
||||||
if theItem.itemParent is None:
|
if theItem.itemParent is None:
|
||||||
logger.info("Not indexing orphaned item '%s'", tHandle)
|
logger.info("Not indexing orphaned item '%s'", tHandle)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Run word counter for the whole text
|
|
||||||
cC, wC, pC = countWords(theText)
|
|
||||||
self._fileMeta[tHandle] = ["H0", cC, wC, pC]
|
|
||||||
|
|
||||||
# If the file is archived or in trash, we don't index the content
|
|
||||||
if self.theProject.projTree.isTrashRoot(theItem.itemParent):
|
if self.theProject.projTree.isTrashRoot(theItem.itemParent):
|
||||||
logger.debug("Not indexing trash item '%s'", tHandle)
|
logger.debug("Not indexing trash item '%s'", tHandle)
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user