From 31618e87d13c50d27946dbbbd5dc347d663ce034 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Thu, 17 May 2018 20:41:42 -0400 Subject: [PATCH] Fix to loading of online help system. --- helpwindow.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/helpwindow.cpp b/helpwindow.cpp index a07eb5d..5e5c016 100644 --- a/helpwindow.cpp +++ b/helpwindow.cpp @@ -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; -} -*/ +