This commit is contained in:
ChrisTerBeke 2019-07-30 22:21:36 +02:00
parent 72ac8b5f4c
commit d280252437
No known key found for this signature in database
GPG key ID: A49F1AB9D7E0C263
7 changed files with 81 additions and 91 deletions

View file

@ -169,14 +169,16 @@ class CloudApiClient:
Callable[[List[CloudApiClientModel]], Any]],
model: Type[CloudApiClientModel],
) -> None:
def parse() -> None:
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:
return
status_code, response = self._parseReply(reply)
self._anti_gc_callbacks.remove(parse)
self._parseModels(response, on_finished, model)
return
self._anti_gc_callbacks.append(parse)
reply.finished.connect(parse)