diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-11-11 13:31:02 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-11-11 13:31:02 +0100 |
commit | 13e925c3f49bc29514064ce52e3fa0ba0ca6c8ab (patch) | |
tree | a5c5ebc3dcf5c109399ab82c5a049f9612062449 /menuitems.c | |
parent | a311ea003eff2ef4646efe14e705af6f5d6f5992 (diff) | |
download | vdr-13e925c3f49bc29514064ce52e3fa0ba0ca6c8ab.tar.gz vdr-13e925c3f49bc29514064ce52e3fa0ba0ca6c8ab.tar.bz2 |
Fixed initializing the day index when editing the weekday parameter of a repeating timer
Diffstat (limited to 'menuitems.c')
-rw-r--r-- | menuitems.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/menuitems.c b/menuitems.c index 1f2cc14a..01fd6b3b 100644 --- a/menuitems.c +++ b/menuitems.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menuitems.c 1.23 2005/09/17 09:36:31 kls Exp $ + * $Id: menuitems.c 1.24 2005/11/11 13:26:00 kls Exp $ */ #include "menuitems.h" @@ -578,10 +578,18 @@ cMenuEditDateItem::cMenuEditDateItem(const char *Name, time_t *Value, int *WeekD value = Value; weekdays = WeekDays; oldvalue = 0; - dayindex = 0; + dayindex = weekdays ? FindDayIndex(*weekdays) : 0; Set(); } +int cMenuEditDateItem::FindDayIndex(int WeekDays) +{ + for (unsigned int i = 0; i < sizeof(days) / sizeof(int); i++) + if (WeekDays == days[i]) + return i; + return 0; +} + void cMenuEditDateItem::Set(void) { #define DATEBUFFERSIZE 32 |