summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qdesktopservices.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/util/qdesktopservices.cpp')
-rw-r--r--src/gui/util/qdesktopservices.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index 25fb08f532..1a6661440c 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -54,6 +54,7 @@
#include <qmutex.h>
#include <qplatformservices_qpa.h>
#include <qplatformintegration_qpa.h>
+#include <qdir.h>
QT_BEGIN_NAMESPACE
@@ -283,6 +284,23 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme)
Use QStandardPaths::displayName()
*/
+
+QString QDesktopServices::storageLocationImpl(StandardLocation type)
+{
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+ if (type == DataLocation) {
+ QString xdgDataHome = QLatin1String(qgetenv("XDG_DATA_HOME"));
+ if (xdgDataHome.isEmpty())
+ xdgDataHome = QDir::homePath() + QLatin1String("/.local/share");
+ xdgDataHome += QLatin1String("/data/")
+ + QCoreApplication::organizationName() + QLatin1Char('/')
+ + QCoreApplication::applicationName();
+ return xdgDataHome;
+ }
+#endif
+ return QStandardPaths::writableLocation(static_cast<QStandardPaths::StandardLocation>(type));
+}
+
QT_END_NAMESPACE
#include "qdesktopservices.moc"