mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
Qt: connect compat error handling to error signal
This commit is contained in:
parent
59747fd708
commit
200162cf2a
1 changed files with 30 additions and 12 deletions
|
@ -164,9 +164,22 @@ void game_compatibility::RequestCompatibility(bool online)
|
||||||
m_progress_dialog->setValue(bytesReceived);
|
m_progress_dialog->setValue(bytesReceived);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Handle response according to its contents
|
// Handle network error
|
||||||
connect(network_reply, &QNetworkReply::finished, [=]()
|
connect(network_reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error), [=](QNetworkReply::NetworkError error)
|
||||||
{
|
{
|
||||||
|
if (error == QNetworkReply::NoError)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error != QNetworkReply::OperationCanceledError)
|
||||||
|
{
|
||||||
|
// We failed to retrieve a new database, therefore refresh gamelist to old state
|
||||||
|
const QString error = network_reply->errorString();
|
||||||
|
Q_EMIT DownloadError(error);
|
||||||
|
LOG_ERROR(GENERAL, "Compatibility error: { Network Error - %s }", sstr(error));
|
||||||
|
}
|
||||||
|
|
||||||
// Clean up Progress Dialog
|
// Clean up Progress Dialog
|
||||||
if (m_progress_dialog)
|
if (m_progress_dialog)
|
||||||
{
|
{
|
||||||
|
@ -177,20 +190,25 @@ void game_compatibility::RequestCompatibility(bool online)
|
||||||
m_progress_timer->stop();
|
m_progress_timer->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle Errors
|
|
||||||
if (network_reply->error() == QNetworkReply::OperationCanceledError)
|
|
||||||
{
|
|
||||||
network_reply->deleteLater();
|
network_reply->deleteLater();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle response according to its contents
|
||||||
|
connect(network_reply, &QNetworkReply::finished, [=]()
|
||||||
|
{
|
||||||
|
if (network_reply->error() != QNetworkReply::NoError)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (network_reply->error() != QNetworkReply::NoError)
|
|
||||||
|
// Clean up Progress Dialog
|
||||||
|
if (m_progress_dialog)
|
||||||
{
|
{
|
||||||
// We failed to retrieve a new database, therefore refresh gamelist to old state
|
m_progress_dialog->close();
|
||||||
QString error = network_reply->errorString();
|
}
|
||||||
network_reply->deleteLater();
|
if (m_progress_timer)
|
||||||
Q_EMIT DownloadError(error);
|
{
|
||||||
LOG_ERROR(GENERAL, "Compatibility error: { Network Error - %s }", sstr(error));
|
m_progress_timer->stop();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_NOTICE(GENERAL, "Compatibility notice: { Database download finished }");
|
LOG_NOTICE(GENERAL, "Compatibility notice: { Database download finished }");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue