Use LocalAppData fallback for Windows ChatGUI storage
This commit is contained in:
1 parent
b6f80668d1
commit
753aa4217d
2 files changed
+52
-4
No files matched your search
@@ -53,6 +53,9 @@ extern "C" {
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QDir>
|
||||
#ifdef _WIN32
|
||||
#include <QFileInfo>
|
||||
#endif
|
||||
#include <cmath>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
@@ -362,7 +365,11 @@ void MainWindow::setupSoundFromConfig() {
|
||||
}
|
||||
|
||||
if (soundDir.isEmpty()) soundDir = "sounds";
|
||||
#ifdef _WIN32
|
||||
QDir binDir(QFileInfo(m_cfgPath).absolutePath());
|
||||
#else
|
||||
QDir binDir(QApplication::applicationDirPath());
|
||||
#endif
|
||||
QString baseDir = QDir::isAbsolutePath(soundDir) ? soundDir : binDir.absoluteFilePath(soundDir);
|
||||
auto resolvePath = [&baseDir](const QString& f) { return f.isEmpty() ? QString() : QDir::cleanPath(baseDir + "/" + f); };
|
||||
|
||||
|
||||
Reference in new issue
Block a user