mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed handling multiple 'CaCaps' entries in 'setup.conf'
This commit is contained in:
parent
5e9d7e3c93
commit
16f3d3fc5d
1
HISTORY
1
HISTORY
@ -1618,3 +1618,4 @@ Video Disk Recorder Revision History
|
|||||||
- Updated Finnish OSD texts (thanks to Jaakko Hyvätti).
|
- Updated Finnish OSD texts (thanks to Jaakko Hyvätti).
|
||||||
- Fixed a small glitch when switching channels (thanks to Dennis Noordsij for
|
- Fixed a small glitch when switching channels (thanks to Dennis Noordsij for
|
||||||
reporting this one).
|
reporting this one).
|
||||||
|
- Fixed handling multiple 'CaCaps' entries in 'setup.conf'.
|
||||||
|
11
config.c
11
config.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: config.c 1.109 2002/10/13 10:03:49 kls Exp $
|
* $Id: config.c 1.110 2002/10/19 11:34:01 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -680,11 +680,11 @@ cSetupLine *cSetup::Get(const char *Name, const char *Plugin)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSetup::Store(const char *Name, const char *Value, const char *Plugin)
|
void cSetup::Store(const char *Name, const char *Value, const char *Plugin, bool AllowMultiple)
|
||||||
{
|
{
|
||||||
if (Name && *Name) {
|
if (Name && *Name) {
|
||||||
cSetupLine *l = Get(Name, Plugin);
|
cSetupLine *l = Get(Name, Plugin);
|
||||||
if (l)
|
if (l && !AllowMultiple)
|
||||||
Del(l);
|
Del(l);
|
||||||
if (Value)
|
if (Value)
|
||||||
Add(new cSetupLine(Name, Value, Plugin));
|
Add(new cSetupLine(Name, Value, Plugin));
|
||||||
@ -726,6 +726,9 @@ bool cSetup::Load(const char *FileName)
|
|||||||
|
|
||||||
void cSetup::StoreCaCaps(const char *Name)
|
void cSetup::StoreCaCaps(const char *Name)
|
||||||
{
|
{
|
||||||
|
cSetupLine *l;
|
||||||
|
while ((l = Get(Name)) != NULL)
|
||||||
|
Del(l);
|
||||||
for (int d = 0; d < MAXDEVICES; d++) {
|
for (int d = 0; d < MAXDEVICES; d++) {
|
||||||
char buffer[MAXPARSEBUFFER];
|
char buffer[MAXPARSEBUFFER];
|
||||||
char *q = buffer;
|
char *q = buffer;
|
||||||
@ -738,7 +741,7 @@ void cSetup::StoreCaCaps(const char *Name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (*buffer)
|
if (*buffer)
|
||||||
Store(Name, buffer);
|
Store(Name, buffer, NULL, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
config.h
4
config.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: config.h 1.135 2002/10/13 16:12:55 kls Exp $
|
* $Id: config.h 1.136 2002/10/19 11:29:46 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CONFIG_H
|
#ifndef __CONFIG_H
|
||||||
@ -252,7 +252,7 @@ private:
|
|||||||
bool ParseCaCaps(const char *Value);
|
bool ParseCaCaps(const char *Value);
|
||||||
bool Parse(const char *Name, const char *Value);
|
bool Parse(const char *Name, const char *Value);
|
||||||
cSetupLine *Get(const char *Name, const char *Plugin = NULL);
|
cSetupLine *Get(const char *Name, const char *Plugin = NULL);
|
||||||
void Store(const char *Name, const char *Value, const char *Plugin = NULL);
|
void Store(const char *Name, const char *Value, const char *Plugin = NULL, bool AllowMultiple = false);
|
||||||
void Store(const char *Name, int Value, const char *Plugin = NULL);
|
void Store(const char *Name, int Value, const char *Plugin = NULL);
|
||||||
public:
|
public:
|
||||||
// Also adjust cMenuSetup (menu.c) when adding parameters here!
|
// Also adjust cMenuSetup (menu.c) when adding parameters here!
|
||||||
|
Loading…
Reference in New Issue
Block a user