From e1f542b5b01078f03a25e388c43073574a5eee22 Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Fri, 23 May 2014 18:41:22 +0200 Subject: [PATCH] Still trying to fix FTB --- MultiMC.cpp | 4 ++++ logic/lists/InstanceList.cpp | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/MultiMC.cpp b/MultiMC.cpp index 4918ba108..c1fc089c4 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -398,6 +398,10 @@ void MultiMC::initGlobalSettings() #endif m_settings->registerSetting("FTBLauncherDataRoot", ftbDataDefault); m_settings->registerSetting("FTBLauncherRoot", ftbDefault); + QLOG_INFO() << "FTB Launcher paths:" + << m_settings->get("FTBLauncherDataRoot").toString() + << "and" + << m_settings->get("FTBLauncherRoot").toString(); m_settings->registerSetting("FTBRoot"); if (m_settings->get("FTBRoot").isNull()) diff --git a/logic/lists/InstanceList.cpp b/logic/lists/InstanceList.cpp index 1ff0d2ec6..8808d6b5c 100644 --- a/logic/lists/InstanceList.cpp +++ b/logic/lists/InstanceList.cpp @@ -296,19 +296,18 @@ void InstanceList::loadGroupList(QMap &groupMap) QList InstanceList::discoverFTBInstances() { QList records; - QDir dir = QDir(MMC->settings()->get("FTBLauncherRoot").toString()); + QDir dir = QDir(MMC->settings()->get("FTBLauncherDataRoot").toString()); QDir dataDir = QDir(MMC->settings()->get("FTBRoot").toString()); - if (!dir.exists()) - { - QLOG_INFO() << "The FTB launcher directory specified does not exist. Please check your " - "settings."; - return records; - } - else if (!dataDir.exists()) + if (!dataDir.exists()) { QLOG_INFO() << "The FTB directory specified does not exist. Please check your settings"; return records; } + else if (!dir.exists()) + { + QLOG_INFO() << "The FTB launcher data directory specified does not exist. Please check your settings"; + return records; + } dir.cd("ModPacks"); auto allFiles = dir.entryList(QDir::Readable | QDir::Files, QDir::Name); for (auto filename : allFiles) @@ -337,6 +336,7 @@ QList InstanceList::discoverFTBInstances() record.instanceDir = dataDir.absoluteFilePath(record.dirName); record.templateDir = dir.absoluteFilePath(record.dirName); QDir test(record.instanceDir); + QLOG_DEBUG() << dataDir.absolutePath() << record.instanceDir << record.dirName; if (!test.exists()) continue; record.name = attrs.value("name").toString();