| 87 | } |
| 88 | |
| 89 | bool HelpController::isAvailable() |
| 90 | { |
| 91 | auto d = s_helpController(); |
| 92 | if (!d->assistantPath.isEmpty() && !d->qhcPath.isEmpty()) |
| 93 | return true; |
| 94 | |
| 95 | d->assistantPath = QLibraryInfo::path(QLibraryInfo::BinariesPath) + QDir::separator() + assistantExecutableName(); |
| 96 | QFileInfo assistFile(d->assistantPath); |
| 97 | if (!assistFile.isExecutable()) { |
| 98 | qDebug() << "Qt Assistant not found in QT_INSTALL_BINS. Looking in standard Path next."; |
| 99 | d->assistantPath = QStandardPaths::findExecutable(assistantExecutableName()); |
| 100 | if (d->assistantPath.isEmpty()) { |
| 101 | qDebug() << "Qt Assistant not found, help not available."; |
| 102 | return false; |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | const QString qhcPath = Paths::documentationPath() + QLatin1String("/gammaray.qhc"); |
| 107 | if (QFileInfo::exists(qhcPath)) { |
| 108 | d->qhcPath = qhcPath; |
| 109 | return true; |
| 110 | } else { |
| 111 | qDebug() << "gammaray.qhc not found in" << Paths::documentationPath() |
| 112 | << " - help not available"; |
| 113 | } |
| 114 | return false; |
| 115 | } |
| 116 | |
| 117 | void HelpController::openContents() |
| 118 | { |
nothing calls this directly
no test coverage detected