Skip to content
Permalink
Browse files

Use QStandardPaths's DataLocation instead of GenericDataLocation when…

… looking up AppData directory.

GenericDataLocation returns a directory shared by all applications
whereas DataLocation returns an application-specific version.

For example, on OS X, GenericDataLocation returns

    $HOME/Library/Application Support

but DataLocation returns

    $HOME/Library/Application Support/Mumble/Mumble

Fixes #1340
  • Loading branch information...
mkrautz committed Aug 17, 2014
1 parent 37c768d commit 9d668ebcde8dee120fd61b94193b1699bf901de9
Showing with 5 additions and 5 deletions.
  1. +1 −1 src/mumble/Database.cpp
  2. +3 −3 src/mumble/Global.cpp
  3. +1 −1 src/murmur/Meta.cpp
@@ -69,7 +69,7 @@ Database::Database() {

datapaths << g.qdBasePath.absolutePath();
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
datapaths << QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
datapaths << QStandardPaths::writableLocation(QStandardPaths::DataLocation);
#else
datapaths << QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#endif
@@ -38,7 +38,7 @@ static void migrateDataDir() {
#ifdef Q_OS_MAC
QString olddir = QDir::homePath() + QLatin1String("/Library/Preferences/Mumble");
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QString newdir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
QString newdir = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
#else
QString newdir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#endif
@@ -113,7 +113,7 @@ Global::Global() {
QStringList qsl;
qsl << QCoreApplication::instance()->applicationDirPath();
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
qsl << QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
qsl << QStandardPaths::writableLocation(QStandardPaths::DataLocation);
#else
qsl << QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#endif
@@ -147,7 +147,7 @@ Global::Global() {
#else
migrateDataDir();
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
qdBasePath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
qdBasePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
#else
qdBasePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#endif
@@ -126,7 +126,7 @@ void MetaParams::read(QString fname) {

#if defined(Q_OS_WIN)
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
datapaths << QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
datapaths << QStandardPaths::writableLocation(QStandardPaths::DataLocation);
#else
datapaths << QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#endif

0 comments on commit 9d668eb

Please sign in to comment.
You can’t perform that action at this time.