Remove getPaths() usage from NetworkTask

This commit is contained in:
Rasmus Karlsson 2024-01-15 23:13:05 +01:00
parent 199b22d013
commit 6ad5c63fca

View file

@ -1,5 +1,6 @@
#include "common/network/NetworkTask.hpp" #include "common/network/NetworkTask.hpp"
#include "Application.hpp"
#include "common/network/NetworkManager.hpp" #include "common/network/NetworkManager.hpp"
#include "common/network/NetworkPrivate.hpp" #include "common/network/NetworkPrivate.hpp"
#include "common/network/NetworkResult.hpp" #include "common/network/NetworkResult.hpp"
@ -117,7 +118,8 @@ void NetworkTask::logReply()
void NetworkTask::writeToCache(const QByteArray &bytes) const void NetworkTask::writeToCache(const QByteArray &bytes) const
{ {
std::ignore = QtConcurrent::run([data = this->data_, bytes] { std::ignore = QtConcurrent::run([data = this->data_, bytes] {
QFile cachedFile(getPaths()->cacheDirectory() + "/" + data->getHash()); QFile cachedFile(getIApp()->getPaths().cacheDirectory() + "/" +
data->getHash());
if (cachedFile.open(QIODevice::WriteOnly)) if (cachedFile.open(QIODevice::WriteOnly))
{ {