commit 62a8412a51de2c123f0773b17fff2e09638b5fb7
parent c1e12f4f81fc20f8a98c30f2f0c670bd616be0b0
Author: cfillion <cfillion@users.noreply.github.com>
Date: Sun, 26 Feb 2017 21:09:58 -0500
refactoring - use constants in ThreadTask instead of Download
Diffstat:
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/import.cpp b/src/import.cpp
@@ -96,8 +96,8 @@ void Import::fetch()
Download *dl = m_download = new Download({}, url, m_reapack->config()->network);
dl->onFinish([=] {
- const Download::State state = dl->state();
- if(state == Download::Aborted) {
+ const ThreadTask::State state = dl->state();
+ if(state == ThreadTask::Aborted) {
// at this point `this` is deleted, so there is nothing else
// we can do without crashing
return;
@@ -105,7 +105,7 @@ void Import::fetch()
setWaiting(false);
- if(state != Download::Success) {
+ if(state != ThreadTask::Success) {
const string msg = "Download failed: " + dl->errorString();
MessageBox(handle(), make_autostring(msg).c_str(), TITLE, MB_OK);
SetFocus(m_url);
@@ -117,7 +117,7 @@ void Import::fetch()
dl->setCleanupHandler([=] {
// if we are still alive
- if(dl->state() != Download::Aborted)
+ if(dl->state() != ThreadTask::Aborted)
m_download = nullptr;
delete dl;
diff --git a/src/reapack.cpp b/src/reapack.cpp
@@ -346,11 +346,11 @@ void ReaPack::doFetchIndex(const Remote &remote, ThreadPool *pool,
const Path &path = Index::pathFor(remote.name());
switch(dl->state()) {
- case Download::Success:
+ case ThreadTask::Success:
if(!FS::write(path, dl->contents()))
warn(FS::lastError(), AUTO_STR("Write Failed"));
break;
- case Download::Failure:
+ case ThreadTask::Failure:
if(stale || !FS::exists(path))
warn(dl->contents(), AUTO_STR("Download Failed"));
break;