Qt5->Qt6: More renamed stuff.

part of CURA-8591
This commit is contained in:
Remco Burema 2021-12-29 11:18:49 +01:00
parent 97da0b9183
commit 20b435af76
No known key found for this signature in database
GPG key ID: 215C49431D43F98C
19 changed files with 42 additions and 42 deletions

View file

@ -118,9 +118,9 @@ class ClusterApiClient:
"""
url = QUrl("http://" + self._address + path)
request = QNetworkRequest(url)
request.setAttribute(QNetworkRequest.FollowRedirectsAttribute, True)
request.setAttribute(QNetworkRequest.Attribute.RedirectPolicyAttribute, QNetworkRequest.RedirectPolicy.ManualRedirectPolicy)
if content_type:
request.setHeader(QNetworkRequest.ContentTypeHeader, content_type)
request.setHeader(QNetworkRequest.KnownHeaders.ContentTypeHeader, content_type)
return request
@staticmethod
@ -130,7 +130,7 @@ class ClusterApiClient:
:param reply: The reply from the server.
:return: A tuple with a status code and a dictionary.
"""
status_code = reply.attribute(QNetworkRequest.HttpStatusCodeAttribute)
status_code = reply.attribute(QNetworkRequest.Attribute.HttpStatusCodeAttribute)
try:
response = bytes(reply.readAll()).decode()
return status_code, json.loads(response)
@ -173,7 +173,7 @@ class ClusterApiClient:
self._anti_gc_callbacks.remove(parse)
# Don't try to parse the reply if we didn't get one
if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) is None:
if reply.attribute(QNetworkRequest.Attribute.HttpStatusCodeAttribute) is None:
return
if reply.error() > 0:

View file

@ -152,7 +152,7 @@ class SendMaterialJob(Job):
def _sendingFinished(self, reply: QNetworkReply) -> None:
"""Check a reply from an upload to the printer and log an error when the call failed"""
if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) != 200:
if reply.attribute(QNetworkRequest.Attribute.HttpStatusCodeAttribute) != 200:
Logger.log("w", "Error while syncing material: %s", reply.errorString())
return
body = reply.readAll().data().decode('utf8')