mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-10-03 08:41:42 +00:00
NOISSUE maybe fill in correct FTB App settings paths
This commit is contained in:
@@ -38,7 +38,7 @@ public:
|
|||||||
virtual ~FTBAPage();
|
virtual ~FTBAPage();
|
||||||
QString displayName() const override
|
QString displayName() const override
|
||||||
{
|
{
|
||||||
return tr("FTBApp Import");
|
return tr("FTB App Import");
|
||||||
}
|
}
|
||||||
QIcon icon() const override
|
QIcon icon() const override
|
||||||
{
|
{
|
||||||
|
@@ -64,11 +64,29 @@ QVariant Model::data(const QModelIndex &index, int role) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
#if defined (Q_OS_OSX)
|
||||||
|
QString getFTBASettingsPath() {
|
||||||
|
return FS::PathCombine(QDir::homePath(), "Library/Application Support/.ftba/bin/settings.json");
|
||||||
|
}
|
||||||
|
#elif defined(Q_OS_WIN32)
|
||||||
|
QString getFTBASettingsPath() {
|
||||||
|
auto appDataLocalInner = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
|
||||||
|
QDir appdata(appDataLocalInner);
|
||||||
|
appdata.cdUp();
|
||||||
|
return FS::PathCombine(appdata.absolutePath(), ".ftba/bin/settings.json");
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
QString getFTBASettingsPath() {
|
||||||
|
return FS::PathCombine(QDir::homePath(), ".ftba/bin/settings.json");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
QString getFTBAInstances() {
|
QString getFTBAInstances() {
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto path = FS::PathCombine(QDir::homePath(), ".ftba/bin/settings.json");
|
auto path = getFTBASettingsPath();
|
||||||
data = FS::read(path);
|
data = FS::read(path);
|
||||||
}
|
}
|
||||||
catch (const Exception &e)
|
catch (const Exception &e)
|
||||||
|
Reference in New Issue
Block a user