Remove project cache attribute from project class
This commit is contained in:
@@ -85,7 +85,6 @@ class NWProject(QObject):
|
||||
|
||||
# Class Settings
|
||||
self.projPath = None # The full path to where the currently open project is saved
|
||||
self.projCache = None # The full path to the project's cache folder
|
||||
self.projContent = None # The full path to the project's content folder
|
||||
self.projDict = None # The spell check dictionary
|
||||
self.projFiles = [] # A list of all files in the content folder on load
|
||||
@@ -254,7 +253,6 @@ class NWProject(QObject):
|
||||
|
||||
# Project Settings
|
||||
self.projPath = None
|
||||
self.projCache = None
|
||||
self.projContent = None
|
||||
self.projDict = None
|
||||
self.projFiles = []
|
||||
@@ -274,7 +272,6 @@ class NWProject(QObject):
|
||||
# ToDo: These should not be set explicitly, and should stay as Path
|
||||
self.projPath = str(self._storage.runtimePath)
|
||||
self.projContent = str(self._storage.contentPath)
|
||||
self.projCache = str(self._storage.cachePath)
|
||||
|
||||
logger.info("Opening project: %s", self.projPath)
|
||||
|
||||
@@ -478,15 +475,12 @@ class NWProject(QObject):
|
||||
if self.projPath is None or self.projPath == "":
|
||||
return False
|
||||
|
||||
self.projCache = os.path.join(self.projPath, "cache")
|
||||
self.projContent = os.path.join(self.projPath, "content")
|
||||
|
||||
if self.projPath == os.path.expanduser("~"):
|
||||
# Don't make a mess in the user's home folder
|
||||
return False
|
||||
|
||||
if not self._checkFolder(self.projCache):
|
||||
return False
|
||||
if not self._checkFolder(self.projContent):
|
||||
return False
|
||||
|
||||
|
||||
@@ -76,18 +76,6 @@ class NWStorage:
|
||||
return self._runtimePath / "content"
|
||||
return None
|
||||
|
||||
@property
|
||||
def metaPath(self):
|
||||
if self._runtimePath is not None:
|
||||
return self._runtimePath / "meta"
|
||||
return None
|
||||
|
||||
@property
|
||||
def cachePath(self):
|
||||
if self._runtimePath is not None:
|
||||
return self._runtimePath / "cache"
|
||||
return None
|
||||
|
||||
##
|
||||
# Core Methods
|
||||
##
|
||||
@@ -172,6 +160,13 @@ class NWStorage:
|
||||
return self._runtimePath / "meta" / fileName
|
||||
return None
|
||||
|
||||
def getCacheFile(self, fileName):
|
||||
"""Return the path to a file in the project cache folder.
|
||||
"""
|
||||
if self._runtimePath is not None:
|
||||
return self._runtimePath / "cache" / fileName
|
||||
return None
|
||||
|
||||
def readLockFile(self):
|
||||
"""Read the project lock file.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user