Added code to remove non-existing help files from the help collection.

Sun, 28 Jul 2013 14:20:37 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 28 Jul 2013 14:20:37 +0200
changeset 2831
05fcdce02b94
parent 2829
528d6b04e0be
child 2832
2997bc65a48b

Added code to remove non-existing help files from the help collection.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Helpviewer/HelpWindow.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Helpviewer/HelpWindow.py	Sun Jul 28 13:43:11 2013 +0200
+++ b/Helpviewer/HelpWindow.py	Sun Jul 28 14:20:37 2013 +0200
@@ -130,6 +130,7 @@
                 self.__helpEngine = \
                     QHelpEngine(os.path.join(Utilities.getConfigDir(),
                                              "browser", "eric5help.qhc"), self)
+                self.__removeOldDocumentation()
                 self.__helpEngine.warning.connect(self.__warning)
             else:
                 self.__helpEngine = None
@@ -2630,6 +2631,15 @@
                 self.__searchWord = word
                 self.__searchForWord()
         
+    def __removeOldDocumentation(self):
+        """
+        Private slot to remove non-existing documentation from the help engine.
+        """
+        for namespace in self.__helpEngine.registeredDocumentations():
+            docFile = self.__helpEngine.documentationFileName(namespace)
+            if not os.path.exists(docFile):
+                self.__helpEngine.unregisterDocumentation(namespace)
+        
     def __lookForNewDocumentation(self):
         """
         Private slot to look for new documentation to be loaded into the

eric ide

mercurial