]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
idnode prop: allow sorting via key value on enum's
authorAdam Sutton <dev@adamsutton.me.uk>
Thu, 5 Jun 2014 21:18:07 +0000 (22:18 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Mon, 9 Jun 2014 21:08:39 +0000 (22:08 +0100)
src/idnode.c
src/prop.h

index 00ff1c5cb8d979e15c633598eefb65e0f329d214..907b5f6c3ee71bf6f7ab325465eab74adde309f1 100644 (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);
index cd31f7ea131805591b20fcd83cdb37e2f67c9752..462b47037f8b00b4454a2fa81b90696ff1b75863 100644 (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