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