Fix to loading of online help system.

This commit is contained in:
Collin Kidder
2018-05-17 20:41:42 -04:00
parent f345642b03
commit 31618e87d1
+6 -16
View File
@@ -10,7 +10,7 @@ HelpWindow::HelpWindow(QWidget *parent) :
{
ui->setupUi(this);
m_helpEngine = new QHelpEngineCore("SavvyCAN.qhc", this);
m_helpEngine = new QHelpEngineCore(QApplication::applicationDirPath() +"/SavvyCAN.qhc", this);
if (!m_helpEngine->setupData()) {
delete m_helpEngine;
m_helpEngine = 0;
@@ -66,8 +66,10 @@ HelpWindow* HelpWindow::getRef()
void HelpWindow::showHelp(QString help)
{
if (m_helpEngine) {
qDebug() << "Searching for " << help;
QByteArray helpData = m_helpEngine->fileData(QUrl("qthelp://org.sphinx.savvycan.181/doc/" + help));
QString url = "qthelp://org.sphinx.savvycan.181/doc/" + help;
qDebug() << "Searching for " << url;
QByteArray helpData = m_helpEngine->fileData(QUrl(url));
qDebug() << "Help file size: " << helpData.length();
ui->textHelp->setText(helpData);
}
else
@@ -78,17 +80,5 @@ void HelpWindow::showHelp(QString help)
readSettings();
self->show();
}
/*
QVariant HelpBrowser::loadResource(int type, const QUrl &name)
{
QByteArray ba;
if (type < 4 && m_helpEngine) {
QUrl url(name);
if (name.isRelative())
url = source().resolved(url);
ba = m_helpEngine->fileData(url);
}
return ba;
}
*/