mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-25 15:16:02 +00:00
NOISSUE maybe fill in correct FTB App settings paths
This commit is contained in:
parent
41e5b3b628
commit
efe181bd28
@ -38,7 +38,7 @@ public:
|
||||
virtual ~FTBAPage();
|
||||
QString displayName() const override
|
||||
{
|
||||
return tr("FTBApp Import");
|
||||
return tr("FTB App Import");
|
||||
}
|
||||
QIcon icon() const override
|
||||
{
|
||||
|
@ -64,11 +64,29 @@ QVariant Model::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
|
||||
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() {
|
||||
QByteArray data;
|
||||
try
|
||||
{
|
||||
auto path = FS::PathCombine(QDir::homePath(), ".ftba/bin/settings.json");
|
||||
auto path = getFTBASettingsPath();
|
||||
data = FS::read(path);
|
||||
}
|
||||
catch (const Exception &e)
|
||||
|
Loading…
Reference in New Issue
Block a user