From 88a2eefe2c800aba9a297fab24abe742ecb2edbd Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Thu, 5 Jun 2014 22:18:07 +0100 Subject: [PATCH] idnode prop: allow sorting via key value on enum's --- src/idnode.c | 2 +- src/prop.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/idnode.c b/src/idnode.c index 00ff1c5c..907b5f6c 100644 --- a/src/idnode.c +++ b/src/idnode.c @@ -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); diff --git a/src/prop.h b/src/prop.h index cd31f7ea..462b4703 100644 --- a/src/prop.h +++ b/src/prop.h @@ -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