forked from lix-project/lix
Cleanup
This commit is contained in:
parent
6270b2e50f
commit
30370f168f
|
@ -21,8 +21,8 @@ struct DownloadRequest
|
||||||
std::shared_ptr<std::string> data;
|
std::shared_ptr<std::string> data;
|
||||||
std::string mimeType;
|
std::string mimeType;
|
||||||
|
|
||||||
DownloadRequest(const std::string & uri, std::shared_ptr<std::string> data = nullptr, std::string mimeType = "")
|
DownloadRequest(const std::string & uri)
|
||||||
: uri(uri), parentAct(curActivity), data(std::move(data)), mimeType(std::move(mimeType)) { }
|
: uri(uri), parentAct(curActivity) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DownloadResult
|
struct DownloadResult
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
try {
|
try {
|
||||||
BinaryCacheStore::init();
|
BinaryCacheStore::init();
|
||||||
} catch (UploadToHTTP &) {
|
} catch (UploadToHTTP &) {
|
||||||
throw Error(format("'%s' does not appear to be a binary cache") % cacheUri);
|
throw Error("'%s' does not appear to be a binary cache", cacheUri);
|
||||||
}
|
}
|
||||||
diskCache->createCache(cacheUri, storeDir, wantMassQuery_, priority);
|
diskCache->createCache(cacheUri, storeDir, wantMassQuery_, priority);
|
||||||
}
|
}
|
||||||
|
@ -67,8 +67,9 @@ protected:
|
||||||
const std::string & data,
|
const std::string & data,
|
||||||
const std::string & mimeType) override
|
const std::string & mimeType) override
|
||||||
{
|
{
|
||||||
auto data_ = std::make_shared<string>(data);
|
auto req = DownloadRequest(cacheUri + "/" + path);
|
||||||
auto req = DownloadRequest(cacheUri + "/" + path, data_, mimeType);
|
req.data = std::make_shared<string>(data); // FIXME: inefficient
|
||||||
|
req.mimeType = mimeType;
|
||||||
try {
|
try {
|
||||||
getDownloader()->download(req);
|
getDownloader()->download(req);
|
||||||
} catch (DownloadError & e) {
|
} catch (DownloadError & e) {
|
||||||
|
|
Loading…
Reference in a new issue