summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
Diffstat (limited to 'logic')
-rw-r--r--logic/BaseInstance.cpp2
-rw-r--r--logic/InstanceFactory.cpp12
-rw-r--r--logic/JavaChecker.cpp2
-rw-r--r--logic/JavaChecker.h2
-rw-r--r--logic/LegacyInstance.cpp1
-rw-r--r--logic/ModList.cpp10
-rw-r--r--logic/OneSixInstance.cpp1
-rw-r--r--logic/OneSixUpdate.cpp1
-rw-r--r--logic/lists/InstanceList.cpp8
9 files changed, 16 insertions, 23 deletions
diff --git a/logic/BaseInstance.cpp b/logic/BaseInstance.cpp
index c38f75ef..6f8222b7 100644
--- a/logic/BaseInstance.cpp
+++ b/logic/BaseInstance.cpp
@@ -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;
diff --git a/logic/InstanceFactory.cpp b/logic/InstanceFactory.cpp
index e1f1f202..66b271d0 100644
--- a/logic/InstanceFactory.cpp
+++ b/logic/InstanceFactory.cpp
@@ -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;
}
- }
- ;
}
diff --git a/logic/JavaChecker.cpp b/logic/JavaChecker.cpp
index fb37245f..daad7281 100644
--- a/logic/JavaChecker.cpp
+++ b/logic/JavaChecker.cpp
@@ -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))
{
diff --git a/logic/JavaChecker.h b/logic/JavaChecker.h
index 60f8b56f..34782383 100644
--- a/logic/JavaChecker.h
+++ b/logic/JavaChecker.h
@@ -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);
diff --git a/logic/LegacyInstance.cpp b/logic/LegacyInstance.cpp
index 6ac03e76..72b6c51a 100644
--- a/logic/LegacyInstance.cpp
+++ b/logic/LegacyInstance.cpp
@@ -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)
{
diff --git a/logic/ModList.cpp b/logic/ModList.cpp
index 8ec73955..d5235fe9 100644
--- a/logic/ModList.cpp
+++ b/logic/ModList.cpp
@@ -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
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp
index 27713860..08b63bf9 100644
--- a/logic/OneSixInstance.cpp
+++ b/logic/OneSixInstance.cpp
@@ -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)
{
diff --git a/logic/OneSixUpdate.cpp b/logic/OneSixUpdate.cpp
index dfb958b2..25e16328 100644
--- a/logic/OneSixUpdate.cpp
+++ b/logic/OneSixUpdate.cpp
@@ -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")
diff --git a/logic/lists/InstanceList.cpp b/logic/lists/InstanceList.cpp
index 72748b5f..b9595578 100644
--- a/logic/lists/InstanceList.cpp
+++ b/logic/lists/InstanceList.cpp
@@ -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: ")