117 info = engine.customValue(versionKey, "") |
117 info = engine.customValue(versionKey, "") |
118 lst = info.split('|') |
118 lst = info.split('|') |
119 |
119 |
120 dt = QDateTime() |
120 dt = QDateTime() |
121 if len(lst) and lst[0]: |
121 if len(lst) and lst[0]: |
122 dt = QDateTime.fromString(lst[0], Qt.ISODate) |
122 dt = QDateTime.fromString(lst[0], Qt.DateFormat.ISODate) |
123 |
123 |
124 qchFile = "" |
124 qchFile = "" |
125 if len(lst) == 2: |
125 if len(lst) == 2: |
126 qchFile = lst[1] |
126 qchFile = lst[1] |
127 |
127 |
128 if version == 4: |
128 if version == 4: |
129 docsPath = QDir( |
129 docsPath = QDir( |
130 QLibraryInfo.location(QLibraryInfo.DocumentationPath) + |
130 QLibraryInfo.location( |
|
131 QLibraryInfo.LibraryLocation.DocumentationPath) + |
131 QDir.separator() + "qch") |
132 QDir.separator() + "qch") |
132 elif version == 5: |
133 elif version == 5: |
133 docsPath = QLibraryInfo.location(QLibraryInfo.DocumentationPath) |
134 docsPath = QLibraryInfo.location( |
|
135 QLibraryInfo.LibraryLocation.DocumentationPath) |
134 if ( |
136 if ( |
135 not os.path.isdir(docsPath) or |
137 not os.path.isdir(docsPath) or |
136 len(QDir(docsPath).entryList(["*.qch"])) == 0 |
138 len(QDir(docsPath).entryList(["*.qch"])) == 0 |
137 ): |
139 ): |
138 docsPathList = QDir.fromNativeSeparators(docsPath).split("/") |
140 docsPathList = QDir.fromNativeSeparators(docsPath).split("/") |
146 |
148 |
147 files = docsPath.entryList(["*.qch"]) |
149 files = docsPath.entryList(["*.qch"]) |
148 if not files: |
150 if not files: |
149 engine.setCustomValue( |
151 engine.setCustomValue( |
150 versionKey, |
152 versionKey, |
151 QDateTime().toString(Qt.ISODate) + '|') |
153 QDateTime().toString(Qt.DateFormat.ISODate) + '|') |
152 return False |
154 return False |
153 |
155 |
154 for f in files: |
156 for f in files: |
155 if f.startswith(name + "."): |
157 if f.startswith(name + "."): |
156 fi = QFileInfo(docsPath.absolutePath() + QDir.separator() + f) |
158 fi = QFileInfo(docsPath.absolutePath() + QDir.separator() + f) |
160 continue |
162 continue |
161 |
163 |
162 if ( |
164 if ( |
163 dt.isValid() and |
165 dt.isValid() and |
164 namespace in engine.registeredDocumentations() and |
166 namespace in engine.registeredDocumentations() and |
165 (fi.lastModified().toString(Qt.ISODate) == |
167 (fi.lastModified().toString(Qt.DateFormat.ISODate) == |
166 dt.toString(Qt.ISODate)) and |
168 dt.toString(Qt.DateFormat.ISODate)) and |
167 qchFile == fi.absoluteFilePath() |
169 qchFile == fi.absoluteFilePath() |
168 ): |
170 ): |
169 return False |
171 return False |
170 |
172 |
171 if namespace in engine.registeredDocumentations(): |
173 if namespace in engine.registeredDocumentations(): |
199 info = engine.customValue(versionKey, "") |
201 info = engine.customValue(versionKey, "") |
200 lst = info.split('|') |
202 lst = info.split('|') |
201 |
203 |
202 dt = QDateTime() |
204 dt = QDateTime() |
203 if len(lst) and lst[0]: |
205 if len(lst) and lst[0]: |
204 dt = QDateTime.fromString(lst[0], Qt.ISODate) |
206 dt = QDateTime.fromString(lst[0], Qt.DateFormat.ISODate) |
205 |
207 |
206 qchFile = "" |
208 qchFile = "" |
207 if len(lst) == 2: |
209 if len(lst) == 2: |
208 qchFile = lst[1] |
210 qchFile = lst[1] |
209 |
211 |
210 docsPath = QDir(getConfig("ericDocDir") + QDir.separator() + "Help") |
212 docsPath = QDir(getConfig("ericDocDir") + QDir.separator() + "Help") |
211 |
213 |
212 files = docsPath.entryList(["*.qch"]) |
214 files = docsPath.entryList(["*.qch"]) |
213 if not files: |
215 if not files: |
214 engine.setCustomValue( |
216 engine.setCustomValue( |
215 versionKey, QDateTime().toString(Qt.ISODate) + '|') |
217 versionKey, QDateTime().toString(Qt.DateFormat.ISODate) + '|') |
216 return False |
218 return False |
217 |
219 |
218 for f in files: |
220 for f in files: |
219 if f == "source.qch": |
221 if f == "source.qch": |
220 fi = QFileInfo(docsPath.absolutePath() + QDir.separator() + f) |
222 fi = QFileInfo(docsPath.absolutePath() + QDir.separator() + f) |
224 continue |
226 continue |
225 |
227 |
226 if ( |
228 if ( |
227 dt.isValid() and |
229 dt.isValid() and |
228 namespace in engine.registeredDocumentations() and |
230 namespace in engine.registeredDocumentations() and |
229 (fi.lastModified().toString(Qt.ISODate) == |
231 (fi.lastModified().toString(Qt.DateFormat.ISODate) == |
230 dt.toString(Qt.ISODate)) and |
232 dt.toString(Qt.DateFormat.ISODate)) and |
231 qchFile == fi.absoluteFilePath() |
233 qchFile == fi.absoluteFilePath() |
232 ): |
234 ): |
233 return False |
235 return False |
234 |
236 |
235 if namespace in engine.registeredDocumentations(): |
237 if namespace in engine.registeredDocumentations(): |