summaryrefslogtreecommitdiffstats
path: root/common/definitions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/definitions.cpp')
-rw-r--r--common/definitions.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/common/definitions.cpp b/common/definitions.cpp
index 4bf3da4..7f4fbbe 100644
--- a/common/definitions.cpp
+++ b/common/definitions.cpp
@@ -30,12 +30,14 @@ QString Sink::storageLocation()
30 30
31QString Sink::dataLocation() 31QString Sink::dataLocation()
32{ 32{
33 return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/sink"; 33 static auto location = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/sink";
34 return location;
34} 35}
35 36
36QString Sink::configLocation() 37QString Sink::configLocation()
37{ 38{
38 return QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/sink"; 39 static auto location = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/sink";
40 return location;
39} 41}
40 42
41QString Sink::temporaryFileLocation() 43QString Sink::temporaryFileLocation()
@@ -43,8 +45,9 @@ QString Sink::temporaryFileLocation()
43 static auto path = dataLocation() + "/temporaryFiles"; 45 static auto path = dataLocation() + "/temporaryFiles";
44 static bool initialized = false; 46 static bool initialized = false;
45 if (!initialized) { 47 if (!initialized) {
46 QDir{}.mkpath(path); 48 if (QDir{}.mkpath(path)) {
47 initialized = true; 49 initialized = true;
50 }
48 } 51 }
49 return path; 52 return path;
50} 53}