Commit 8769952e authored by Shubham  .'s avatar Shubham .
Browse files

Remove unnecessary includes, fix typos

parent 82c65df8
......@@ -19,7 +19,6 @@
*/
#include "documentationpanelplugin.h"
#include "documentationpanelwidget.h"
DocumentationPanelPlugin::DocumentationPanelPlugin(QObject* parent, QList<QVariant> args) : Cantor::PanelPlugin(parent), m_widget(nullptr)
{
......@@ -32,11 +31,11 @@ DocumentationPanelPlugin::~DocumentationPanelPlugin()
delete m_widget;
}
void DocumentationPanelPlugin::onSessionChanged()
/*void DocumentationPanelPlugin::onSessionChanged()
{
if(m_widget)
m_widget->setSession(session());
}
}*/
QWidget* DocumentationPanelPlugin::widget()
{
......
......@@ -19,7 +19,7 @@
*/
#ifndef _DOCUMENTATIONPANELPLUGIN_H
#define _DOCUMENTATIPNPANELPLUGIN_H
#define _DOCUMENTATIONPANELPLUGIN_H
#include "panelplugin.h"
#include "documentationpanelwidget.h"
......@@ -38,12 +38,12 @@ class DocumentationPanelPlugin : public Cantor::PanelPlugin
bool showOnStartup() override;
void setShowOnStartup(bool);
protected:
void onSessionChanged() override;
/*protected:
void onSessionChanged() override;*/
private:
bool m_showAtStart;
QPointer<DocumentationPanelWidget> m_widget;
};
#endif /* _DOCUMENTATIPNPANELPLUGIN_H */
#endif /* _DOCUMENTATIONPANELPLUGIN_H */
......@@ -39,7 +39,7 @@
#include <QUrl>
#include <QVBoxLayout>
DocumentationPanelWidget::DocumentationPanelWidget(Cantor::Session* session, QWidget* parent) :QWidget(parent), m_engine(nullptr)
DocumentationPanelWidget::DocumentationPanelWidget(Cantor::Session* session, QWidget* parent) :QWidget(parent), m_engine(nullptr), m_path(QString())
{
addWidgets();
setSession(session);
......@@ -58,9 +58,8 @@ void DocumentationPanelWidget::setSession(Cantor::Session* session)
void DocumentationPanelWidget::addWidgets()
{
QPointer<QTabWidget> m_tabWidget;
QPointer<QSplitter> m_splitter;
QPointer<QTextBrowser> m_textBrowser;
//QPointer<QSplitter> m_splitter;
//QPointer<QTextBrowser> m_textBrowser;
//m_engine = new QHelpEngine(QApplication::applicationDirPath() + QLatin1String("/documentation/maxima_help_collection.qhc"), this);
m_engine = new QHelpEngine(QApplication::applicationDirPath() + QLatin1String("admin/documentation/maxima_help_collection.qhc"), this);
......@@ -71,13 +70,15 @@ void DocumentationPanelWidget::addWidgets()
if (!helpData.isEmpty())
qDebug() << helpData;
m_tabWidget = new QTabWidget;
QPointer<QTabWidget> m_tabWidget = new QTabWidget;
m_tabWidget->setMaximumWidth(1000);
m_tabWidget->addTab(m_engine->indexWidget(), i18n("Index"));
m_tabWidget->addTab(m_engine->contentWidget(), i18n("Contents"));
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addWidget(m_tabWidget, 1);
// Connect to various signals and slots
}
void DocumentationPanelWidget::loadDocumentation()
......@@ -88,16 +89,16 @@ void DocumentationPanelWidget::loadDocumentation()
const QStringList files = qchFiles();
if(files.isEmpty()) {
qWarning() << "could not find QCH file in directory" << m_path;
qWarning() << "Could not find QCH file in directory" << m_path;
return;
}
for (const QString& fileName : files) {
QString fileNamespace = QHelpEngineCore::namespaceName(fileName);
if (!fileNamespace.isEmpty() && !m_engine->registeredDocumentations().contains(fileNamespace)) {
qDebug() << "loading doc" << fileName << fileNamespace;
qDebug() << "Loading doc" << fileName << fileNamespace;
if(!m_engine->registerDocumentation(fileName))
qCritical() << "error >> " << fileName << m_engine->error();
qCritical() << "Error >> " << fileName << m_engine->error();
}
}
}
......@@ -123,7 +124,7 @@ QStringList DocumentationPanelWidget::qchFiles() const
}
}
if (files.isEmpty()) {
qDebug() << "no QCH file found at all";
qDebug() << "No QCH file found at all";
}
return files;
}
......
......@@ -29,9 +29,6 @@ class Session;
}
class QHelpEngine;
class QSplitter;
class QTabWidget;
class QTextBrowser;
class DocumentationPanelWidget : public QWidget
{
......
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