From 0298a141ade92dc0b69eb63287858d705c0312a2 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sun, 15 Feb 2015 20:25:20 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qthelper.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-70-g09d2