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>
This commit is contained in:
Lubomir I. Ivanov 2015-02-15 20:25:20 +02:00 committed by Dirk Hohndel
parent c45768a09f
commit 0298a141ad

View file

@ -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