66 engine = QHelpEngineCore(self.__collection) |
66 engine = QHelpEngineCore(self.__collection) |
67 engine.setupData() |
67 engine.setupData() |
68 changes = False |
68 changes = False |
69 |
69 |
70 qt4Docs = ["designer", "linguist", "qt"] |
70 qt4Docs = ["designer", "linguist", "qt"] |
71 qt5Docs = ["activeqt", "qtconcurrent", "qtcore", "qtdbus", "qtdesigner", "qtdoc", |
71 qt5Docs = [ |
72 "qtgraphicaleffects", "qtgui", "qthelp", "qtimageformats", "qtlinguist", |
72 "activeqt", "qtconcurrent", "qtcore", "qtdbus", "qtdesigner", |
73 "qtmultimedia", "qtnetwork", "qtopengl", "qtprintsupport", "qtqml", "qtquick", |
73 "qtdoc", "qtgraphicaleffects", "qtgui", "qthelp", "qtimageformats", |
74 "qtscript", "qtsql", "qtsvg", "qttestlib", "qtuitools", "qtwebkit", |
74 "qtlinguist", "qtmultimedia", "qtnetwork", "qtopengl", |
75 "qtwebkitexamples", "qtwidgets", "qtxml", "qtxmlpatterns"] |
75 "qtprintsupport", "qtqml", "qtquick", "qtscript", "qtsql", "qtsvg", |
|
76 "qttestlib", "qtuitools", "qtwebkit", "qtwebkitexamples", |
|
77 "qtwidgets", "qtxml", "qtxmlpatterns"] |
76 for qtDocs, version in [(qt4Docs, 4), (qt5Docs, 5)]: |
78 for qtDocs, version in [(qt4Docs, 4), (qt5Docs, 5)]: |
77 for doc in qtDocs: |
79 for doc in qtDocs: |
78 changes |= self.__installQtDoc(doc, version, engine) |
80 changes |= self.__installQtDoc(doc, version, engine) |
79 self.__mutex.lock() |
81 self.__mutex.lock() |
80 if self.__abort: |
82 if self.__abort: |
125 return False |
129 return False |
126 |
130 |
127 for f in files: |
131 for f in files: |
128 if f.startswith(name): |
132 if f.startswith(name): |
129 fi = QFileInfo(docsPath.absolutePath() + QDir.separator() + f) |
133 fi = QFileInfo(docsPath.absolutePath() + QDir.separator() + f) |
130 namespace = QHelpEngineCore.namespaceName(fi.absoluteFilePath()) |
134 namespace = QHelpEngineCore.namespaceName( |
|
135 fi.absoluteFilePath()) |
131 if not namespace: |
136 if not namespace: |
132 continue |
137 continue |
133 |
138 |
134 if dt.isValid() and \ |
139 if dt.isValid() and \ |
135 namespace in engine.registeredDocumentations() and \ |
140 namespace in engine.registeredDocumentations() and \ |
136 fi.lastModified().toString(Qt.ISODate) == dt.toString(Qt.ISODate) and \ |
141 fi.lastModified().toString(Qt.ISODate) == \ |
|
142 dt.toString(Qt.ISODate) and \ |
137 qchFile == fi.absoluteFilePath(): |
143 qchFile == fi.absoluteFilePath(): |
138 return False |
144 return False |
139 |
145 |
140 if namespace in engine.registeredDocumentations(): |
146 if namespace in engine.registeredDocumentations(): |
141 engine.unregisterDocumentation(namespace) |
147 engine.unregisterDocumentation(namespace) |
142 |
148 |
143 if not engine.registerDocumentation(fi.absoluteFilePath()): |
149 if not engine.registerDocumentation(fi.absoluteFilePath()): |
144 self.errorMessage.emit( |
150 self.errorMessage.emit( |
145 self.trUtf8("""<p>The file <b>{0}</b> could not be registered.""" |
151 self.trUtf8( |
146 """<br/>Reason: {1}</p>""")\ |
152 """<p>The file <b>{0}</b> could not be""" |
|
153 """ registered. <br/>Reason: {1}</p>""")\ |
147 .format(fi.absoluteFilePath, engine.error()) |
154 .format(fi.absoluteFilePath, engine.error()) |
148 ) |
155 ) |
149 return False |
156 return False |
150 |
157 |
151 engine.setCustomValue(versionKey, |
158 engine.setCustomValue(versionKey, |
184 |
191 |
185 for f in files: |
192 for f in files: |
186 if f == "source.qch": |
193 if f == "source.qch": |
187 fi = QFileInfo(docsPath.absolutePath() + QDir.separator() + f) |
194 fi = QFileInfo(docsPath.absolutePath() + QDir.separator() + f) |
188 if dt.isValid() and \ |
195 if dt.isValid() and \ |
189 fi.lastModified().toString(Qt.ISODate) == dt.toString(Qt.ISODate) and \ |
196 fi.lastModified().toString(Qt.ISODate) == \ |
|
197 dt.toString(Qt.ISODate) and \ |
190 qchFile == fi.absoluteFilePath(): |
198 qchFile == fi.absoluteFilePath(): |
191 return False |
199 return False |
192 |
200 |
193 namespace = QHelpEngineCore.namespaceName(fi.absoluteFilePath()) |
201 namespace = QHelpEngineCore.namespaceName( |
|
202 fi.absoluteFilePath()) |
194 if not namespace: |
203 if not namespace: |
195 continue |
204 continue |
196 |
205 |
197 if namespace in engine.registeredDocumentations(): |
206 if namespace in engine.registeredDocumentations(): |
198 engine.unregisterDocumentation(namespace) |
207 engine.unregisterDocumentation(namespace) |
199 |
208 |
200 if not engine.registerDocumentation(fi.absoluteFilePath()): |
209 if not engine.registerDocumentation(fi.absoluteFilePath()): |
201 self.errorMessage.emit( |
210 self.errorMessage.emit( |
202 self.trUtf8("""<p>The file <b>{0}</b> could not be registered.""" |
211 self.trUtf8( |
203 """<br/>Reason: {1}</p>""")\ |
212 """<p>The file <b>{0}</b> could not be""" |
|
213 """ registered. <br/>Reason: {1}</p>""")\ |
204 .format(fi.absoluteFilePath, engine.error()) |
214 .format(fi.absoluteFilePath, engine.error()) |
205 ) |
215 ) |
206 return False |
216 return False |
207 |
217 |
208 engine.setCustomValue(versionKey, |
218 engine.setCustomValue(versionKey, |