2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 17:47:42 +00:00

General: Make use of Qt 5's signal/slot connection syntax

Allows compile-time detection of incompatible signals/slots, as opposed
to runtime errors, making the connections more type-safe.
This commit is contained in:
Lioncash
2019-08-25 20:21:03 -04:00
parent a357648a99
commit 2ccc59fc0c
3 changed files with 40 additions and 40 deletions

View File

@@ -54,10 +54,10 @@ void DownloadManager::fetchIndex() {
QString track = QSettings().value("update_track").toString();
QString url = Domain + track + '/' + CurPlatformString + '/' + Index;
m_indexInProgress = m_netManager.get(QNetworkRequest(url));
connect(m_indexInProgress, SIGNAL(finished()), this, SLOT(indexFinished()));
connect(m_indexInProgress, SIGNAL(error(QNetworkReply::NetworkError)), this,
SLOT(indexError(QNetworkReply::NetworkError)));
connect(m_indexInProgress, SIGNAL(encrypted()), this, SLOT(indexValidateCert()));
connect(m_indexInProgress, &QNetworkReply::finished, this, &DownloadManager::indexFinished);
connect(m_indexInProgress, qOverload<QNetworkReply::NetworkError>(&QNetworkReply::error), this,
&DownloadManager::indexError);
connect(m_indexInProgress, &QNetworkReply::encrypted, this, &DownloadManager::indexValidateCert);
}
void DownloadManager::fetchBinary(const QString& str, const QString& outPath) {
@@ -67,15 +67,14 @@ void DownloadManager::fetchBinary(const QString& str, const QString& outPath) {
resetError();
m_outPath = outPath;
QString track = QSettings().value("update_track").toString();
QString url = Domain + track + '/' + CurPlatformString + '/' + str;
const QString track = QSettings().value("update_track").toString();
const QString url = Domain + track + '/' + CurPlatformString + '/' + str;
m_binaryInProgress = m_netManager.get(QNetworkRequest(url));
connect(m_binaryInProgress, SIGNAL(finished()), this, SLOT(binaryFinished()));
connect(m_binaryInProgress, SIGNAL(error(QNetworkReply::NetworkError)), this,
SLOT(binaryError(QNetworkReply::NetworkError)));
connect(m_binaryInProgress, SIGNAL(encrypted()), this, SLOT(binaryValidateCert()));
connect(m_binaryInProgress, SIGNAL(downloadProgress(qint64, qint64)), this,
SLOT(binaryDownloadProgress(qint64, qint64)));
connect(m_binaryInProgress, &QNetworkReply::finished, this, &DownloadManager::binaryFinished);
connect(m_binaryInProgress, qOverload<QNetworkReply::NetworkError>(&QNetworkReply::error), this,
&DownloadManager::binaryError);
connect(m_binaryInProgress, &QNetworkReply::encrypted, this, &DownloadManager::binaryValidateCert);
connect(m_binaryInProgress, &QNetworkReply::downloadProgress, this, &DownloadManager::binaryDownloadProgress);
if (m_progBar) {
m_progBar->setEnabled(true);