Summary: | sort variables list alphabetically | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Rob L <robert.leathley> |
Component: | CPP Debugger | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | daviddoria, kbugger, niko.sams, peje66, piotr.mierzwinski, rishabh9511, savoiu |
Priority: | NOR | ||
Version: | 3.3.0 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kdevplatform/fa0d28c15edd81f1613483607d677f9aca2b820c | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: |
view of variables list
comparision between kdevelop 4.7 & 4.90.90 |
Description
Rob L
2006-01-11 16:51:36 UTC
Please can we have CONFIRMED and a resolution here. This tool is basically very good but this defect alone increases the time needed to scan a variable value by at least a factor of ten. I may well be better using printf and scanning the console output , this feature is so close but sadly near useless as it is. Open Source Developers work on things they want to work on. As far as KDevelop Developers are concerned: We don't work on KDevelop3 anymore, except for important bugfixes. So you have to wait til KDevelop4 to see this. OK, this bug is rather old but at least if you're agreed this would be an improvement I'm sure there are more pressing issues , although this would probably be about NO.1 usability flaw for my usage. I guess we'll have to be patient. Thanks for the quick response. Sort by the order in code also makes sense. IMHO if you look for a specfic variable you add a watch. Opinions on this? could you explain in what way "sort by order in code" is useful? Unless I have photographic recall of all the relevant source, I don't see how this is much help. saying you would use a different tool is irrelevant. assuming that the variable list has a use (part of which is to display current value) it should be organised in a way that make the information accessible. The current format is a bit like a telephone directory that lists people in the order that they took out the subscription. Assuming your variables are defined in the smallest possible scope, then those of interest may be near the bottom of the list. For those that aren't they can be very hard to find, particularly if it is unfamiliar code you are working on. Generally there are too many variables of interest to make watches practical. You would have to build your own list in alphabetical order. Tool tip values in the code editor would be an alternative, in which case I would rarely use the variables tree. But if the tree is to exist, it should be as usable as possible - a user preference can't be that hard to code? (In reply to comment #6) > Assuming your variables are defined in the smallest possible scope, then those > of interest may be near the bottom of the list. For those that aren't they can > be very hard to find, particularly if it is unfamiliar code you are working on. Well, in properly structured code there's not that many variables inside a function or on the global stack. Anyway, I agree a sorting option would be useful, however... > Generally there are too many variables of interest to make watches practical. > You would have to build your own list in alphabetical order. Tool tip values > in the code editor would be an alternative, That works in KDevelop4. > in which case I would rarely use > the variables tree. But if the tree is to exist, it should be as usable as > possible - a user preference can't be that hard to code? You'd be surprised how hard it can be. While Qt4 MVC does make some things easier, some other things are getting a bit harder, in particular adding sort/filtering (or rather need more amount of code and possibly adjustments at a few places). ok, so this will be most useful to those who have to work with code that isn't properly structured. I look forward to getting SLES11 and kdev 4 installed. QSortFilterProxyModel? (In reply to comment #8) > ok, so this will be most useful to those who have to work with code that isn't > properly structured. That part was actually meant as a joke, I just forgot the ;) > QSortFilterProxyModel? Yes, but doing that means adjusting all places that use the view's model or the selection model as you have to convert all the item indices... *** Bug 304819 has been marked as a duplicate of this bug. *** Can i take this ?doesn't seem that it requires much work Created attachment 94659 [details]
view of variables list
if i have understood correctly ,then the variables (please refer to the image) on the left side should be sorted in alphabetical order ?
Git commit fa956301ecf0de5dc533f1c90cf21372476297c8 by Milian Wolff, on behalf of rishabh gupta. Committed on 09/11/2015 at 15:10. Pushed by mwolff into branch '5.0'. Sort variables alphabetically in debugger variables view. REVIEW: 125549 M +3 -0 debugger/util/treemodel.cpp M +4 -0 debugger/util/treemodel.h M +7 -6 debugger/util/treeview.cpp M +5 -1 debugger/util/treeview.h M +6 -1 debugger/variable/variabletooltip.cpp M +2 -0 debugger/variable/variabletooltip.h M +15 -5 debugger/variable/variablewidget.cpp M +6 -3 debugger/variable/variablewidget.h http://commits.kde.org/kdevplatform/fa956301ecf0de5dc533f1c90cf21372476297c8 Created attachment 95614 [details]
comparision between kdevelop 4.7 & 4.90.90
The sorting of variables when debugging is good but with one bad side effect.
When expanding a vector with more than 10 elements the order becomes:
0, 1, 10, 11, 2, 3, 4, 5, 6, 7, 8, 9
It becomes very hard to follow for example a vector fill.
See attached comparision between kdevelop 4.7 and 5.0
The same happen when we unfold QStringList contains more than 10 items. I aware that QStringList is vector variation contains strings instead of numbers. It was only next example. This issue probably happens because there are sorting strings (presenting indexes) and not numbers. Some solution for this could be adding 0 to the left side of indexes, making that them length (as string) would be equal. I mean left padding every indexes shortest than one longest (counting number of digits). I think, example will show the best what I mean. There is QStringList contains 12 strings. This vector/list would be presented in Variable view like this. myStrList |-[00] aa |-[01] bb |-[02] cc |-[03] dd |-[04] ee |-[05] ff |-[06] gg |-[07] hh |-[08] ii |-[09] jj |-[10] kk \-[11] ll Thanks leading "0", change of sorting would not broke the order of items. needs to be fixed, I agree. it should use natural sorting. Git commit fa0d28c15edd81f1613483607d677f9aca2b820c by Kevin Funk, on behalf of Mikhail Ivchenko. Committed on 10/01/2016 at 20:32. Pushed by kfunk into branch '5.0'. [GCI] Use natural sorting in variable list Test Plan: Tests passed and works as expected. Reviewers: kfunk Reviewed By: kfunk Subscribers: kdevelop-devel, #kdevelop Projects: #kdevelop Differential Revision: https://phabricator.kde.org/D777 M +1 -0 debugger/CMakeLists.txt A +46 -0 debugger/variable/variablesortmodel.cpp [License: GPL (v2+)] A +45 -0 debugger/variable/variablesortmodel.h [License: GPL (v2+)] M +2 -1 debugger/variable/variablewidget.cpp http://commits.kde.org/kdevplatform/fa0d28c15edd81f1613483607d677f9aca2b820c *** Bug 355852 has been marked as a duplicate of this bug. *** |