362 if self.__networkAccessManager is None or not self._imageUrl: |
362 if self.__networkAccessManager is None or not self._imageUrl: |
363 return |
363 return |
364 |
364 |
365 reply = self.__networkAccessManager.get( |
365 reply = self.__networkAccessManager.get( |
366 QNetworkRequest(QUrl.fromEncoded(self._imageUrl.encode("utf-8")))) |
366 QNetworkRequest(QUrl.fromEncoded(self._imageUrl.encode("utf-8")))) |
367 reply.finished.connect(self.__imageObtained) |
367 reply.finished.connect(lambda: self.__imageObtained(reply)) |
368 self.__replies.append(reply) |
368 self.__replies.append(reply) |
369 |
369 |
370 def __imageObtained(self): |
370 def __imageObtained(self, reply): |
371 """ |
371 """ |
372 Private slot to receive the image of the engine. |
372 Private slot to receive the image of the engine. |
373 """ |
373 |
374 reply = self.sender() |
374 @param reply reference to the network reply |
375 if reply is None: |
375 @type QNetworkReply |
376 return |
376 """ |
377 |
|
378 response = reply.readAll() |
377 response = reply.readAll() |
379 |
378 |
380 reply.close() |
379 reply.close() |
381 if reply in self.__replies: |
380 if reply in self.__replies: |
382 self.__replies.remove(reply) |
381 self.__replies.remove(reply) |