Change default backup folder to HOME/Backups

Signed-off-by: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com>
This commit is contained in:
Veronica Berglyd Olsen
2023-08-08 19:59:57 +02:00
parent c40d910b69
commit 348e62cd3e
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -68,6 +68,7 @@ class Config:
self._confPath = confRoot.absolute() / self.appHandle # The user config location
self._dataPath = dataRoot.absolute() / self.appHandle # The user data location
self._homePath = Path.home().absolute() # The user's home directory
self._backPath = self._homePath / "Backups"
self._appPath = Path(__file__).parent.absolute()
self._appRoot = self._appPath.parent
@@ -174,7 +175,7 @@ class Config:
# User Paths
self._lastPath = self._homePath # The user's last used path
self._backupPath = self._homePath # Backup path to use, can be none
self._backupPath = self._backPath # Backup path to use, can be none
# Spell Checking Settings
self.spellLanguage = "en"
@@ -355,7 +356,7 @@ class Config:
def setBackupPath(self, backupPath: Path | str):
"""Set the current backup path."""
self._backupPath = checkPath(backupPath, self._homePath)
self._backupPath = checkPath(backupPath, self._backPath)
return
def setTextFont(self, family: str | None, pointSize: int = 12):
@@ -418,7 +419,7 @@ class Config:
if isinstance(self._backupPath, Path):
if self._backupPath.is_dir():
return self._backupPath
return self._homePath
return self._backPath
def errorText(self) -> str:
"""Compile and return error messages from the initialisation of
+1 -1
View File
@@ -427,7 +427,7 @@ class NWProject(QObject):
backupPath = CONFIG.backupPath()
baseDir = backupPath / cleanName
try:
baseDir.mkdir(exist_ok=True)
baseDir.mkdir(exist_ok=True, parents=True)
except Exception as exc:
self.mainGui.makeAlert(self.tr(
"Could not create backup folder."