Wednesday, October 08, 2008

dear KDE3 KDesktop users:

I'm looking for someone with a built-from-source KDE 3 around to test this patch to kdebase/kdesktop/minicli.cpp:

- QString Minicli::calculate(const QString &exp)
+ QString Minicli::calculate(const QString &input)
{
QString result, cmd;
+ QString exp = input;
+ //replace commas with dots so european decimals can be calculated
+ exp.replace(QChar(','), ".");

If someone out there could apply it and confirm that it indeed works (symptoms of success would include "100,3*4" coming out as 101.2 401.2), that will make one Pascal d'Hermilly, some guy in Finland and other European-style-command-is-a-decimal-point sorts still using KDE3 happy.

As I don't have a KDE3 codebase kicking around, it's a little inconvenient for me to test this. Any takers? =)

14 comments:

NamShub said...

This is offtopic but you know there are millions of people in your own country that also use the comma as a decimal point? :)

Jason Stubbs said...

(symptoms of success would include "100,3*4" coming out as 101.2)

Make that 401.2. ;)

Aaron J. Seigo said...

doh! =)

Lisandro Damián Nicanor Pérez Meyer said...

I'm trying to do it but in a VirtualBox environment, so it will take me some time.
If anyone is willing to test it with as a redundancy test / with a better setup, I would really appreciate it :-)

Lisandro Damián Nicanor Pérez Meyer said...

Hmm, It's failing [0]. I will give it a try tomorrow.


[0] http://paste.debian.net/18740/

richmoore said...

Should this be getting the decimal point character from the locale? Something like:

lconv *localeInfo = localeconv();

then using localeInfo->decimal_point?

Kevin Kofler said...

version which can actually be applied
I'm running this through Koji (the Fedora build system) now, I'll test as soon as it's built.

richmoore said...

Actually even better would be to use KLocale::decimalSeparator()

Kevin Kofler said...

As far as I can tell, the goal here is to be flexible and just accept both. The minicli calculator doesn't support thousands separators anyway, so there's no confusion possible. Or is your suggestion to remove the thousands separators automatically too?

Kevin Kofler said...

For any Fedora 8 users wanting to test: Koji build (i386 and x86_64 already completed). I'm testing it now.

I don't think I'll push this out as an official update though, unless there's some more stuff in kdebase needing an update anyway.

Kevin Kofler said...

I can confirm that the patch works.

Hint: to test it, you have to run this in minicli first:
killall kdesktop ; sleep 2; kdesktop
(i.e. kdesktop has to be reloaded for the changes to take effect.)

Stev said...

But shouldn't the result be given in the komma notation, as well? :-)

maninalift said...

Totally the wrong place, but I came across this quote from Steve Grand and thought the plasma team might want to write in on their shields... er... keyboards.

"The trouble with the British these days is that they want innovation, but they don't want to change anything to get it."

More good qoutes from him here.

Clas Rurik said...

Tested using Gentoo Linux and works here.