summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-06-10 15:34:23 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2017-06-10 15:34:23 +0200
commitdeb96b372eabf2bc641c05e6beb20671d1047cc6 (patch)
tree75bd31a5c589afe4f4e04cb6be7c392e48ad379d /channels.c
parent360d8fe6b1faeea134f7a18d45ebbe69fd685be6 (diff)
downloadvdr-deb96b372eabf2bc641c05e6beb20671d1047cc6.tar.gz
vdr-deb96b372eabf2bc641c05e6beb20671d1047cc6.tar.bz2
The option "Setup/Miscellaneous/Show channel names with source" can now be set to "type" or "full"
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/channels.c b/channels.c
index 1b9aa86f..2716b595 100644
--- a/channels.c
+++ b/channels.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: channels.c 4.4 2017/05/26 15:43:54 kls Exp $
+ * $Id: channels.c 4.5 2017/06/10 15:08:56 kls Exp $
*/
#include "channels.h"
@@ -98,6 +98,7 @@ cChannel& cChannel::operator= (const cChannel &Channel)
portalName = strcpyrealloc(portalName, Channel.portalName);
memcpy(&__BeginData__, &Channel.__BeginData__, (char *)&Channel.__EndData__ - (char *)&Channel.__BeginData__);
nameSource = NULL; // these will be recalculated automatically
+ nameSourceMode = 0;
shortNameSource = NULL;
parameters = Channel.parameters;
return *this;
@@ -106,8 +107,12 @@ cChannel& cChannel::operator= (const cChannel &Channel)
const char *cChannel::Name(void) const
{
if (Setup.ShowChannelNamesWithSource && !groupSep) {
- if (isempty(nameSource))
- nameSource = cString::sprintf("%s (%c)", name, cSource::ToChar(source));
+ if (isempty(nameSource) || nameSourceMode != Setup.ShowChannelNamesWithSource) {
+ if (Setup.ShowChannelNamesWithSource == 1)
+ nameSource = cString::sprintf("%s (%c)", name, cSource::ToChar(source));
+ else
+ nameSource = cString::sprintf("%s (%s)", name, *cSource::ToString(source));
+ }
return nameSource;
}
return name;
@@ -194,6 +199,7 @@ bool cChannel::SetTransponderData(int Source, int Frequency, int Srate, const ch
parameters = Parameters;
schedule = NULL;
nameSource = NULL;
+ nameSourceMode = 0;
shortNameSource = NULL;
if (Number() && !Quiet) {
dsyslog("changing transponder data of channel %d (%s) from %s to %s", Number(), name, *OldTransponderData, *TransponderDataToString());
@@ -262,6 +268,7 @@ bool cChannel::SetName(const char *Name, const char *ShortName, const char *Prov
if (nn) {
name = strcpyrealloc(name, Name);
nameSource = NULL;
+ nameSourceMode = 0;
}
if (ns) {
shortName = strcpyrealloc(shortName, ShortName);
@@ -792,6 +799,7 @@ bool cChannel::Parse(const char *s)
free(caidbuf);
free(namebuf);
nameSource = NULL;
+ nameSourceMode = 0;
shortNameSource = NULL;
if (!GetChannelID().Valid()) {
esyslog("ERROR: channel data results in invalid ID!");
@@ -1093,8 +1101,8 @@ bool cChannels::MarkObsoleteChannels(int Source, int Nid, int Tid)
bool ChannelsModified = false;
for (cChannel *Channel = First(); Channel; Channel = Next(Channel)) {
if (time(NULL) - Channel->Seen() > CHANNELTIMEOBSOLETE && Channel->Source() == Source && Channel->Nid() == Nid && Channel->Tid() == Tid && Channel->Rid() == 0) {
- bool OldShowChannelNamesWithSource = Setup.ShowChannelNamesWithSource;
- Setup.ShowChannelNamesWithSource = false;
+ int OldShowChannelNamesWithSource = Setup.ShowChannelNamesWithSource;
+ Setup.ShowChannelNamesWithSource = 0;
if (!endswith(Channel->Name(), CHANNELMARKOBSOLETE))
ChannelsModified |= Channel->SetName(cString::sprintf("%s %s", Channel->Name(), CHANNELMARKOBSOLETE), Channel->ShortName(), cString::sprintf("%s %s", CHANNELMARKOBSOLETE, Channel->Provider()));
Setup.ShowChannelNamesWithSource = OldShowChannelNamesWithSource;