1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #ifndef QTDOCINSTALLER |
5 | #define QTDOCINSTALLER |
6 | |
7 | #include <QtCore/QDir> |
8 | #include <QtCore/QMutex> |
9 | #include <QtCore/QPair> |
10 | #include <QtCore/QStringList> |
11 | #include <QtCore/QThread> |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | class HelpEngineWrapper; |
16 | |
17 | class QtDocInstaller : public QThread |
18 | { |
19 | Q_OBJECT |
20 | |
21 | public: |
22 | typedef QPair<QString, QStringList> DocInfo; |
23 | QtDocInstaller(const QList<DocInfo> &docInfos); |
24 | ~QtDocInstaller() override; |
25 | void installDocs(); |
26 | |
27 | signals: |
28 | void qchFileNotFound(const QString &component); |
29 | void registerDocumentation(const QString &component, |
30 | const QString &absFileName); |
31 | void docsInstalled(bool newDocsInstalled); |
32 | |
33 | private: |
34 | void run() override; |
35 | bool installDoc(const DocInfo &docInfo); |
36 | |
37 | bool m_abort; |
38 | QMutex m_mutex; |
39 | QStringList m_qchFiles; |
40 | QDir m_qchDir; |
41 | QList<DocInfo> m_docInfos; |
42 | }; |
43 | |
44 | QT_END_NAMESPACE |
45 | |
46 | #endif |
47 | |