6#include <QtCore/QLibraryInfo>
7#include <QtCore/QDateTime>
8#include <QtCore/QFileSystemWatcher>
9#include <QtHelp/QHelpEngineCore>
15using namespace Qt::StringLiterals;
43 m_qchDir.setPath(QLibraryInfo::path(QLibraryInfo::DocumentationPath));
44 m_qchFiles = m_qchDir.entryList(QStringList() <<
"*.qch"_L1);
47 for (
const DocInfo &docInfo : std::as_const(m_docInfos)) {
48 changes |= installDoc(docInfo);
56 emit docsInstalled(changes);
62 const QString &component = docInfo.first;
63 const QStringList &info = docInfo.second;
65 if (!info.isEmpty() && !info.first().isEmpty())
66 dt = QDateTime::fromString(info.first(), Qt::ISODate);
70 qchFile = info.last();
72 if (m_qchFiles.isEmpty()) {
73 emit qchFileNotFound(component);
76 for (
const QString &f : std::as_const(m_qchFiles)) {
77 if (f.startsWith(component)) {
78 QFileInfo fi(m_qchDir.absolutePath() + QDir::separator() + f);
79 if (dt.isValid() && fi.lastModified().toSecsSinceEpoch() == dt.toSecsSinceEpoch()
80 && qchFile == fi.absoluteFilePath())
82 emit registerDocumentation(component, fi.absoluteFilePath());
87 emit qchFileNotFound(component);
QtDocInstaller(const QList< DocInfo > &docInfos)
~QtDocInstaller() override
Combined button and popup list for selecting options.