summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2020-04-11 09:22:05 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2020-04-11 09:22:05 +0200
commit6e0f5287ea4df66847f97489f00f2c8214bad605 (patch)
tree6f37287dcaa4c1889072f16760a917d4adf93aca /menu.c
parentf63a066b98039663ff35d21fd42a66eb143d93ab (diff)
downloadvdr-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 'menu.c')
-rw-r--r--menu.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/menu.c b/menu.c
index 76095481..58c7763e 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 4.80 2019/05/28 15:24:43 kls Exp $
+ * $Id: menu.c 4.81 2020/04/11 09:22:05 kls Exp $
*/
#include "menu.h"
@@ -516,7 +516,6 @@ eOSState cMenuChannels::Delete(void)
Channels->Del(Channel);
cOsdMenu::Del(Index);
Propagate(Channels);
- Channels->SetModifiedByUser();
isyslog("channel %d deleted", DeletedChannel);
Deleted = true;
if (CurrentChannel && CurrentChannel->Number() != CurrentChannelNr) {
@@ -541,10 +540,14 @@ void cMenuChannels::Move(int From, int To)
if (FromChannel && ToChannel) {
int FromNumber = FromChannel->Number();
int ToNumber = ToChannel->Number();
+ if (Channels->MoveNeedsDecrement(FromChannel, ToChannel)) {
+ ToChannel = Channels->Prev(ToChannel); // cListBase::Move() doesn't know about the channel list's numbered groups!
+ To--;
+ }
Channels->Move(FromChannel, ToChannel);
cOsdMenu::Move(From, To);
+ SetCurrent(Get(To));
Propagate(Channels);
- Channels->SetModifiedByUser();
isyslog("channel %d moved to %d", FromNumber, ToNumber);
if (CurrentChannel && CurrentChannel->Number() != CurrentChannelNr) {
if (!cDevice::PrimaryDevice()->Replaying() || cDevice::PrimaryDevice()->Transferring())