Set parent of QNetworkReplies in NetworkManager.

Closes #258.
This commit is contained in:
Florian Bruhin 2014-11-30 22:38:12 +01:00
parent 64e43c6e14
commit fea35156bc

View File

@ -160,7 +160,7 @@ class NetworkManager(QNetworkAccessManager):
if scheme == 'https' and not SSL_AVAILABLE: if scheme == 'https' and not SSL_AVAILABLE:
return networkreply.ErrorNetworkReply( return networkreply.ErrorNetworkReply(
req, "SSL is not supported by the installed Qt library!", req, "SSL is not supported by the installed Qt library!",
QNetworkReply.ProtocolUnknownError) QNetworkReply.ProtocolUnknownError, self)
elif scheme in self._scheme_handlers: elif scheme in self._scheme_handlers:
return self._scheme_handlers[scheme].createRequest( return self._scheme_handlers[scheme].createRequest(
op, req, outgoing_data) op, req, outgoing_data)
@ -170,7 +170,7 @@ class NetworkManager(QNetworkAccessManager):
req.url().host())) req.url().host()))
return networkreply.ErrorNetworkReply( return networkreply.ErrorNetworkReply(
req, "Request was blocked by host blocker.", req, "Request was blocked by host blocker.",
QNetworkReply.ContentAccessDenied) QNetworkReply.ContentAccessDenied, self)
if config.get('network', 'do-not-track'): if config.get('network', 'do-not-track'):
dnt = '1'.encode('ascii') dnt = '1'.encode('ascii')
else: else: