1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QHELPSEARCHINDEXWRITER_H
5#define QHELPSEARCHINDEXWRITER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of the help generator tools. This header file may change from version
13// to version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qmutex.h>
19#include <QtCore/qthread.h>
20
21QT_BEGIN_NAMESPACE
22
23class QSqlDatabase;
24
25namespace fulltextsearch {
26
27// TODO: Employ QFuture / QtConcurrent::run() ?
28class QHelpSearchIndexWriter : public QThread
29{
30 Q_OBJECT
31
32public:
33 ~QHelpSearchIndexWriter() override;
34
35 void cancelIndexing();
36 void updateIndex(const QString &collectionFile, const QString &indexFilesFolder, bool reindex);
37
38signals:
39 void indexingStarted();
40 void indexingFinished();
41
42private:
43 void run() override;
44
45private:
46 QMutex m_mutex;
47
48 bool m_cancel = false;
49 bool m_reindex;
50 QString m_collectionFile;
51 QString m_indexFilesFolder;
52};
53
54} // namespace fulltextsearch
55
56QT_END_NAMESPACE
57
58#endif // QHELPSEARCHINDEXWRITER_H
59

Provided by KDAB

Privacy Policy
Start learning QML with our Intro Training
Find out more

source code of qttools/src/assistant/help/qhelpsearchindexwriter_p.h