Commit 76e6596b authored by Alexander Semke's avatar Alexander Semke
Browse files

Minor fixes:

1. no need to explicitely delete the main widget in the doc panel, it's
automatically deleted by the parent.
2. no need to call QHelpEngine::setupData(), according to Qt's
documentation this is automatically done internally.
parent 87b7980e
...@@ -32,7 +32,6 @@ DocumentationPanelPlugin::DocumentationPanelPlugin(QObject* parent, QList<QVaria ...@@ -32,7 +32,6 @@ DocumentationPanelPlugin::DocumentationPanelPlugin(QObject* parent, QList<QVaria
DocumentationPanelPlugin::~DocumentationPanelPlugin() DocumentationPanelPlugin::~DocumentationPanelPlugin()
{ {
delete m_widget;
} }
QWidget* DocumentationPanelPlugin::widget() QWidget* DocumentationPanelPlugin::widget()
......
...@@ -273,6 +273,7 @@ void DocumentationPanelWidget::updateBackend(const QString& newBackend, const QS ...@@ -273,6 +273,7 @@ void DocumentationPanelWidget::updateBackend(const QString& newBackend, const QS
//select the first available documentation file which will trigger the re-initialization of QHelpEngine //select the first available documentation file which will trigger the re-initialization of QHelpEngine
//TODO: restore from the saved state the previously selected documentation in m_documentationSelector for the current backend //TODO: restore from the saved state the previously selected documentation in m_documentationSelector for the current backend
m_documentationSelector->setCurrentIndex(0); m_documentationSelector->setCurrentIndex(0);
updateDocumentation();
} }
/*! /*!
...@@ -308,9 +309,10 @@ void DocumentationPanelWidget::updateDocumentation() ...@@ -308,9 +309,10 @@ void DocumentationPanelWidget::updateDocumentation()
const QString& fileName = QStandardPaths::locate(QStandardPaths::AppDataLocation, const QString& fileName = QStandardPaths::locate(QStandardPaths::AppDataLocation,
QLatin1String("documentation/") + m_backend + QLatin1String("/") + QLatin1String("documentation/") + m_backend + QLatin1String("/") +
docSelected + QLatin1String("/help.qhc")); docSelected + QLatin1String("/help.qhc"));
m_engine = new QHelpEngine(fileName, this); m_engine = new QHelpEngine(fileName, this);
if(!m_engine->setupData()) // if(!m_engine->setupData())
qWarning() << "Couldn't setup QtHelp Engine: " << m_engine->error(); // qWarning() << "Couldn't setup QtHelp Engine: " << m_engine->error();
if(m_backend != QLatin1String("Octave")) if(m_backend != QLatin1String("Octave"))
m_engine->setProperty("_q_readonly", QVariant::fromValue<bool>(true)); m_engine->setProperty("_q_readonly", QVariant::fromValue<bool>(true));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment