summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-11-21 15:01:47 +0100
committerTannin <devnull@localhost>2014-11-21 15:01:47 +0100
commitcfb863f6c3ae7406028b9e167a3115250fefbca3 (patch)
treefd7c5a85835098ba26f277c015cf10d289335112 /src
parentf481a7aae31c9f79e115d9e32aefbc304a41e881 (diff)
qt5 compatibility
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a21f41e4..4dbf9ff9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -308,10 +308,17 @@ int main(int argc, char *argv[])
QFile instanceFile(application.applicationDirPath() + "/INSTANCE");
if (instanceFile.open(QIODevice::ReadOnly)) {
instanceID = instanceFile.readAll().trimmed();
- }
+ }
- QString dataPath = instanceID.isEmpty() ? application.applicationDirPath()
- : QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::DataLocation)) + "/" + instanceID;
+ QString dataPath =
+ instanceID.isEmpty() ? application.applicationDirPath()
+ : QDir::fromNativeSeparators(
+#if QT_VERSION >= 0x050000
+ QStandardPaths::writableLocation(QStandardPaths::DataLocation)
+#else
+ QDesktopServices::storageLocation(QDesktopServices::DataLocation)
+#endif
+ );
application.setProperty("dataPath", dataPath);
qDebug("data path: %s", qPrintable(dataPath));