Commit 110db285 authored by Alexander Semke's avatar Alexander Semke

Added couple of missing default member initializations and some more usage of...

Added couple of missing default member initializations and some more usage of the constructor member initializer lists.
parent ef0b0081
......@@ -40,18 +40,14 @@
#include <QChar>
#include <QUrl>
MaximaExpression::MaximaExpression( Cantor::Session* session ) : Cantor::Expression(session)
MaximaExpression::MaximaExpression( Cantor::Session* session ) : Cantor::Expression(session),
m_tempFile(nullptr),
m_isHelpRequest(false),
m_isPlot(false),
m_gotErrorContent(false)
{
qDebug();
m_tempFile=nullptr;
}
MaximaExpression::~MaximaExpression()
{
}
void MaximaExpression::evaluate()
{
setStatus(Cantor::Expression::Computing);
......
......@@ -24,22 +24,20 @@
#include "expression.h"
#include "KDirWatch"
#include <QStringList>
#include <QXmlStreamReader>
class QTimer;
class QTemporaryFile;
class MaximaExpression : public Cantor::Expression
{
Q_OBJECT
public:
explicit MaximaExpression( Cantor::Session* session);
~MaximaExpression() override;
public:
explicit MaximaExpression(Cantor::Session*);
void evaluate() Q_DECL_OVERRIDE;
void interrupt() Q_DECL_OVERRIDE;
void addInformation(const QString& information) Q_DECL_OVERRIDE;
void addInformation(const QString&) Q_DECL_OVERRIDE;
bool needsLatexResult();
......@@ -52,21 +50,20 @@ class MaximaExpression : public Cantor::Expression
void forceDone();
//reads from @param out until a prompt indicates that a new expression has started
bool parseOutput(QString& out);
void parseError(const QString& out);
bool parseOutput(QString&);
void parseError(const QString&);
private Q_SLOTS:
private Q_SLOTS:
void imageChanged();
private:
private:
QString additionalLatexHeaders() Q_DECL_OVERRIDE;
Cantor::Result* parseResult(int* idx,QString& out,QString& textBuffer,QString& latexBuffer);
private:
QTemporaryFile *m_tempFile;
KDirWatch m_fileWatch;
bool m_isHelpRequest;
bool m_isPlot;
QTimer* m_askTimer;
QString m_errorBuffer;
bool m_gotErrorContent;
};
......
......@@ -32,26 +32,18 @@
static const char* printCommand = "cantor_print();";
OctaveExpression::OctaveExpression(Cantor::Session* session): Expression(session)
OctaveExpression::OctaveExpression(Cantor::Session* session): Expression(session),
m_plotPending(false),
m_finished(false),
m_error(false)
{
qDebug() << "OctaveExpression construtor";
m_plotCommands << QLatin1String("plot") << QLatin1String("semilogx") << QLatin1String("semilogy") << QLatin1String("loglog")
<< QLatin1String("polar") << QLatin1String("mesh") << QLatin1String("contour") << QLatin1String("bar")
<< QLatin1String("stairs") << QLatin1String("errorbar") << QLatin1String("surf") << QLatin1String("sombrero")
<< QLatin1String("hist") << QLatin1String("fplot") << QLatin1String("imshow");
m_plotCommands << QLatin1String("cantor_plot2d") << QLatin1String("cantor_plot3d");
m_error = false;
m_plotPending = false;
}
OctaveExpression::~OctaveExpression()
{
}
void OctaveExpression::interrupt()
{
qDebug() << "interrupt";
......
......@@ -32,30 +32,28 @@ typedef Cantor::ImageResult OctavePlotResult;
#endif
class OctaveExpression : public Cantor::Expression
{
Q_OBJECT
public:
OctaveExpression(Cantor::Session* session);
~OctaveExpression() override;
void interrupt() Q_DECL_OVERRIDE;
void evaluate() Q_DECL_OVERRIDE;
void parseOutput ( QString output );
void parseError(QString error);
void parsePlotFile(QString file);
void finalize();
void setPlotPending(bool plot);
private:
QString m_resultString;
int m_numberOfLines;
bool m_plotPending;
bool m_finished;
bool m_error;
QStringList m_plotCommands;
public:
OctaveExpression(Cantor::Session*);
void interrupt() Q_DECL_OVERRIDE;
void evaluate() Q_DECL_OVERRIDE;
void parseOutput (QString);
void parseError(QString);
void parsePlotFile(QString file);
void finalize();
void setPlotPending(bool);
private:
QString m_resultString;
bool m_plotPending;
bool m_finished;
bool m_error;
QStringList m_plotCommands;
};
#endif // OCTAVEEXPRESSION_H
......@@ -31,14 +31,10 @@
#include <QMimeDatabase>
#include <QRegExp>
SageExpression::SageExpression( Cantor::Session* session ) : Cantor::Expression(session)
SageExpression::SageExpression( Cantor::Session* session ) : Cantor::Expression(session),
m_isHelpRequest(false),
m_promptCount(0)
{
qDebug();
}
SageExpression::~SageExpression()
{
}
void SageExpression::evaluate()
......
......@@ -27,23 +27,24 @@ class SageExpression : public Cantor::Expression
{
Q_OBJECT
public:
SageExpression( Cantor::Session* session);
~SageExpression() override;
SageExpression(Cantor::Session*);
void evaluate() Q_DECL_OVERRIDE;
void interrupt() Q_DECL_OVERRIDE;
void parseOutput(const QString& text);
void parseError(const QString& text);
void parseOutput(const QString&);
void parseError(const QString&);
void addFileResult(const QString& path);
void addFileResult(const QString&);
void onProcessError(const QString&);
void onProcessError(const QString& msg);
public Q_SLOTS:
void evalFinished();
protected:
QString additionalLatexHeaders() Q_DECL_OVERRIDE;
private:
QString m_outputCache;
QString m_imagePath;
......
......@@ -111,13 +111,13 @@ class WorksheetAccessInterfaceImpl : public Cantor::WorksheetAccessInterface
Worksheet* m_worksheet;
};
CantorPart::CantorPart( QWidget *parentWidget, QObject *parent, const QVariantList & args ): KParts::ReadWritePart(parent)
CantorPart::CantorPart( QWidget *parentWidget, QObject *parent, const QVariantList & args ): KParts::ReadWritePart(parent),
m_searchBar(nullptr),
m_initProgressDlg(nullptr),
m_showProgressDlg(true),
m_showBackendHelp(nullptr),
m_statusBarBlocked(false)
{
m_showBackendHelp=nullptr;
m_initProgressDlg=nullptr;
m_statusBarBlocked=false;
m_showProgressDlg=true;
qDebug()<<"Created a CantorPart";
m_panelHandler=new Cantor::PanelPluginHandler(this);
......@@ -161,7 +161,6 @@ CantorPart::CantorPart( QWidget *parentWidget, QObject *parent, const QVariantLi
connect(actionCollection(), SIGNAL(inserted(QAction*)), m_worksheet,
SLOT(registerShortcut(QAction*)));
m_searchBar = nullptr;
layout->addWidget(m_worksheetview);
// notify the part that this is our internal widget
setWidget(widget);
......
......@@ -175,9 +175,6 @@ private:
QString m_cachedStatusMessage;
bool m_statusBarBlocked;
};
#endif // CANTORPART_H
......@@ -41,10 +41,9 @@ using namespace Cantor;
class Cantor::ExpressionPrivate
{
public:
ExpressionPrivate() {
result=nullptr;
session=nullptr;
isInternal=false;
ExpressionPrivate() : result(nullptr), status(Expression::Done), session(nullptr),
finishingBehavior(Expression::DoNotDelete), isInternal(false)
{
}
int id;
......
......@@ -26,11 +26,8 @@ using namespace Cantor;
class Cantor::SessionPrivate
{
public:
SessionPrivate()
SessionPrivate() : backend(nullptr), status(Session::Done), typesettingEnabled(false), expressionCount(0)
{
backend=nullptr;
expressionCount=0;
typesettingEnabled=false;
}
Backend* backend;
......@@ -39,8 +36,7 @@ class Cantor::SessionPrivate
int expressionCount;
};
Session::Session( Backend* backend ) : QObject(backend),
d(new SessionPrivate)
Session::Session( Backend* backend ) : QObject(backend), d(new SessionPrivate)
{
d->backend=backend;
}
......
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