diff options
Diffstat (limited to 'kommander/widget')
-rw-r--r-- | kommander/widget/functionlib.cpp | 14 | ||||
-rw-r--r-- | kommander/widget/kommanderfunctions.cpp | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/kommander/widget/functionlib.cpp b/kommander/widget/functionlib.cpp index c85303ae..bf08888a 100644 --- a/kommander/widget/functionlib.cpp +++ b/kommander/widget/functionlib.cpp @@ -164,7 +164,7 @@ static ParseNode f_return(Parser* p, const ParameterList& params) static ParseNode f_stringRound(Parser*, const ParameterList& params) { TQString s; - s.sprintf("%."+params[1].toString()+"f", params[0].toDouble()); + s.sprintf("%.*f", params[1].toInt(), params[0].toDouble()); return s; } @@ -172,7 +172,7 @@ static ParseNode f_stringRound(Parser*, const ParameterList& params) static ParseNode f_debug(Parser*, const ParameterList& params) { for (uint i=0; i<params.count(); i++) - std::cerr << params[i].toString(); + std::cerr << params[i].toString().local8Bit(); std::cerr << "\n"; fflush(stderr); return ParseNode(); @@ -181,7 +181,7 @@ static ParseNode f_debug(Parser*, const ParameterList& params) static ParseNode f_echo(Parser*, const ParameterList& params) { for (uint i=0; i<params.count(); i++) - std::cout << params[i].toString(); + std::cout << params[i].toString().local8Bit(); fflush(stdout); return ParseNode(); } @@ -510,7 +510,7 @@ static ParseNode f_dialog(Parser* P, const ParameterList& params) static ParseNode f_i18n(Parser*, const ParameterList& params) { - return TDEGlobal::locale()->translate(params[0].toString()); + return TDEGlobal::locale()->translate(params[0].toString().utf8()); } static ParseNode f_env(Parser*, const ParameterList& params) @@ -567,13 +567,11 @@ static ParseNode f_arrayToString(Parser* P, const ParameterList& params) TQStringList keys = P->array(name).keys(); TQValueList<ParseNode> values = P->array(name).values(); - TQStringList::Iterator it = keys.begin(); + TQStringList::Iterator it = keys.begin(); TQValueList<ParseNode>::Iterator itval = values.begin(); - while (*it) + for (; it != keys.end(); ++it, ++itval) { array += TQString("%1\t%2\n").arg(*it).arg((*itval).toString()); - ++it; - ++itval; } return array; } diff --git a/kommander/widget/kommanderfunctions.cpp b/kommander/widget/kommanderfunctions.cpp index 3d580f88..59aaec07 100644 --- a/kommander/widget/kommanderfunctions.cpp +++ b/kommander/widget/kommanderfunctions.cpp @@ -57,7 +57,7 @@ TQString KommanderWidget::evalFunction(const TQString& function, const TQStringL case Kommander::env: return TQString(getenv(args[0].latin1())); case Kommander::i18n: - return TDEGlobal::locale()->translate(args[0]); + return TDEGlobal::locale()->translate(args[0].utf8()); case Kommander::global: return global(args[0]); case Kommander::setGlobal: |