mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 20:33:24 +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];
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue