QDesktopServices::storageLocation() calls to QStandardPaths.

This commit is contained in:
Felix Geyer committed 2015-09-12 13:51:49 +02:00
1 parent c714fc89f1
commit 5ad9edc3fd
3 files changed
+7 -6

No files matched your search

+3 -3
View File
@@ -18,9 +18,9 @@
#include "Config.h"
#include <QCoreApplication>
#include <QDesktopServices>
#include <QDir>
#include <QSettings>
#include <QStandardPaths>
#include <QTemporaryFile>
Config* Config::m_instance(Q_NULLPTR);
@@ -53,7 +53,7 @@ Config::Config(QObject* parent)
QString homePath = QDir::homePath();
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
// we can't use QDesktopServices on X11 as it uses XDG_DATA_HOME instead of XDG_CONFIG_HOME
// we can't use QStandardPaths on X11 as it uses XDG_DATA_HOME instead of XDG_CONFIG_HOME
QByteArray env = qgetenv("XDG_CONFIG_HOME");
if (env.isEmpty()) {
userPath = homePath;
@@ -70,7 +70,7 @@ Config::Config(QObject* parent)
userPath += "/keepassx/";
#else
userPath = QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
userPath = QDir::fromNativeSeparators(QStandardPaths::writableLocation(QDesktopServices::AppDataLocation));
// storageLocation() appends the application name ("/keepassx") to the end
userPath += "/";
#endif