Make some minor corrections
This commit is contained in:
@@ -306,8 +306,7 @@ class NWProject:
|
|||||||
self._loadProjectLocalisation()
|
self._loadProjectLocalisation()
|
||||||
|
|
||||||
# Update recent projects
|
# Update recent projects
|
||||||
storePath = self._storage.storagePath
|
if storePath := self._storage.storagePath:
|
||||||
if storePath:
|
|
||||||
CONFIG.recentProjects.update(
|
CONFIG.recentProjects.update(
|
||||||
storePath, self._data.name, sum(self._data.initCounts), time()
|
storePath, self._data.name, sum(self._data.initCounts), time()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -163,13 +163,13 @@ class NWStorage:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def initProjectStorage(self, path: str | Path, clearLock: bool = False) -> NWStorageOpen:
|
def initProjectStorage(self, path: str | Path, clearLock: bool = False) -> NWStorageOpen:
|
||||||
"""Initialise the a novelWriter project."""
|
"""Initialise a novelWriter project location."""
|
||||||
inPath = Path(path).resolve()
|
inPath = Path(path).resolve()
|
||||||
|
|
||||||
# Initialise Storage Instance
|
# Initialise Storage Instance
|
||||||
# ===========================
|
# ===========================
|
||||||
|
|
||||||
# Check what we're opening. Only three options are allowed:
|
# Check what we're opening. Only two options are allowed:
|
||||||
# 1. A folder with a nwProject.nwx file in it (not home)
|
# 1. A folder with a nwProject.nwx file in it (not home)
|
||||||
# 2. A full path to an nwProject.nwx file
|
# 2. A full path to an nwProject.nwx file
|
||||||
if inPath.is_dir() and inPath != Path.home().resolve():
|
if inPath.is_dir() and inPath != Path.home().resolve():
|
||||||
|
|||||||
@@ -462,8 +462,7 @@ class GuiMain(QMainWindow):
|
|||||||
if projFile is None:
|
if projFile is None:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Make sure any open project is cleared out first before we load
|
# Make sure any open project is cleared out first
|
||||||
# another one
|
|
||||||
if not self.closeProject():
|
if not self.closeProject():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user