Skip to content

Commit

Permalink
FIX(client): Fixed config directory path assignment
Browse files Browse the repository at this point in the history
Config directory path in Linux should be picked from XDG_CONFIG_HOME environment variable

Fixes #6029
  • Loading branch information
supersanban committed Aug 7, 2023
1 parent c338d1d commit ac70883
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/mumble/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Version.h"
#include "Global.h"
#include "GlobalShortcutTypes.h"
#include "EnvUtils.h"

#include <QSettings>
#include <QtCore/QStandardPaths>
Expand Down Expand Up @@ -47,7 +48,12 @@ bool Database::findOrCreateDatabase() {
datapaths << Global::get().qdBasePath.absolutePath();
datapaths << QStandardPaths::writableLocation(QStandardPaths::DataLocation);
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
datapaths << QDir::homePath() + QLatin1String("/.config/Mumble");
QString configDirectory = EnvUtils::getenv(QLatin1String("XDG_CONFIG_HOME"));
if (configDirectory.isEmpty()) {
configDirectory = QDir::homePath() + QLatin1String("/.config");
}
configDirectory = configDirectory + QLatin1String("/Mumble");
datapaths << configDirectory;
#endif
datapaths << QDir::homePath();
datapaths << QDir::currentPath();
Expand Down

0 comments on commit ac70883

Please sign in to comment.