diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-08 09:47:28 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-08 09:47:28 +0200 |
commit | 1b6439215fa0bb6ac1e191c2ffc992e815a53199 (patch) | |
tree | 71a23c3810b470f3058ee7ec8cafa99a226bc41f /common/definitions.cpp | |
parent | 3c05b5816aa0fb978686b0ed16a02336e0981a0e (diff) | |
download | sink-1b6439215fa0bb6ac1e191c2ffc992e815a53199.tar.gz sink-1b6439215fa0bb6ac1e191c2ffc992e815a53199.zip |
Separate config from data and define centrally
Diffstat (limited to 'common/definitions.cpp')
-rw-r--r-- | common/definitions.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/common/definitions.cpp b/common/definitions.cpp index 362faf7..3fc4700 100644 --- a/common/definitions.cpp +++ b/common/definitions.cpp | |||
@@ -25,12 +25,22 @@ | |||
25 | 25 | ||
26 | QString Sink::storageLocation() | 26 | QString Sink::storageLocation() |
27 | { | 27 | { |
28 | return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/sink/storage"; | 28 | return dataLocation() + "/storage"; |
29 | } | ||
30 | |||
31 | QString Sink::dataLocation() | ||
32 | { | ||
33 | return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/sink"; | ||
34 | } | ||
35 | |||
36 | QString Sink::configLocation() | ||
37 | { | ||
38 | return QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/sink"; | ||
29 | } | 39 | } |
30 | 40 | ||
31 | QString Sink::temporaryFileLocation() | 41 | QString Sink::temporaryFileLocation() |
32 | { | 42 | { |
33 | auto path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/sink/temporaryFiles"; | 43 | auto path = dataLocation() + "/temporaryFiles"; |
34 | //FIXME create in a singleton on startup? | 44 | //FIXME create in a singleton on startup? |
35 | QDir dir; | 45 | QDir dir; |
36 | dir.mkpath(path); | 46 | dir.mkpath(path); |