From 0a6399b52cc72980b4847510cc183b54c75d1821 Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Mon, 2 Dec 2013 11:09:56 +0100 Subject: Unit testing --- logic/lists/InstanceList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'logic/lists/InstanceList.cpp') diff --git a/logic/lists/InstanceList.cpp b/logic/lists/InstanceList.cpp index b9595578..697694b4 100644 --- a/logic/lists/InstanceList.cpp +++ b/logic/lists/InstanceList.cpp @@ -36,11 +36,11 @@ const static int GROUP_FILE_FORMAT_VERSION = 1; InstanceList::InstanceList(const QString &instDir, QObject *parent) : QAbstractListModel(parent), m_instDir(instDir) { + connect(MMC, &MultiMC::aboutToQuit, this, &InstanceList::saveGroupList); } InstanceList::~InstanceList() { - saveGroupList(); } int InstanceList::rowCount(const QModelIndex &parent) const -- cgit v1.2.3 From 4435016faef8a5b57ebb8fece123e6e527e83167 Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Mon, 2 Dec 2013 12:02:37 +0100 Subject: Fix some bugs that surfaced --- logic/lists/InstanceList.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'logic/lists/InstanceList.cpp') diff --git a/logic/lists/InstanceList.cpp b/logic/lists/InstanceList.cpp index 697694b4..94481fb9 100644 --- a/logic/lists/InstanceList.cpp +++ b/logic/lists/InstanceList.cpp @@ -37,6 +37,11 @@ InstanceList::InstanceList(const QString &instDir, QObject *parent) : QAbstractListModel(parent), m_instDir(instDir) { connect(MMC, &MultiMC::aboutToQuit, this, &InstanceList::saveGroupList); + + if (!QDir::current().exists(m_instDir)) + { + QDir::current().mkpath(m_instDir); + } } InstanceList::~InstanceList() -- cgit v1.2.3