[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/generic/runners/calculator
From: Matteo Agostinelli <agostinelli () gmail ! com>
Date: 2011-01-05 13:17:34
Message-ID: 20110105131734.8EB8FAC8B0 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1212011 by agostinelli:
Fixed initialization from char
M +5 -5 calculatorrunner.cpp
M +1 -1 qalculate_engine.cpp
--- trunk/KDE/kdebase/workspace/plasma/generic/runners/calculator/calculatorrunner.cpp \
#1212010:1212011 @@ -175,7 +175,7 @@
void CalculatorRunner::userFriendlySubstitutions(QString& cmd)
{
if (cmd.contains(KGlobal::locale()->decimalSymbol(), Qt::CaseInsensitive)) {
- cmd=cmd.replace(KGlobal::locale()->decimalSymbol(), ".", \
Qt::CaseInsensitive); + cmd=cmd.replace(KGlobal::locale()->decimalSymbol(), \
QChar('.'), Qt::CaseInsensitive); }
// the following substitutions are not needed with libqalculate
@@ -202,7 +202,7 @@
QString cmd = term;
//no meanless space between friendly guys: helps simplify code
- cmd = cmd.trimmed().replace(' ', "");
+ cmd = cmd.trimmed().remove(' ');
if (cmd.length() < 4) {
return;
@@ -217,7 +217,7 @@
return;
}
- bool toHex = cmd.startsWith("hex=");
+ bool toHex = cmd.startsWith(QLatin1String("hex="));
bool startsWithEquals = !toHex && cmd[0] == '=';
if (toHex || startsWithEquals) {
@@ -266,7 +266,7 @@
kDebug() << "qalculate error: " << e.what();
}
- return result.replace(".", KGlobal::locale()->decimalSymbol(), \
Qt::CaseInsensitive); + return result.replace('.', \
KGlobal::locale()->decimalSymbol(), Qt::CaseInsensitive); #else
//kDebug() << "calculating" << term;
QScriptEngine eng;
@@ -291,7 +291,7 @@
var order=Math.pow(10,exponent);\
(order > 0? \
Math.round(result*order)/order : 0)").toString();
- roundedResultString.replace(".", KGlobal::locale()->decimalSymbol(), \
Qt::CaseInsensitive); + roundedResultString.replace('.', \
KGlobal::locale()->decimalSymbol(), Qt::CaseInsensitive);
return roundedResultString;
#endif
--- trunk/KDE/kdebase/workspace/plasma/generic/runners/calculator/qalculate_engine.cpp \
#1212010:1212011 @@ -84,7 +84,7 @@
}
QString input = expression;
- QByteArray ba = input.replace(QChar(0xA3), "GBP").replace(QChar(0xA5), \
"JPY").replace("$", "USD").replace(QChar(0x20AC), "EUR").toLatin1(); + QByteArray \
ba = input.replace(QChar(0xA3), "GBP").replace(QChar(0xA5), "JPY").replace('$', \
"USD").replace(QChar(0x20AC), "EUR").toLatin1(); const char *ctext = ba.data();
CALCULATOR->terminateThreads();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic