mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
c45768a09f
commit
0298a141ad
1 changed files with 7 additions and 1 deletions
|
@ -304,7 +304,13 @@ extern "C" const char *system_default_directory(void)
|
||||||
static char filename[PATH_MAX];
|
static char filename[PATH_MAX];
|
||||||
|
|
||||||
if (!*filename) {
|
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);
|
QDir dir(name);
|
||||||
dir.mkpath(name);
|
dir.mkpath(name);
|
||||||
// Why no "dir.encodeName()"? Crazy Qt
|
// Why no "dir.encodeName()"? Crazy Qt
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue