Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Cantor
Commits
8769952e
Commit
8769952e
authored
Jun 17, 2020
by
Shubham .
Browse files
Remove unnecessary includes, fix typos
parent
82c65df8
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/panelplugins/documentationpanel/documentationpanelplugin.cpp
View file @
8769952e
...
...
@@ -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
()
{
...
...
src/panelplugins/documentationpanel/documentationpanelplugin.h
View file @
8769952e
...
...
@@ -19,7 +19,7 @@
*/
#ifndef _DOCUMENTATIONPANELPLUGIN_H
#define _DOCUMENTATI
P
NPANELPLUGIN_H
#define _DOCUMENTATI
O
NPANELPLUGIN_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
/* _DOCUMENTATI
P
NPANELPLUGIN_H */
#endif
/* _DOCUMENTATI
O
NPANELPLUGIN_H */
src/panelplugins/documentationpanel/documentationpanelwidget.cpp
View file @
8769952e
...
...
@@ -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
()
<<
"
c
ould not find QCH file in directory"
<<
m_path
;
qWarning
()
<<
"
C
ould 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
()
<<
"
l
oading doc"
<<
fileName
<<
fileNamespace
;
qDebug
()
<<
"
L
oading doc"
<<
fileName
<<
fileNamespace
;
if
(
!
m_engine
->
registerDocumentation
(
fileName
))
qCritical
()
<<
"
e
rror >> "
<<
fileName
<<
m_engine
->
error
();
qCritical
()
<<
"
E
rror >> "
<<
fileName
<<
m_engine
->
error
();
}
}
}
...
...
@@ -123,7 +124,7 @@ QStringList DocumentationPanelWidget::qchFiles() const
}
}
if
(
files
.
isEmpty
())
{
qDebug
()
<<
"
n
o QCH file found at all"
;
qDebug
()
<<
"
N
o QCH file found at all"
;
}
return
files
;
}
...
...
src/panelplugins/documentationpanel/documentationpanelwidget.h
View file @
8769952e
...
...
@@ -29,9 +29,6 @@ class Session;
}
class
QHelpEngine
;
class
QSplitter
;
class
QTabWidget
;
class
QTextBrowser
;
class
DocumentationPanelWidget
:
public
QWidget
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment