diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2020-04-11 09:22:05 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2020-04-11 09:22:05 +0200 |
commit | 6e0f5287ea4df66847f97489f00f2c8214bad605 (patch) | |
tree | 6f37287dcaa4c1889072f16760a917d4adf93aca /channels.c | |
parent | f63a066b98039663ff35d21fd42a66eb143d93ab (diff) | |
download | vdr-6e0f5287ea4df66847f97489f00f2c8214bad605.tar.gz vdr-6e0f5287ea4df66847f97489f00f2c8214bad605.tar.bz2 |
Fixed moving channels between number groups in SVDRP's MOVC command and the Channels menu, in case a channel is moved to a higher number and into a numbered group
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 21 |
1 files changed, 20 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 4.5 2017/06/10 15:08:56 kls Exp $ + * $Id: channels.c 4.6 2020/04/11 09:22:05 kls Exp $ */ #include "channels.h" @@ -946,6 +946,25 @@ void cChannels::ReNumber(void) } } +bool cChannels::MoveNeedsDecrement(cChannel *From, cChannel *To) +{ + int Number = From->Number(); + if (Number < To->Number()) { + for (cChannel *Channel = Next(From); Channel; Channel = Next(Channel)) { + if (Channel == To) + break; + if (Channel->GroupSep()) { + if (Channel->Number() > Number) + Number = Channel->Number(); + } + else + Number++; + } + return Number == To->Number(); + } + return false; +} + void cChannels::Del(cChannel *Channel) { UnhashChannel(Channel); |