Fix deprecation warnings.

Signed-off-by: allexzander <blackslayer4@gmail.com>
This commit is contained in:
allexzander 2022-08-04 19:17:34 +03:00 committed by Matthieu Gallien
parent 5175d186a4
commit ffb7fcad7d
7 changed files with 7 additions and 7 deletions

View File

@ -278,7 +278,7 @@ bool ConnectionValidator::setAndCheckServerVersion(const QString &version)
if (auto job = qobject_cast<AbstractNetworkJob *>(sender())) {
if (auto reply = job->reply()) {
_account->setHttp2Supported(
reply->attribute(QNetworkRequest::HTTP2WasUsedAttribute).toBool());
reply->attribute(QNetworkRequest::Http2WasUsedAttribute).toBool());
}
}
#endif

View File

@ -400,7 +400,7 @@ QRect FolderStatusDelegate::optionsButtonRect(QRect within, Qt::LayoutDirection
opt.rect.setSize(QSize(e,e));
QSize size = QApplication::style()->sizeFromContents(QStyle::CT_ToolButton, &opt, opt.rect.size()).expandedTo(QApplication::globalStrut());
int margin = QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing);
int margin = QApplication::style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
QRect r(QPoint(within.right() - size.width() - margin,
within.top() + within.height() / 2 - size.height() / 2),
size);

View File

@ -188,7 +188,7 @@ void AbstractNetworkJob::slotFinished()
const auto maxHttp2Resends = 3;
QByteArray verb = HttpLogger::requestVerb(*reply());
if (_reply->error() == QNetworkReply::ContentReSendError
&& _reply->attribute(QNetworkRequest::HTTP2WasUsedAttribute).toBool()) {
&& _reply->attribute(QNetworkRequest::Http2WasUsedAttribute).toBool()) {
if ((_requestBody && !_requestBody->isSequential()) || verb.isEmpty()) {
qCWarning(lcNetworkJob) << "Can't resend HTTP2 request, verb or body not suitable"

View File

@ -84,7 +84,7 @@ QNetworkReply *AccessManager::createRequest(QNetworkAccessManager::Operation op,
// http2 seems to cause issues, as with our recommended server setup we don't support http2, disable it by default for now
static const bool http2EnabledEnv = qEnvironmentVariableIntValue("OWNCLOUD_HTTP2_ENABLED") == 1;
newRequest.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, http2EnabledEnv);
newRequest.setAttribute(QNetworkRequest::Http2AllowedAttribute, http2EnabledEnv);
}
#endif

View File

@ -21,7 +21,7 @@ IconJob::IconJob(AccountPtr account, const QUrl &url, QObject *parent)
{
QNetworkRequest request(url);
#if (QT_VERSION >= 0x050600)
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, true);
#endif
const auto reply = account->sendRawRequest(QByteArrayLiteral("GET"), url, request);
connect(reply, &QNetworkReply::finished, this, &IconJob::finished);

View File

@ -865,7 +865,7 @@ void PropagateDownloadFile::slotGetFinished()
// of the compressed data. See QTBUG-73364.
const auto contentEncoding = job->reply()->rawHeader("content-encoding").toLower();
if ((contentEncoding == "gzip" || contentEncoding == "deflate")
&& (job->reply()->attribute(QNetworkRequest::HTTP2WasUsedAttribute).toBool()
&& (job->reply()->attribute(QNetworkRequest::Http2WasUsedAttribute).toBool()
|| job->reply()->attribute(QNetworkRequest::SpdyWasUsedAttribute).toBool())) {
bodySize = 0;
hasSizeHeader = false;

View File

@ -220,7 +220,7 @@ private slots:
if (op == QNetworkAccessManager::GetOperation && request.url().path().endsWith("A/resendme") && resendActual < resendExpected) {
auto errorReply = new FakeErrorReply(op, request, this, 400, "ignore this body");
errorReply->setError(QNetworkReply::ContentReSendError, serverMessage);
errorReply->setAttribute(QNetworkRequest::HTTP2WasUsedAttribute, true);
errorReply->setAttribute(QNetworkRequest::Http2WasUsedAttribute, true);
errorReply->setAttribute(QNetworkRequest::HttpStatusCodeAttribute, QVariant());
resendActual += 1;
return errorReply;