summaryrefslogtreecommitdiffstats
path: root/logic/lists/MojangAccountList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logic/lists/MojangAccountList.cpp')
-rw-r--r--logic/lists/MojangAccountList.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/logic/lists/MojangAccountList.cpp b/logic/lists/MojangAccountList.cpp
index 466cc934..439b5da6 100644
--- a/logic/lists/MojangAccountList.cpp
+++ b/logic/lists/MojangAccountList.cpp
@@ -22,6 +22,7 @@
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonParseError>
+#include <QDir>
#include "logger/QsLog.h"
@@ -233,6 +234,11 @@ bool MojangAccountList::loadList(const QString &filePath)
return false;
}
+ if (!QDir::current().exists(path))
+ {
+ QDir::current().mkpath(path);
+ }
+
QFile file(path);
// Try to open the file and fail if we can't.
@@ -316,6 +322,11 @@ bool MojangAccountList::saveList(const QString &filePath)
return false;
}
+ if (!QDir::current().exists(path))
+ {
+ QDir::current().mkpath(path);
+ }
+
QLOG_INFO() << "Writing account list to" << path;
QLOG_DEBUG() << "Building JSON data structure.";