Skip to content

Commit

Permalink
Fix some annotations and add deleteLater to non-modal dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo committed Nov 27, 2023
1 parent 4fa2027 commit 50a9b5b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion novelwriter/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def getHandleHeaderCount(self, tHandle: str) -> int:
return 0

def getTableOfContents(
self, rHandle: str, maxDepth: int, skipExcl: bool = True
self, rHandle: str | None, maxDepth: int, skipExcl: bool = True
) -> list[tuple[str, int, str, int]]:
"""Generate a table of contents up to a maximum depth."""
tOrder = []
Expand Down
1 change: 1 addition & 0 deletions novelwriter/dialogs/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def showReleaseNotes(self) -> None:
def _doClose(self) -> None:
"""Close the dialog"""
self.close()
self.deleteLater()
return

##
Expand Down
3 changes: 2 additions & 1 deletion novelwriter/dialogs/projdetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def _doClose(self) -> None:
"""Save settings and close the dialog."""
self._saveGuiSettings()
self.close()
self.deleteLater()
return

##
Expand Down Expand Up @@ -428,7 +429,7 @@ def updateValues(self) -> None:
# Internal Functions
##

def _prepareData(self, rootHandle: str) -> None:
def _prepareData(self, rootHandle: str | None) -> None:
"""Extract the information from the project index."""
logger.debug("Populating ToC from handle '%s'", rootHandle)
self._theToC = SHARED.project.index.getTableOfContents(rootHandle, 2)
Expand Down

0 comments on commit 50a9b5b

Please sign in to comment.