eric6/WebBrowser/Network/QtHelpSchemeHandler.py

changeset 8227
349308e84eeb
parent 8218
7c09585bd960
child 8260
2161475d9639
diff -r 6dc5b1db7bdc -r 349308e84eeb eric6/WebBrowser/Network/QtHelpSchemeHandler.py
--- a/eric6/WebBrowser/Network/QtHelpSchemeHandler.py	Mon Apr 12 18:25:52 2021 +0200
+++ b/eric6/WebBrowser/Network/QtHelpSchemeHandler.py	Mon Apr 12 19:05:23 2021 +0200
@@ -136,13 +136,15 @@
         # One possible problem might be that the css is loaded at the same
         # level as the html, thus a path inside the css like
         # (../images/foo.png) might cd out of the virtual folder
-        if not self.__engine.findFile(url).isValid():
-            if strUrl.startswith(QtDocPath):
-                newUrl = self.__job.requestUrl()
-                if not newUrl.path().startswith("/qdoc/"):
-                    newUrl.setPath("/qdoc" + newUrl.path())
-                    url = newUrl
-                    strUrl = url.toString()
+        if (
+            not self.__engine.findFile(url).isValid() and
+            strUrl.startswith(QtDocPath)
+        ):
+            newUrl = self.__job.requestUrl()
+            if not newUrl.path().startswith("/qdoc/"):
+                newUrl.setPath("/qdoc" + newUrl.path())
+                url = newUrl
+                strUrl = url.toString()
         
         self.__mimeType = mimetypes.guess_type(strUrl)[0]
         if self.__mimeType is None:

eric ide

mercurial