MCPcopy Create free account
hub / github.com/KDAB/GammaRay / isAvailable

Method isAvailable

ui/helpcontroller.cpp:89–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89bool 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
117void HelpController::openContents()
118{

Callers

nothing calls this directly

Calls 3

assistantExecutableNameFunction · 0.85
documentationPathFunction · 0.85
isEmptyMethod · 0.45

Tested by

no test coverage detected