summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-08-26 14:17:20 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-08-26 14:17:20 +0200
commit6f6891082885d6c68f1a7efd80f99a0c907a9a4b (patch)
tree0d1bab65caa4e601bd5c5569452d83ba80b2dedb /tools.c
parent7092907ccd846090da89cedf0cca216ff38c6205 (diff)
downloadvdr-6f6891082885d6c68f1a7efd80f99a0c907a9a4b.tar.gz
vdr-6f6891082885d6c68f1a7efd80f99a0c907a9a4b.tar.bz2
Sorting timers in the 'Timers' menu
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 1045a0a2..8ae2c9d3 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.41 2001/08/25 13:21:22 kls Exp $
+ * $Id: tools.c 1.42 2001/08/26 13:11:17 kls Exp $
*/
#define _GNU_SOURCE
@@ -692,3 +692,19 @@ int cListBase::Count(void) const
return n;
}
+void cListBase::Sort(void)
+{
+ bool swapped;
+ do {
+ swapped = false;
+ cListObject *object = objects;
+ while (object) {
+ if (object->Next() && *object->Next() < *object) {
+ Move(object->Next(), object);
+ swapped = true;
+ }
+ object = object->Next();
+ }
+ } while (swapped);
+}
+