Commit 536f7b33 authored by Shubham  .'s avatar Shubham .
Browse files

Remove unnecessary code

parent 115966e5
......@@ -35,6 +35,9 @@ DocumentationPanelPlugin::~DocumentationPanelPlugin()
void DocumentationPanelPlugin::onSessionChanged()
{
m_backendName = session()->backend()->name();
m_backendIcon = session()->backend()->icon();
if(m_widget)
{
m_widget->setBackend(m_backendName);
......@@ -44,9 +47,6 @@ void DocumentationPanelPlugin::onSessionChanged()
QWidget* DocumentationPanelPlugin::widget()
{
m_backendName = session()->backend()->name();
m_backendIcon = session()->backend()->icon();
if(!m_widget)
{
m_widget = new DocumentationPanelWidget(m_backendName, m_backendIcon, parentWidget());
......
......@@ -380,8 +380,7 @@ void DocumentationPanelWidget::downloadResource(QWebEngineDownloadItem* resource
void DocumentationPanelWidget::loadDocumentation()
{
const QString& backend = backendName();
const QString& fileName = QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String("documentation/") + backend + QLatin1String("/help.qch"));
const QString& fileName = QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String("documentation/") + m_backend + QLatin1String("/help.qch"));
const QString& nameSpace = QHelpEngineCore::namespaceName(fileName);
if(nameSpace.isEmpty() || !m_engine->registeredDocumentations().contains(nameSpace))
......@@ -390,8 +389,3 @@ void DocumentationPanelWidget::loadDocumentation()
qWarning() << m_engine->error();
}
}
QString DocumentationPanelWidget::backendName() const
{
return m_backend;
}
......@@ -45,12 +45,8 @@ class DocumentationPanelWidget : public QWidget
~DocumentationPanelWidget();
void setBackend(const QString&);
void setBackendIcon(const QString&);
/** @return name of the current backend **/
QString backendName() const;
void loadDocumentation();
Q_SIGNALS:
......
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