this commit is too big

This commit is contained in:
fourtf
2018-08-02 14:23:27 +02:00
parent 3b3c5d8d75
commit c2e2dfb577
186 changed files with 3626 additions and 2656 deletions
+5 -5
View File
@@ -129,7 +129,7 @@ void NetworkRequest::execute()
}
}
bool NetworkRequest::tryLoadCachedFile()
Outcome NetworkRequest::tryLoadCachedFile()
{
auto app = getApp();
@@ -137,24 +137,24 @@ bool NetworkRequest::tryLoadCachedFile()
if (!cachedFile.exists()) {
// File didn't exist
return false;
return Failure;
}
if (!cachedFile.open(QIODevice::ReadOnly)) {
// File could not be opened
return false;
return Failure;
}
QByteArray bytes = cachedFile.readAll();
NetworkResult result(bytes);
bool success = this->data->onSuccess_(result);
auto outcome = this->data->onSuccess_(result);
cachedFile.close();
// XXX: If success is false, we should invalidate the cache file somehow/somewhere
return success;
return outcome;
}
void NetworkRequest::doRequest()