From: Adam Sutton Date: Thu, 5 Jun 2014 21:18:07 +0000 (+0100) Subject: idnode prop: allow sorting via key value on enum's X-Git-Tag: v4.1~1995 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88a2eefe2c800aba9a297fab24abe742ecb2edbd;p=thirdparty%2Ftvheadend.git idnode prop: allow sorting via key value on enum's --- diff --git a/src/idnode.c b/src/idnode.c index 00ff1c5cb..907b5f6c3 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 cd31f7ea1..462b47037 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