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