Rename signal in QNetworkFile
Address the "Overloaded signals should be avoided" warning: there is already a method named "error" in QFileDevice, rename the signal "error" to "networkError". Found by an Axivion scan. Pick-to: 6.7 6.5 Task-number: QTBUG-125026 Change-Id: I2f1b5752238aca614af82a94e2918399c582f74d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 7f0450a47f2cab8c0482131475eba7162f4bdf8f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
5cd80af50f
commit
873bacc549
@ -30,7 +30,7 @@ void QNetworkFile::open()
|
||||
if (fi.isDir()) {
|
||||
QString msg = QCoreApplication::translate("QNetworkAccessFileBackend",
|
||||
"Cannot open %1: Path is a directory").arg(fileName());
|
||||
emit error(QNetworkReply::ContentOperationNotPermittedError, msg);
|
||||
emit networkError(QNetworkReply::ContentOperationNotPermittedError, msg);
|
||||
} else {
|
||||
emit headerRead(QHttpHeaders::WellKnownHeader::LastModified,
|
||||
QNetworkHeadersPrivate::toHttpDate(fi.lastModified()));
|
||||
@ -41,9 +41,9 @@ void QNetworkFile::open()
|
||||
QString msg = QCoreApplication::translate("QNetworkAccessFileBackend",
|
||||
"Error opening %1: %2").arg(fileName(), errorString());
|
||||
if (exists())
|
||||
emit error(QNetworkReply::ContentAccessDenied, msg);
|
||||
emit networkError(QNetworkReply::ContentAccessDenied, msg);
|
||||
else
|
||||
emit error(QNetworkReply::ContentNotFoundError, msg);
|
||||
emit networkError(QNetworkReply::ContentNotFoundError, msg);
|
||||
}
|
||||
}
|
||||
emit finished(opened);
|
||||
|
@ -36,7 +36,7 @@ public Q_SLOTS:
|
||||
Q_SIGNALS:
|
||||
void finished(bool ok);
|
||||
void headerRead(QHttpHeaders::WellKnownHeader, const QByteArray &value);
|
||||
void error(QNetworkReply::NetworkError error, const QString &message);
|
||||
void networkError(QNetworkReply::NetworkError error, const QString &message);
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -87,7 +87,7 @@ QNetworkReplyFileImpl::QNetworkReplyFileImpl(QNetworkAccessManager *manager, con
|
||||
auto realFile = new QNetworkFile(fileName);
|
||||
connect(realFile, &QNetworkFile::headerRead, this, &QNetworkReplyFileImpl::setWellKnownHeader,
|
||||
Qt::QueuedConnection);
|
||||
connect(realFile, &QNetworkFile::error, this, &QNetworkReplyFileImpl::setError,
|
||||
connect(realFile, &QNetworkFile::networkError, this, &QNetworkReplyFileImpl::setError,
|
||||
Qt::QueuedConnection);
|
||||
connect(realFile, SIGNAL(finished(bool)), SLOT(fileOpenFinished(bool)),
|
||||
Qt::QueuedConnection);
|
||||
|
Loading…
x
Reference in New Issue
Block a user