mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Sorting timers in the 'Timers' menu
This commit is contained in:
18
tools.c
18
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user