Set request for ErrorNetworkReply.
This commit is contained in:
parent
e8ded0a32a
commit
800fa381b1
@ -129,7 +129,7 @@ class NetworkManager(QNetworkAccessManager):
|
|||||||
scheme = req.url().scheme()
|
scheme = req.url().scheme()
|
||||||
if scheme == 'https' and not SSL_AVAILABLE:
|
if scheme == 'https' and not SSL_AVAILABLE:
|
||||||
return ErrorNetworkReply(
|
return ErrorNetworkReply(
|
||||||
"SSL is not supported by the installed Qt library!",
|
req, "SSL is not supported by the installed Qt library!",
|
||||||
QNetworkReply.ProtocolUnknownError)
|
QNetworkReply.ProtocolUnknownError)
|
||||||
elif scheme in self._scheme_handlers:
|
elif scheme in self._scheme_handlers:
|
||||||
return self._scheme_handlers[scheme].createRequest(
|
return self._scheme_handlers[scheme].createRequest(
|
||||||
|
@ -118,15 +118,17 @@ class ErrorNetworkReply(QNetworkReply):
|
|||||||
|
|
||||||
"""QNetworkReply which always returns an error."""
|
"""QNetworkReply which always returns an error."""
|
||||||
|
|
||||||
def __init__(self, errorstring, error, parent=None):
|
def __init__(self, req, errorstring, error, parent=None):
|
||||||
"""Constructor.
|
"""Constructor.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
req: The QNetworkRequest associated with this reply.
|
||||||
errorstring: The error string to print.
|
errorstring: The error string to print.
|
||||||
error: The numerical error value.
|
error: The numerical error value.
|
||||||
parent: The parent to pass to QNetworkReply.
|
parent: The parent to pass to QNetworkReply.
|
||||||
"""
|
"""
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
self.setRequest(req)
|
||||||
self.setError(error, errorstring)
|
self.setError(error, errorstring)
|
||||||
# For some reason, a segfault will be triggered if these lambdas aren't
|
# For some reason, a segfault will be triggered if these lambdas aren't
|
||||||
# there.
|
# there.
|
||||||
|
Loading…
Reference in New Issue
Block a user