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:
Petr Mrázek
2013-12-01 16:34:51 +01:00
parent a3fbf05c7b
commit f56eff04ef
29 changed files with 246 additions and 262 deletions

View File

@ -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;

View File

@ -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;
}
}
;
}

View File

@ -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))
{

View 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);

View File

@ -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)
{

View File

@ -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

View File

@ -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)
{

View File

@ -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")

View File

@ -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: ")