Asset syncing

This commit is contained in:
Emil Axelsson
2017-11-15 13:12:10 +01:00
parent 6b182bdfad
commit 27823e9af6
10 changed files with 227 additions and 100 deletions

View File

@@ -116,6 +116,11 @@ std::string HttpSynchronization::directory() {
}
void HttpSynchronization::start() {
if (isSyncing()) {
return;
}
begin();
if (hasSyncFile()) {
resolve();
return;
@@ -130,15 +135,19 @@ void HttpSynchronization::start() {
return;
}
}
reject();
if (!_shouldCancel) {
reject();
}
});
}
void HttpSynchronization::cancel() {
_shouldCancel = true;
reset();
}
void HttpSynchronization::clear() {
cancel();
// TODO: Remove all files from directory.
}