summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
Diffstat (limited to 'logic')
-rw-r--r--logic/OneSixUpdate.cpp7
-rw-r--r--logic/VersionFinal.cpp2
-rw-r--r--logic/VersionFinal.h2
-rw-r--r--logic/auth/YggdrasilTask.cpp8
-rw-r--r--logic/auth/YggdrasilTask.h2
-rw-r--r--logic/lists/InstanceList.cpp2
-rw-r--r--logic/tasks/Task.cpp4
-rw-r--r--logic/tasks/Task.h2
8 files changed, 17 insertions, 12 deletions
diff --git a/logic/OneSixUpdate.cpp b/logic/OneSixUpdate.cpp
index 65f30cda..cddd0def 100644
--- a/logic/OneSixUpdate.cpp
+++ b/logic/OneSixUpdate.cpp
@@ -96,7 +96,6 @@ void OneSixUpdate::versionFileStart()
void OneSixUpdate::versionFileFinished()
{
NetActionPtr DlJob = specificVersionDownloadJob->first();
- OneSixInstance *inst = (OneSixInstance *)m_inst;
QString version_id = targetVersion->descriptor();
QString inst_dir = m_inst->instanceRoot();
@@ -152,7 +151,7 @@ void OneSixUpdate::assetIndexStart()
QString assetName = version->assets;
QUrl indexUrl = "http://" + URLConstants::AWS_DOWNLOAD_INDEXES + assetName + ".json";
QString localPath = assetName + ".json";
- auto job = new NetJob("Asset index for " + inst->name());
+ auto job = new NetJob(tr("Asset index for %1").arg(inst->name()));
auto metacache = MMC->metacache();
auto entry = metacache->resolveEntry("asset_indexes", localPath);
@@ -198,7 +197,7 @@ void OneSixUpdate::assetIndexFinished()
if (dls.size())
{
setStatus(tr("Getting the assets files from Mojang..."));
- auto job = new NetJob("Assets for " + inst->name());
+ auto job = new NetJob(tr("Assets for %1").arg(inst->name()));
for (auto dl : dls)
job->addNetAction(dl);
jarlibDownloadJob.reset(job);
@@ -255,7 +254,7 @@ void OneSixUpdate::jarlibStart()
QString localPath = version_id + "/" + version_id + ".jar";
QString urlstr = "http://" + URLConstants::AWS_DOWNLOAD_VERSIONS + localPath;
- auto job = new NetJob("Libraries for instance " + inst->name());
+ auto job = new NetJob(tr("Libraries for instance %1").arg(inst->name()));
auto metacache = MMC->metacache();
auto entry = metacache->resolveEntry("versions", localPath);
diff --git a/logic/VersionFinal.cpp b/logic/VersionFinal.cpp
index b465df68..ed90c148 100644
--- a/logic/VersionFinal.cpp
+++ b/logic/VersionFinal.cpp
@@ -38,7 +38,7 @@ VersionFinal::VersionFinal(OneSixInstance *instance, QObject *parent)
clear();
}
-bool VersionFinal::reload(const bool onlyVanilla, const QStringList &external)
+void VersionFinal::reload(const bool onlyVanilla, const QStringList &external)
{
//FIXME: source of epic failure.
beginResetModel();
diff --git a/logic/VersionFinal.h b/logic/VersionFinal.h
index 4ddfe9f4..0bf95707 100644
--- a/logic/VersionFinal.h
+++ b/logic/VersionFinal.h
@@ -38,7 +38,7 @@ public:
virtual int columnCount(const QModelIndex &parent) const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
- bool reload(const bool onlyVanilla = false, const QStringList &external = QStringList());
+ void reload(const bool onlyVanilla = false, const QStringList &external = QStringList());
void clear();
bool canRemove(const int index) const;
diff --git a/logic/auth/YggdrasilTask.cpp b/logic/auth/YggdrasilTask.cpp
index 277d7bfd..7679b11f 100644
--- a/logic/auth/YggdrasilTask.cpp
+++ b/logic/auth/YggdrasilTask.cpp
@@ -54,7 +54,7 @@ void YggdrasilTask::executeTask()
counter.setSingleShot(false);
counter.start(time_step);
progress(0, timeout_max);
- connect(&timeout_keeper, &QTimer::timeout, this, &YggdrasilTask::abort);
+ connect(&timeout_keeper, &QTimer::timeout, this, &YggdrasilTask::abortByTimeout);
connect(&counter, &QTimer::timeout, this, &YggdrasilTask::heartbeat);
}
@@ -76,6 +76,12 @@ void YggdrasilTask::abort()
m_netReply->abort();
}
+void YggdrasilTask::abortByTimeout()
+{
+ progress(timeout_max, timeout_max);
+ m_netReply->abort();
+}
+
void YggdrasilTask::sslErrors(QList<QSslError> errors)
{
int i = 1;
diff --git a/logic/auth/YggdrasilTask.h b/logic/auth/YggdrasilTask.h
index 4a87067a..b24f909f 100644
--- a/logic/auth/YggdrasilTask.h
+++ b/logic/auth/YggdrasilTask.h
@@ -120,7 +120,7 @@ slots:
public
slots:
virtual void abort() override;
-
+ void abortByTimeout();
protected:
// FIXME: segfault disaster waiting to happen
MojangAccount *m_account = nullptr;
diff --git a/logic/lists/InstanceList.cpp b/logic/lists/InstanceList.cpp
index 9a61e2dd..34e6d87b 100644
--- a/logic/lists/InstanceList.cpp
+++ b/logic/lists/InstanceList.cpp
@@ -408,7 +408,7 @@ void InstanceList::loadFTBInstances(QMap<QString, QString> &groupMap,
QLOG_INFO() << "Loading existing " << record.name;
BaseInstance *instPtr = NULL;
auto error = InstanceFactory::get().loadInstance(instPtr, record.instanceDir);
- if (!instPtr || error != InstanceFactory::NoCreateError)
+ if (!instPtr || error != InstanceFactory::NoLoadError)
continue;
instPtr->setGroupInitial("FTB");
instPtr->setName(record.name);
diff --git a/logic/tasks/Task.cpp b/logic/tasks/Task.cpp
index cb7a5443..c980d6b3 100644
--- a/logic/tasks/Task.cpp
+++ b/logic/tasks/Task.cpp
@@ -22,12 +22,12 @@ Task::Task(QObject *parent) : ProgressProvider(parent)
QString Task::getStatus() const
{
- return m_status;
+ return m_statusString;
}
void Task::setStatus(const QString &new_status)
{
- m_status = new_status;
+ m_statusString = new_status;
emit status(new_status);
}
diff --git a/logic/tasks/Task.h b/logic/tasks/Task.h
index 80d5e38b..84775407 100644
--- a/logic/tasks/Task.h
+++ b/logic/tasks/Task.h
@@ -58,7 +58,7 @@ slots:
void setProgress(int progress);
protected:
- QString m_status;
+ QString m_statusString;
int m_progress = 0;
bool m_running = false;
bool m_succeeded = false;