mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
Ref T489, support download progress in our readers
* signal for download progress per entity (DB reader) * ProgressSlot * changed signatures for ProgressSlot
This commit is contained in:
committed by
Mat Sutcliffe
parent
5c785643c7
commit
8c3faa4ca9
@@ -243,7 +243,7 @@ namespace BlackCore
|
||||
if (!url.isEmpty())
|
||||
{
|
||||
m1 = CStatusMessage(this, CStatusMessage::SeverityInfo, "Start reading bootstrap 1st URL: " + url.toQString());
|
||||
sApp->getFromNetwork(url.toNetworkRequest(), { this, &CSetupReader::parseBootstrapFile });
|
||||
sApp->getFromNetwork(url.toNetworkRequest(), { this, &CSetupReader::parseBootstrapFile }, { this, &CSetupReader::networkReplyProgress });
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -265,7 +265,7 @@ namespace BlackCore
|
||||
CLogMessage(this).info(u"Cancel second bootstrap read ('%1'), as there was a 1st read: '%2'") << url.toQString() << m_lastSuccessfulSetupUrl;
|
||||
return;
|
||||
}
|
||||
sApp->getFromNetwork(url.toNetworkRequest(), { this, &CSetupReader::parseBootstrapFile });
|
||||
sApp->getFromNetwork(url.toNetworkRequest(), { this, &CSetupReader::parseBootstrapFile }, { this, &CSetupReader::networkReplyProgress });
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -297,7 +297,7 @@ namespace BlackCore
|
||||
if (!sApp || m_shutdown) { return; }
|
||||
CUrl url = randomUrls.front();
|
||||
const CStatusMessage m1(this, CStatusMessage::SeverityInfo, "Start reading update info 1st URL: " + url.toQString());
|
||||
sApp->getFromNetwork(url.toNetworkRequest(), { this, &CSetupReader::parseUpdateInfoFile });
|
||||
sApp->getFromNetwork(url.toNetworkRequest(), { this, &CSetupReader::parseUpdateInfoFile }, { this, &CSetupReader::networkReplyProgress });
|
||||
|
||||
url = randomUrls.back();
|
||||
const CStatusMessage m2(this, CStatusMessage::SeverityInfo, "Will also trigger deferred update info reading 2nd URL: " + url.toQString());
|
||||
@@ -311,7 +311,7 @@ namespace BlackCore
|
||||
CLogMessage(this).info(u"Cancel second update info read ('%1'), as there was a 1st read '%2'") << url.toQString() << m_lastSuccessfulUpdateInfoUrl;
|
||||
return;
|
||||
}
|
||||
sApp->getFromNetwork(url.toNetworkRequest(), { this, &CSetupReader::parseUpdateInfoFile });
|
||||
sApp->getFromNetwork(url.toNetworkRequest(), { this, &CSetupReader::parseUpdateInfoFile }, { this, &CSetupReader::networkReplyProgress });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -651,6 +651,14 @@ namespace BlackCore
|
||||
m_setupReadErrorMsgs = messages.getErrorMessages();
|
||||
}
|
||||
|
||||
void CSetupReader::networkReplyProgress(int logId, qint64 current, qint64 max, const QUrl &url)
|
||||
{
|
||||
Q_UNUSED(url);
|
||||
Q_UNUSED(logId);
|
||||
Q_UNUSED(current);
|
||||
Q_UNUSED(max);
|
||||
}
|
||||
|
||||
CStatusMessageList CSetupReader::manageSetupAvailability(bool webRead, bool localRead)
|
||||
{
|
||||
Q_ASSERT_X(!(webRead && localRead), Q_FUNC_INFO, "Local and web read together seems to be wrong");
|
||||
|
||||
Reference in New Issue
Block a user