Bug 131716

Summary: Line numbers should be sorted numerically instead of lexographically.
Product: kdevelop Reporter: Paul Fee <paul.f.fee>
Component: Problem reporterAssignee: kdevelop-bugs-null
Severity: normal    
Priority: NOR    
Version: 3.3.3   
Target Milestone: ---   
Platform: RedHat RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Bookmarks with example of line number sorting.

Description Paul Fee 2006-08-02 11:29:11 UTC
Version:           3.3.3 (using KDE KDE 3.5.3)
Installed from:    RedHat RPMs
OS:                Linux

Various toolviews contain lists which are sorted by line number.  However the sorting is string based instead of numeric.

For example, the follow sorting can occur:

These are sorted as strings, however the desired sort is:

Affected areas of KDevelop include:
Bookmarks and Problems(Current, Errors, Fixme, Todo).

I expect the solution is to convert from a string to an integer before sorting.  Also, if the line numbers are stored as strings, then changing the storage to integers would also save some memory.

I hope that's enough information, let me know if not.

I'm using a KDevelop RPM from:

Comment 1 Jens Dagerbo 2006-08-02 13:44:30 UTC
The Bookmarks view does this? I don't understand how.. the bookmarks are inserted in order, auto sorting is off, and the header is disabled.

Can you attach a screenshot of this?
Comment 2 Jens Dagerbo 2006-08-03 01:47:56 UTC
Can't reproduce for the Bookmarks view, but Problems view displays this behaviour.
Comment 3 Paul Fee 2006-08-05 01:00:36 UTC
Created attachment 17233 [details]
Bookmarks with example of line number sorting.

From comment #1, it sounds like there are ways to configure the way that
bookmarks are ordered.	Is this correct or are you commenting on the
implementation within the source code?

Anyway, I've attached a screenshot of the bookmarks.  This was with Kubuntu
6.06 and KDevelop 3.3.4.

The sample source file has 15 lines and I've added bookmarks in the following
order:	4, 8, 12, 14, 10, 6, 2

You can see in the screen shot that the bookmarks toolview has ordered the line
numbers lexicographically, the result being: 10, 12, 14, 2, 4, 6, 8.

The desired numeric sort would give: 2, 4, 6, 8, 10, 12, 14.

I can not affect the order of the bookmarks by the order I create them.  The
bookmarks are always sorted (incorrectly) for me.

Comment 4 Jens Dagerbo 2006-12-29 10:54:10 UTC
SVN commit 617453 by dagerbo:

This patch does a few related things:
#removes a lot of unused and weird stuff from problemreporter
#all parser activation decisions are moved back into cppsupport where it belongs, problemreporter is just UI
#fixes flickering problem tabs
#fixes a case where  already open documents don't get a problem icon marker
#fixes sorting so it happens numerically, no lexographically
#afaik fixes repeated entries. if this still happens, I don't think problem reporter is responsible
#afaik fixes the remaining cases where the parser could be invoked against non-c/c++ files

BUG: 111341
BUG: 117621
BUG: 131716
BUG: 135958

 M  +53 -14    cppsupportpart.cpp  
 M  +9 -4      cppsupportpart.h  
 M  +44 -144   problemreporter.cpp  
 M  +7 -16     problemreporter.h