idnode prop: allow sorting via key value on enum's

This commit is contained in:
Adam Sutton 2014-06-05 22:18:07 +01:00
parent 248b682c84
commit 88a2eefe2c
2 changed files with 2 additions and 1 deletions

View file

@ -440,7 +440,7 @@ idnode_cmp_sort
if (!p) return 0;
/* Get display string */
if (p->islist || p->list) {
if (p->islist || (p->list && !(p->opts & PO_SORTKEY))) {
int r;
char *stra = idnode_get_display(ina, p);
char *strb = idnode_get_display(inb, p);

View file

@ -47,6 +47,7 @@ typedef enum {
#define PO_ADVANCED 0x08 // Property is advanced
#define PO_HIDDEN 0x10 // Property is hidden (by default)
#define PO_USERAW 0x20 // Only save the RAW (off) value if it exists
#define PO_SORTKEY 0x40 // Sort using key (not display value)
/*
* Property definition