Debugger: Move struct sorting logic to generic parser

Backends only have to specify whether an object members are sortable
in principle (e.g. all structs), and some numeric 'sortgroup' value
for member items (higher values are always sorted on top).

Change-Id: I10ce94580374fed48a35f058a575a1408d6801af
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-04-05 11:14:40 +02:00
parent 58c326cb73
commit e9b1e493c2
9 changed files with 37 additions and 27 deletions

View File

@@ -45,7 +45,7 @@ class WatchItem : public Utils::TreeItem
public:
WatchItem();
void parse(const GdbMi &input);
void parse(const GdbMi &input, bool maySort);
bool isLocal() const;
bool isWatcher() const;
@@ -117,13 +117,14 @@ public:
uint bitsize; // Size in case of bit fields
int elided; // Full size if value was cut off, -1 if cut on unknown size, 0 otherwise
int arrayIndex; // -1 if not an array member
uchar sortGroup; // 0 - ordinary member, 1 - vptr, 2 - base class
bool wantsChildren;
bool valueEnabled; // Value will be enabled or not
bool valueEditable; // Value will be editable
bool outdated; // \internal item is to be removed.
private:
void parseHelper(const GdbMi &input);
void parseHelper(const GdbMi &input, bool maySort);
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::WatchHandler)
};