Fix for detection of Qt documentation files (*.qch). The Qt installer is missing a symbolic link.

Fri, 25 Dec 2015 17:04:54 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 25 Dec 2015 17:04:54 +0100
changeset 4622
8800cbcbb496
parent 4621
b46304716d28
child 4624
aebdbffe02b6

Fix for detection of Qt documentation files (*.qch). The Qt installer is missing a symbolic link.

Helpviewer/HelpDocsInstaller.py file | annotate | diff | comparison | revisions
diff -r b46304716d28 -r 8800cbcbb496 Helpviewer/HelpDocsInstaller.py
--- a/Helpviewer/HelpDocsInstaller.py	Fri Dec 25 16:14:27 2015 +0100
+++ b/Helpviewer/HelpDocsInstaller.py	Fri Dec 25 17:04:54 2015 +0100
@@ -10,8 +10,10 @@
 
 from __future__ import unicode_literals
 
-from PyQt5.QtCore import pyqtSignal, QThread, Qt, QMutex, QDateTime, QDir, \
-    QLibraryInfo, QFileInfo
+import os
+
+from PyQt5.QtCore import pyqtSignal, qVersion, QThread, Qt, QMutex, \
+    QDateTime, QDir, QLibraryInfo, QFileInfo
 from PyQt5.QtHelp import QHelpEngineCore
 
 from eric6config import getConfig
@@ -69,18 +71,20 @@
         
         qt4Docs = ["designer", "linguist", "qt"]
         qt5Docs = [
-            "activeqt", "qtandroidextras", "qtbluetooth", "qtconcurrent",
-            "qtcore", "qtdbus", "qtdesigner", "qtdoc", "qtenginio",
-            "qtenginiooverview", "qtenginoqml", "qtgraphicaleffects", "qtgui",
-            "qthelp", "qtimageformats", "qtlinguist", "qtlocation",
-            "qtmaxextras", "qtmultimedia", "qtmultimediawidgets", "qtnetwork",
-            "qtnfc", "qtopengl", "qtpositioning", "qtprintsupport", "qtqml",
-            "qtquick", "qtquickcontrols", "qtquickdialogs", "qtquicklayouts",
-            "qtscript", "qtscripttools", "qtsensors", "qtserialport", "qtsql",
-            "qtsvg", "qttestlib", "qtuitools", "qtwebchannel", "qtwebengine",
-            "qtwebenginewidgets", "qtwebkit", "qtwebkitexamples",
-            "qtwebsockets", "qtwidgets", "qtwinextras", "qtx11extras", "qtxml",
-            "qtxmlpatterns"]
+            "activeqt", "qdoc", "qmake", "qt3d", "qt3drenderer",
+            "qtandroidextras", "qtassistant", "qtbluetooth", "qtcanvas3d",
+            "qtconcurrent", "qtcore", "qtdbus", "qtdesigner", "qtdoc",
+            "qtenginio", "qtenginiooverview", "qtenginoqml",
+            "qtgraphicaleffects", "qtgui", "qthelp", "qtimageformats",
+            "qtlinguist", "qtlocation", "qtmaxextras", "qtmultimedia",
+            "qtmultimediawidgets", "qtnetwork", "qtnfc", "qtopengl",
+            "qtplatformheaders", "qtpositioning", "qtprintsupport", "qtqml",
+            "qtquick", "qtquickcontrols", "qtquickdialogs", "qtquickextras",
+            "qtquicklayouts", "qtscript", "qtscripttools", "qtsensors",
+            "qtserialport", "qtsql", "qtsvg", "qttestlib", "qtuitools",
+            "qtwebchannel", "qtwebengine", "qtwebenginewidgets", "qtwebkit",
+            "qtwebkitexamples", "qtwebsockets", "qtwidgets", "qtwinextras",
+            "qtx11extras", "qtxml", "qtxmlpatterns"]
         for qtDocs, version in [(qt4Docs, 4), (qt5Docs, 5)]:
             for doc in qtDocs:
                 changes |= self.__installQtDoc(doc, version, engine)
@@ -122,8 +126,14 @@
                 QLibraryInfo.location(QLibraryInfo.DocumentationPath) +
                 QDir.separator() + "qch")
         elif version == 5:
-            docsPath = QDir(
-                QLibraryInfo.location(QLibraryInfo.DocumentationPath))
+            docsPath = QLibraryInfo.location(QLibraryInfo.DocumentationPath)
+            if not os.path.isdir(docsPath):
+                # Qt installer is a bit buggy; it's missing a symbolic link
+                docsPathList = QDir.fromNativeSeparators(docsPath).split("/")
+                docsPath = os.sep.join(
+                    docsPathList[:-3] +
+                    ["Docs", "Qt-{0}".format(qVersion()[:3])])
+            docsPath = QDir(docsPath)
         else:
             # unsupported Qt version
             return False

eric ide

mercurial