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 | |
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
-rw-r--r-- | CONTRIBUTORS | 2 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | menuitems.c | 12 | ||||
-rw-r--r-- | menuitems.h | 3 |
4 files changed, 16 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 19482e0f..42a76a92 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1245,6 +1245,8 @@ Marco Schlüßler <marco@lordzodiac.de> for reporting that the FATALERRNO macro needs to check for a non-zero errno value for reporting missing mutex locks in cCiMenu::Abort() and cCiEnquiry::Abort() for fixing a race condition in the SPU decoder + for fixing initializing the day index when editing the weekday parameter of a + repeating timer Jürgen Schmitz <j.schmitz@web.de> for reporting a bug in displaying the current channel when switching via the SVDRP @@ -3943,3 +3943,5 @@ Video Disk Recorder Revision History 2005-11-11: Version 1.3.37 - Added compiler options "-fPIC -g" to all plugins (thanks to Rolf Ahrenberg). +- Fixed initializing the day index when editing the weekday parameter of a + repeating timer (thanks to Marco Schlüßler). 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 diff --git a/menuitems.h b/menuitems.h index b45fc960..f9afc151 100644 --- a/menuitems.h +++ b/menuitems.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menuitems.h 1.11 2005/03/19 15:02:57 kls Exp $ + * $Id: menuitems.h 1.12 2005/11/11 13:26:51 kls Exp $ */ #ifndef __MENUITEMS_H @@ -125,6 +125,7 @@ private: int *weekdays; time_t oldvalue; int dayindex; + int FindDayIndex(int WeekDays); virtual void Set(void); public: cMenuEditDateItem(const char *Name, time_t *Value, int *WeekDays = NULL); |