summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-10-19 11:34:48 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-10-19 11:34:48 +0200
commit16f3d3fc5d2f883241147db6ed9622a58f73b7c0 (patch)
tree6beebcfc5725d37b9b767568ee39d02ae7854518
parent5e9d7e3c93082cf310efe6074653aaee34f0fe4f (diff)
downloadvdr-16f3d3fc5d2f883241147db6ed9622a58f73b7c0.tar.gz
vdr-16f3d3fc5d2f883241147db6ed9622a58f73b7c0.tar.bz2
Fixed handling multiple 'CaCaps' entries in 'setup.conf'
-rw-r--r--HISTORY1
-rw-r--r--config.c11
-rw-r--r--config.h4
3 files changed, 10 insertions, 6 deletions
diff --git a/HISTORY b/HISTORY
index e3a25aa2..e55ff53b 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1618,3 +1618,4 @@ Video Disk Recorder Revision History
- Updated Finnish OSD texts (thanks to Jaakko Hyvätti).
- Fixed a small glitch when switching channels (thanks to Dennis Noordsij for
reporting this one).
+- Fixed handling multiple 'CaCaps' entries in 'setup.conf'.
diff --git a/config.c b/config.c
index d9cdb43c..f4ef7b86 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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"
@@ -680,11 +680,11 @@ cSetupLine *cSetup::Get(const char *Name, const char *Plugin)
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) {
cSetupLine *l = Get(Name, Plugin);
- if (l)
+ if (l && !AllowMultiple)
Del(l);
if (Value)
Add(new cSetupLine(Name, Value, Plugin));
@@ -726,6 +726,9 @@ bool cSetup::Load(const char *FileName)
void cSetup::StoreCaCaps(const char *Name)
{
+ cSetupLine *l;
+ while ((l = Get(Name)) != NULL)
+ Del(l);
for (int d = 0; d < MAXDEVICES; d++) {
char buffer[MAXPARSEBUFFER];
char *q = buffer;
@@ -738,7 +741,7 @@ void cSetup::StoreCaCaps(const char *Name)
}
}
if (*buffer)
- Store(Name, buffer);
+ Store(Name, buffer, NULL, true);
}
}
diff --git a/config.h b/config.h
index 133b7390..a2223d6b 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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
@@ -252,7 +252,7 @@ private:
bool ParseCaCaps(const char *Value);
bool Parse(const char *Name, const char *Value);
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);
public:
// Also adjust cMenuSetup (menu.c) when adding parameters here!