aboutsummaryrefslogtreecommitdiffstats
path: root/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-02-15 20:25:20 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-15 13:29:39 -0800
commit0298a141ade92dc0b69eb63287858d705c0312a2 (patch)
tree93acddfc145f0686941d24c0f4cdb53aae67dbf6 /qthelper.cpp
parentc45768a09ffcc6393912b74ed3661b5a110041e8 (diff)
downloadsubsurface-0298a141ade92dc0b69eb63287858d705c0312a2.tar.gz
qthelper.cpp: use QStandardPaths::DataLocation for older Qt
system_default_directory(): QStandardPaths::AppDataLocation was introduced in Qt 5.4. For older versions we use the deprecated ::DataLocation. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qthelper.cpp')
-rw-r--r--qthelper.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/qthelper.cpp b/qthelper.cpp
index c591f90dd..b26bdf467 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -304,7 +304,13 @@ extern "C" const char *system_default_directory(void)
static char filename[PATH_MAX];
if (!*filename) {
- QString name = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).first();
+ enum QStandardPaths::StandardLocation location;
+#if QT_VERSION >= 0x050400
+ location = QStandardPaths::AppDataLocation;
+#else
+ location = QStandardPaths::DataLocation;
+#endif
+ QString name = QStandardPaths::standardLocations(location).first();
QDir dir(name);
dir.mkpath(name);
// Why no "dir.encodeName()"? Crazy Qt