diff --git a/launcher/ui/pages/modplatform/import_ftb/Model.cpp b/launcher/ui/pages/modplatform/import_ftb/Model.cpp index 0021818b..a84fc5b6 100644 --- a/launcher/ui/pages/modplatform/import_ftb/Model.cpp +++ b/launcher/ui/pages/modplatform/import_ftb/Model.cpp @@ -77,12 +77,13 @@ QString getFTBASettingsPath() { #elif defined(Q_OS_WIN32) QString getFTBASettingsPath() { wchar_t buf[BUFFER_SIZE]; - if(!GetEnvironmentVariableW(L"APPDATALOCAL", buf, BUFFER_SIZE)) + if(!GetEnvironmentVariableW(L"LOCALAPPDATA", buf, BUFFER_SIZE)) { return QString(); } QString appDataLocal = QString::fromWCharArray(buf); - return FS::PathCombine(appDataLocal, ".ftba/bin/settings.json"); + QString settingsPath = FS::PathCombine(appDataLocal, ".ftba/bin/settings.json"); + return settingsPath; } #else QString getFTBASettingsPath() { @@ -92,14 +93,14 @@ QString getFTBASettingsPath() { QString getFTBAInstances() { QByteArray data; + auto settingsPath = getFTBASettingsPath(); try { - auto path = getFTBASettingsPath(); - data = FS::read(path); + data = FS::read(settingsPath); } catch (const Exception &e) { - qWarning() << "Could not read FTBA settings file"; + qWarning() << "Could not read FTB App settings file: " << settingsPath; return QString(); } @@ -111,13 +112,13 @@ QString getFTBAInstances() { } catch (Json::JsonException & e) { - qCritical() << "Could not read FTBA settings file as JSON: " << e.cause(); + qCritical() << "Could not read FTB App settings file as JSON: " << e.cause(); return QString(); } } /* -Reference from an FTBA file, as of 28.05.2022 +Reference from an FTB App file, as of 28.05.2022 { "_private": false, "uuid": "25850fc6-ec61-4bc6-8397-77e4497bf922", @@ -183,7 +184,7 @@ bool parseModpackJson(const QByteArray& data, Modpack & out) { } catch (Json::JsonException & e) { - qCritical() << "Could not read FTBA settings file as JSON: " << e.cause(); + qCritical() << "Could not read FTB App settings file as JSON: " << e.cause(); return false; } } @@ -209,7 +210,7 @@ bool tryLoadInstance(const QString& location, Modpack & out) { } catch (const Exception &e) { - qWarning() << "Could not read FTBA instance JSON file: " << jsonLocation; + qWarning() << "Could not read FTB App instance JSON file: " << jsonLocation; return false; } return false;