kdeplasma-addons: converter runner string correction

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-09-22 13:39:37 +03:00
parent ddead8b99f
commit a4043a10b0
3 changed files with 4 additions and 4 deletions

View file

@ -77,7 +77,6 @@ void QalculateEngine::evaluate(const QString& expression)
QString input = expression;
QByteArray ba = input.replace(QChar(0xA3), "GBP").replace(QChar(0xA5), "JPY").replace('$', "USD").replace(QChar(0x20AC), "EUR").toLatin1();
const char *ctext = ba.data();
EvaluationOptions eo;
@ -115,7 +114,7 @@ void QalculateEngine::evaluate(const QString& expression)
break;
}
MathStructure result = CALCULATOR->calculate(ctext, eo);
MathStructure result = CALCULATOR->calculate(ba.constData(), eo);
PrintOptions po;
switch (m_settings->fractionDisplay()) {

View file

@ -25,9 +25,10 @@
#include "qalculate_applet.h"
#include <QCheckBox>
class KComboBox;
#include <QSpinBox>
class KComboBox;
class QalculateSettings : public QObject
{
Q_OBJECT

View file

@ -124,7 +124,7 @@ ConverterRunner::ConverterRunner(QObject* parent, const QVariantList &args)
setObjectName(QLatin1String( "Converter" ));
m_separators << QString( CONVERSION_CHAR );
m_separators << i18nc("list of words that can used as amount of 'unit1' [in|to|as] 'unit2'",
m_separators << i18nc("list of words that can be used as amount of 'unit1' [in|to|as] 'unit2'",
"in;to;as").split(QLatin1Char( ';' ));
//can not ignore commands: we have things like m4