mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Qt5->Qt6: More renamed stuff.
part of CURA-8591
This commit is contained in:
parent
97da0b9183
commit
20b435af76
19 changed files with 42 additions and 42 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue