Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into skin_selector
This commit is contained in:
@@ -84,6 +84,9 @@ auto HttpMetaCache::getEntry(QString base, QString resource_path) -> MetaEntryPt
|
||||
|
||||
auto HttpMetaCache::resolveEntry(QString base, QString resource_path, QString expected_etag) -> MetaEntryPtr
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
resource_path = FS::RemoveInvalidPathChars(resource_path);
|
||||
#endif
|
||||
auto entry = getEntry(base, resource_path);
|
||||
// it's not present? generate a default stale entry
|
||||
if (!entry) {
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
*/
|
||||
|
||||
#include "NetJob.h"
|
||||
#include "tasks/ConcurrentTask.h"
|
||||
#if defined(LAUNCHER_APPLICATION)
|
||||
#include "Application.h"
|
||||
#endif
|
||||
@@ -60,18 +61,15 @@ auto NetJob::addNetAction(NetAction::Ptr action) -> bool
|
||||
return true;
|
||||
}
|
||||
|
||||
void NetJob::startNext()
|
||||
void NetJob::executeNextSubTask()
|
||||
{
|
||||
if (m_queue.isEmpty() && m_doing.isEmpty()) {
|
||||
// We're finished, check for failures and retry if we can (up to 3 times)
|
||||
if (!m_failed.isEmpty() && m_try < 3) {
|
||||
m_try += 1;
|
||||
while (!m_failed.isEmpty())
|
||||
m_queue.enqueue(m_failed.take(*m_failed.keyBegin()));
|
||||
}
|
||||
// We're finished, check for failures and retry if we can (up to 3 times)
|
||||
if (isRunning() && m_queue.isEmpty() && m_doing.isEmpty() && !m_failed.isEmpty() && m_try < 3) {
|
||||
m_try += 1;
|
||||
while (!m_failed.isEmpty())
|
||||
m_queue.enqueue(m_failed.take(*m_failed.keyBegin()));
|
||||
}
|
||||
|
||||
ConcurrentTask::startNext();
|
||||
ConcurrentTask::executeNextSubTask();
|
||||
}
|
||||
|
||||
auto NetJob::size() const -> int
|
||||
|
||||
@@ -55,8 +55,6 @@ class NetJob : public ConcurrentTask {
|
||||
explicit NetJob(QString job_name, shared_qobject_ptr<QNetworkAccessManager> network, int max_concurrent = -1);
|
||||
~NetJob() override = default;
|
||||
|
||||
void startNext() override;
|
||||
|
||||
auto size() const -> int;
|
||||
|
||||
auto canAbort() const -> bool override;
|
||||
@@ -69,6 +67,9 @@ class NetJob : public ConcurrentTask {
|
||||
// Qt can't handle auto at the start for some reason?
|
||||
bool abort() override;
|
||||
|
||||
protected slots:
|
||||
void executeNextSubTask() override;
|
||||
|
||||
protected:
|
||||
void updateState() override;
|
||||
|
||||
|
||||
@@ -69,7 +69,8 @@ void NetRequest::executeTask()
|
||||
|
||||
if (getState() == Task::State::AbortedByUser) {
|
||||
qCWarning(logCat) << getUid().toString() << "Attempt to start an aborted Request:" << m_url.toString();
|
||||
emitAborted();
|
||||
emit aborted();
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -86,10 +87,12 @@ void NetRequest::executeTask()
|
||||
break;
|
||||
case State::Inactive:
|
||||
case State::Failed:
|
||||
emitFailed();
|
||||
emit failed("Failed to initilize sink");
|
||||
emit finished();
|
||||
return;
|
||||
case State::AbortedByUser:
|
||||
emitAborted();
|
||||
emit aborted();
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user