Helpviewer/Network/QtHelpAccessHandler.py

changeset 3002
6ffc581f00f1
parent 2954
bf0215fe12d1
child 3022
57179e4cdadd
child 3057
10516539f238
equal deleted inserted replaced
3001:3674ff5fa8f8 3002:6ffc581f00f1
82 82
83 def createRequest(self, op, request, outgoingData=None): 83 def createRequest(self, op, request, outgoingData=None):
84 """ 84 """
85 Protected method to create a request. 85 Protected method to create a request.
86 86
87 @param op the operation to be performed (QNetworkAccessManager.Operation) 87 @param op the operation to be performed
88 (QNetworkAccessManager.Operation)
88 @param request reference to the request object (QNetworkRequest) 89 @param request reference to the request object (QNetworkRequest)
89 @param outgoingData reference to an IODevice containing data to be sent 90 @param outgoingData reference to an IODevice containing data to be sent
90 (QIODevice) 91 (QIODevice)
91 @return reference to the created reply object (QNetworkReply) 92 @return reference to the created reply object (QNetworkReply)
92 """ 93 """
93 url = request.url() 94 url = request.url()
94 strUrl = url.toString() 95 strUrl = url.toString()
95 96
96 # For some reason the url to load is already wrong (passed from webkit) 97 # For some reason the url to load is already wrong (passed from webkit)
97 # though the css file and the references inside should work that way. One 98 # though the css file and the references inside should work that way.
98 # possible problem might be that the css is loaded at the same level as the 99 # One possible problem might be that the css is loaded at the same
99 # html, thus a path inside the css like (../images/foo.png) might cd out of 100 # level as the html, thus a path inside the css like
100 # the virtual folder 101 # (../images/foo.png) might cd out of the virtual folder
101 if not self.__engine.findFile(url).isValid(): 102 if not self.__engine.findFile(url).isValid():
102 if strUrl.startswith(QtDocPath): 103 if strUrl.startswith(QtDocPath):
103 newUrl = request.url() 104 newUrl = request.url()
104 if not newUrl.path().startswith("/qdoc/"): 105 if not newUrl.path().startswith("/qdoc/"):
105 newUrl.setPath("qdoc" + newUrl.path()) 106 newUrl.setPath("qdoc" + newUrl.path())

eric ide

mercurial