Some additional tweaks for Windows

This commit is contained in:
Veronica K. B. Olsen
2020-02-15 21:57:05 +01:00
parent aab9805bc6
commit c991795f0d
+7 -6
View File
@@ -167,7 +167,7 @@ class Config:
if confPath is None:
confRoot = QStandardPaths.writableLocation(QStandardPaths.ConfigLocation)
self.confPath = path.join(confRoot, self.appHandle)
self.confPath = path.join(path.abspath(confRoot), self.appHandle)
else:
logger.info("Setting config from alternative path: %s" % confPath)
self.confPath = confPath
@@ -186,12 +186,13 @@ class Config:
# If config folder does not exist, make it.
# This assumes that the os config folder itself exists.
if self.osWindows:
if not path.isdir(self.confPath):
makedirs(self.confPath)
else:
if not path.isdir(self.confPath):
if not path.isdir(self.confPath):
try:
mkdir(self.confPath)
except Exception as e:
logger.error("Could not create folder: %s" % self.confPath)
logger.error(str(e))
return False
# Check if config file exists
if path.isfile(path.join(self.confPath,self.confFile)):