mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-27 21:15:19 +00:00
Fix some bugs that surfaced
This commit is contained in:
parent
0a6399b52c
commit
4435016fae
@ -37,6 +37,11 @@ InstanceList::InstanceList(const QString &instDir, QObject *parent)
|
|||||||
: QAbstractListModel(parent), m_instDir(instDir)
|
: QAbstractListModel(parent), m_instDir(instDir)
|
||||||
{
|
{
|
||||||
connect(MMC, &MultiMC::aboutToQuit, this, &InstanceList::saveGroupList);
|
connect(MMC, &MultiMC::aboutToQuit, this, &InstanceList::saveGroupList);
|
||||||
|
|
||||||
|
if (!QDir::current().exists(m_instDir))
|
||||||
|
{
|
||||||
|
QDir::current().mkpath(m_instDir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InstanceList::~InstanceList()
|
InstanceList::~InstanceList()
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QJsonParseError>
|
#include <QJsonParseError>
|
||||||
|
#include <QDir>
|
||||||
|
|
||||||
#include "logger/QsLog.h"
|
#include "logger/QsLog.h"
|
||||||
|
|
||||||
@ -233,6 +234,11 @@ bool MojangAccountList::loadList(const QString &filePath)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!QDir::current().exists(path))
|
||||||
|
{
|
||||||
|
QDir::current().mkpath(path);
|
||||||
|
}
|
||||||
|
|
||||||
QFile file(path);
|
QFile file(path);
|
||||||
|
|
||||||
// Try to open the file and fail if we can't.
|
// Try to open the file and fail if we can't.
|
||||||
@ -316,6 +322,11 @@ bool MojangAccountList::saveList(const QString &filePath)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!QDir::current().exists(path))
|
||||||
|
{
|
||||||
|
QDir::current().mkpath(path);
|
||||||
|
}
|
||||||
|
|
||||||
QLOG_INFO() << "Writing account list to" << path;
|
QLOG_INFO() << "Writing account list to" << path;
|
||||||
|
|
||||||
QLOG_DEBUG() << "Building JSON data structure.";
|
QLOG_DEBUG() << "Building JSON data structure.";
|
||||||
|
Loading…
Reference in New Issue
Block a user