summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/channels.c b/channels.c
index 2716b595..606ed8ff 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.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);