Commit 30476363 authored by Alexander Semke's avatar Alexander Semke
Browse files

Don't call updateGraphicPackagesFromSettings() in Octave, Python and Julia sessions.

No need to go through this logic for every expression being evaluated. The option for the graphical packages
was only meant to be used by the Plot2DAssistant, this logic only needs to be evaluated when the 2d assistant is used.
Removing these calls for now since it's causing a lot confusion - e.g. the user wants to evaluate '5+5' in julia and get a very long message about the missing GR package.
The proper implementation will come later. 
parent b68b0af5
Pipeline #152845 passed with stage
in 4 minutes and 39 seconds
......@@ -199,9 +199,6 @@ void JuliaSession::interrupt()
Cantor::Expression *JuliaSession::evaluateExpression(const QString& cmd, Cantor::Expression::FinishingBehavior behave, bool internal)
{
if (!internal)
updateGraphicPackagesFromSettings();
auto* expr = new JuliaExpression(this, internal);
expr->setFinishingBehavior(behave);
expr->setCommand(cmd);
......@@ -304,7 +301,7 @@ void JuliaSession::updateGraphicPackagesFromSettings()
{
updateEnabledGraphicPackages(QList<Cantor::GraphicPackage>());
m_isIntegratedPlotsEnabled = false;
m_isIntegratedPlotsSettingsEnabled = JuliaSettings::integratePlots();
m_isIntegratedPlotsSettingsEnabled = true;
return;
}
else if (!m_isIntegratedPlotsEnabled && JuliaSettings::integratePlots() == true)
......
......@@ -234,14 +234,11 @@ void OctaveSession::processError()
emit error(m_process->errorString());
}
Cantor::Expression* OctaveSession::evaluateExpression(const QString& command, Cantor::Expression::FinishingBehavior behavior, bool internal )
Cantor::Expression* OctaveSession::evaluateExpression(const QString& cmd, Cantor::Expression::FinishingBehavior behavior, bool internal)
{
if (!internal)
updateGraphicPackagesFromSettings();
qDebug() << "evaluating: " << command;
qDebug() << "evaluating: " << cmd;
auto* expression = new OctaveExpression(this, internal);
expression->setCommand ( command );
expression->setCommand(cmd);
expression->setFinishingBehavior(behavior);
expression->evaluate();
......
......@@ -172,12 +172,6 @@ void PythonSession::interrupt()
Cantor::Expression* PythonSession::evaluateExpression(const QString& cmd, Cantor::Expression::FinishingBehavior behave, bool internal)
{
// We ignore here internal because of two reasons
// 1. The function uses internal expressions itself
// 2. Internal commands don't come from user and don't produce plots, so don't need to check graphic packages
if (!internal)
updateGraphicPackagesFromSettings();
qDebug() << "evaluating: " << cmd;
auto* expr = new PythonExpression(this, internal);
expr->setFinishingBehavior(behave);
......
Supports Markdown
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