Bug 132579 - Ordering by VmRss doesn't order by numeric value
Summary: Ordering by VmRss doesn't order by numeric value
Status: RESOLVED FIXED
Alias: None
Product: ksysguard
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-18 01:08 UTC by Miguel Angel Lopez
Modified: 2006-11-29 03:56 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miguel Angel Lopez 2006-08-18 01:08:00 UTC
Version:           1.2.0 (using KDE 3.5.3, Debian Package 4:3.5.3-1 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.16-2-k7

When ordering by VmRss the numbers are treated like strings, leading to something like "10, 14, 1234, 20, 220, 31".
Comment 1 Miguel Angel Lopez 2006-08-18 01:17:47 UTC
Sorry. Numbers aren't treated like strings. It's a wrong order by not using locale to know which is the decimal and the thousands separators.
Comment 2 John Tapsell 2006-11-29 03:51:41 UTC
I cannot replicate this bug.

When I order by VmRss, it works fine.  The code for kde3.5 is:

int prev = (int)KGlobal::locale()->readNumber( key( col, ascending ) );
int next = (int)KGlobal::locale()->readNumber( item->key( col, ascending ) );

...

Why would that not be working?
Comment 3 John Tapsell 2006-11-29 03:56:04 UTC
SVN commit 608993 by johnflux:

Fix a small bug with reading in the number.  D means a localised int, not a double.
BUG:132579


 M  +1 -1      ProcessList.cc  


--- branches/KDE/3.5/kdebase/ksysguard/gui/SensorDisplayLib/ProcessList.cc #608992:608993
@@ -663,7 +663,7 @@
 		else if ( mColumnTypes[col] == "f" )
       pli->setText( col, KGlobal::locale()->formatNumber( (*p)[col].toFloat() ) );
     else if ( mColumnTypes[col] == "D" )
-      pli->setText( col, KGlobal::locale()->formatNumber( (*p)[col].toDouble(), 0 ) );
+      pli->setText( col, KGlobal::locale()->formatNumber( (*p)[col].toInt(), 0 ) );
     else
 			pli->setText(col, (*p)[col]);
 	}