Fix (hopefully) library dependency resolution.
Installing libs is now enabled, hardcoded. Enable -Wall for all builds. Fix many warnings and latent bugs.
This commit is contained in:
@ -30,7 +30,7 @@
|
||||
|
||||
BaseInstance::BaseInstance(BaseInstancePrivate *d_in, const QString &rootDir,
|
||||
SettingsObject *settings_obj, QObject *parent)
|
||||
: inst_d(d_in), QObject(parent)
|
||||
: QObject(parent), inst_d(d_in)
|
||||
{
|
||||
I_D(BaseInstance);
|
||||
d->m_settings = settings_obj;
|
||||
|
@ -133,16 +133,12 @@ InstanceFactory::InstCreateError InstanceFactory::copyInstance(BaseInstance *&ne
|
||||
{
|
||||
case NoLoadError:
|
||||
return NoCreateError;
|
||||
case UnknownLoadError:
|
||||
{
|
||||
rootDir.removeRecursively();
|
||||
return UnknownCreateError;
|
||||
}
|
||||
case NotAnInstance:
|
||||
{
|
||||
rootDir.removeRecursively();
|
||||
return CantCreateDir;
|
||||
default:
|
||||
case UnknownLoadError:
|
||||
rootDir.removeRecursively();
|
||||
return UnknownCreateError;
|
||||
}
|
||||
}
|
||||
;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ JavaChecker::JavaChecker(QObject *parent) : QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
int JavaChecker::performCheck(QString path)
|
||||
void JavaChecker::performCheck(QString path)
|
||||
{
|
||||
if(QFile::exists(CHECKER_FILE))
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ class JavaChecker : public QObject
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit JavaChecker(QObject *parent = 0);
|
||||
int performCheck(QString path);
|
||||
void performCheck(QString path);
|
||||
|
||||
signals:
|
||||
void checkFinished(JavaCheckResult result);
|
||||
|
@ -274,7 +274,6 @@ bool LegacyInstance::setIntendedVersionId(QString version)
|
||||
|
||||
bool LegacyInstance::shouldUpdate() const
|
||||
{
|
||||
I_D(LegacyInstance);
|
||||
QVariant var = settings().get("ShouldUpdate");
|
||||
if (!var.isValid() || var.toBool() == false)
|
||||
{
|
||||
|
@ -39,18 +39,26 @@ void ModList::startWatching()
|
||||
{
|
||||
is_watching = m_watcher->addPath(m_dir.absolutePath());
|
||||
if (is_watching)
|
||||
{
|
||||
QLOG_INFO() << "Started watching " << m_dir.absolutePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
QLOG_INFO() << "Failed to start watching " << m_dir.absolutePath();
|
||||
}
|
||||
}
|
||||
|
||||
void ModList::stopWatching()
|
||||
{
|
||||
is_watching = !m_watcher->removePath(m_dir.absolutePath());
|
||||
if (!is_watching)
|
||||
{
|
||||
QLOG_INFO() << "Stopped watching " << m_dir.absolutePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
QLOG_INFO() << "Failed to stop watching " << m_dir.absolutePath();
|
||||
}
|
||||
}
|
||||
|
||||
bool ModList::update()
|
||||
@ -64,7 +72,6 @@ bool ModList::update()
|
||||
bool orderWasInvalid = false;
|
||||
|
||||
// first, process the ordered items (if any)
|
||||
int currentOrderIndex = 0;
|
||||
QStringList listOrder = readListFile();
|
||||
for (auto item : listOrder)
|
||||
{
|
||||
@ -363,6 +370,7 @@ QVariant ModList::headerData(int section, Qt::Orientation orientation, int role)
|
||||
case 2:
|
||||
return QString("Minecraft");
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
Qt::ItemFlags ModList::flags(const QModelIndex &index) const
|
||||
|
@ -235,7 +235,6 @@ void OneSixInstance::setShouldUpdate(bool val)
|
||||
|
||||
bool OneSixInstance::shouldUpdate() const
|
||||
{
|
||||
I_D(OneSixInstance);
|
||||
QVariant var = settings().get("ShouldUpdate");
|
||||
if (!var.isValid() || var.toBool() == false)
|
||||
{
|
||||
|
@ -198,7 +198,6 @@ void OneSixUpdate::jarlibStart()
|
||||
|
||||
auto metacache = MMC->metacache();
|
||||
QList<ForgeXzDownloadPtr> ForgeLibs;
|
||||
bool already_forge_xz = false;
|
||||
for (auto lib : libs)
|
||||
{
|
||||
if (lib->hint() == "local")
|
||||
|
@ -281,14 +281,6 @@ InstanceList::InstListError InstanceList::loadList()
|
||||
auto &loader = InstanceFactory::get();
|
||||
auto error = loader.loadInstance(instPtr, subDir);
|
||||
|
||||
switch (error)
|
||||
{
|
||||
case InstanceFactory::NoLoadError:
|
||||
break;
|
||||
case InstanceFactory::NotAnInstance:
|
||||
break;
|
||||
}
|
||||
|
||||
if (error != InstanceFactory::NoLoadError && error != InstanceFactory::NotAnInstance)
|
||||
{
|
||||
QString errorMsg = QString("Failed to load instance %1: ")
|
||||
|
Reference in New Issue
Block a user