Fixed initializing the day index when editing the weekday parameter of a repeating timer

This commit is contained in:
Klaus Schmidinger 2005-11-11 13:31:02 +01:00
parent a311ea003e
commit 13e925c3f4
4 changed files with 16 additions and 3 deletions

View File

@ -1245,6 +1245,8 @@ Marco Schl
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

View File

@ -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).

View File

@ -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

View File

@ -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);