Merge pull request #248 from MultiMC/feature_fix_ftb_lib
Fix FTB local libraries bug
This commit is contained in:
commit
de48f102bd
@ -148,22 +148,23 @@ QStringList OneSixLibrary::files()
|
|||||||
{
|
{
|
||||||
QString cooked_storage = storage;
|
QString cooked_storage = storage;
|
||||||
cooked_storage.replace("${arch}", "32");
|
cooked_storage.replace("${arch}", "32");
|
||||||
retval.append(PathCombine("libraries", cooked_storage));
|
retval.append(cooked_storage);
|
||||||
cooked_storage = storage;
|
cooked_storage = storage;
|
||||||
cooked_storage.replace("${arch}", "64");
|
cooked_storage.replace("${arch}", "64");
|
||||||
retval.append(PathCombine("libraries", cooked_storage));
|
retval.append(cooked_storage);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
retval.append(PathCombine("libraries", storage));
|
retval.append(storage);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OneSixLibrary::filesExist()
|
bool OneSixLibrary::filesExist(const QDir &base)
|
||||||
{
|
{
|
||||||
auto libFiles = files();
|
auto libFiles = files();
|
||||||
for(auto file: libFiles)
|
for(auto file: libFiles)
|
||||||
{
|
{
|
||||||
QFileInfo info(file);
|
QFileInfo info(base, file);
|
||||||
|
QLOG_WARN() << info.absoluteFilePath() << "doesn't exist";
|
||||||
if (!info.exists())
|
if (!info.exists())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
#include <QDir>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "logic/net/URLConstants.h"
|
#include "logic/net/URLConstants.h"
|
||||||
@ -142,6 +143,6 @@ public:
|
|||||||
QString hint() const;
|
QString hint() const;
|
||||||
|
|
||||||
bool extractTo(QString target_dir);
|
bool extractTo(QString target_dir);
|
||||||
bool filesExist();
|
bool filesExist(const QDir &base);
|
||||||
QStringList files();
|
QStringList files();
|
||||||
};
|
};
|
||||||
|
@ -274,7 +274,7 @@ void OneSixUpdate::jarlibStart()
|
|||||||
{
|
{
|
||||||
if (lib->hint() == "local")
|
if (lib->hint() == "local")
|
||||||
{
|
{
|
||||||
if(!lib->filesExist())
|
if(!lib->filesExist(m_inst->librariesPath()))
|
||||||
brokenLocalLibs.append(lib);
|
brokenLocalLibs.append(lib);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user