diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-31 13:01:35 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-31 13:01:35 +0100 |
commit | bd62ca6abc61827dd75962e952783acf83565949 (patch) | |
tree | 017e3e4475cfbd81674e0ae03d70de33d1ce2a5c /channels.c | |
parent | fd9c2d298c0a8fb8e005b46a728841759b126430 (diff) | |
download | vdr-bd62ca6abc61827dd75962e952783acf83565949.tar.gz vdr-bd62ca6abc61827dd75962e952783acf83565949.tar.bz2 |
Added the 'portal name' to cChannels
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.c 1.29 2004/10/31 12:52:50 kls Exp $ + * $Id: channels.c 1.30 2004/10/31 12:54:06 kls Exp $ */ #include "channels.h" @@ -169,6 +169,7 @@ cChannel::cChannel(void) name = strdup(""); shortName = strdup(""); provider = strdup(""); + portalName = strdup(""); memset(&__BeginData__, 0, (char *)&__EndData__ - (char *)&__BeginData__); inversion = INVERSION_AUTO; bandwidth = BANDWIDTH_AUTO; @@ -188,6 +189,7 @@ cChannel::cChannel(const cChannel &Channel) name = strdup(""); shortName = strdup(""); provider = strdup(""); + portalName = strdup(""); *this = Channel; vpid = 0; ppid = 0; @@ -227,6 +229,7 @@ cChannel::~cChannel() free(name); free(shortName); free(provider); + free(portalName); } cChannel& cChannel::operator= (const cChannel &Channel) @@ -234,6 +237,7 @@ cChannel& cChannel::operator= (const cChannel &Channel) name = strcpyrealloc(name, Channel.name); shortName = strcpyrealloc(shortName, Channel.shortName); provider = strcpyrealloc(provider, Channel.provider); + portalName = strcpyrealloc(portalName, Channel.portalName); memcpy(&__BeginData__, &Channel.__BeginData__, (char *)&Channel.__EndData__ - (char *)&Channel.__BeginData__); return *this; } @@ -366,6 +370,18 @@ void cChannel::SetName(const char *Name, const char *ShortName, const char *Prov } } +void cChannel::SetPortalName(const char *PortalName) +{ + if (!isempty(PortalName) && strcmp(portalName, PortalName) != 0) { + if (Number()) { + dsyslog("changing portal name of channel %d from '%s' to '%s'", Number(), portalName, PortalName); + modification |= CHANNELMOD_NAME; + Channels.SetModified(); + } + portalName = strcpyrealloc(portalName, PortalName); + } +} + static bool IntArraysDiffer(const int *a, const int *b, const char na[][4] = NULL, const char nb[][4] = NULL) { int i = 0; |