vdr 1.7.27 - can add groupsep with NEWC

Message ID 4F9844D2.8050303@flensrocker.de
State New
Headers

Commit Message

L. Hanisch April 25, 2012, 6:39 p.m. UTC
  Hi,

The attached patch adds the possibility to add group separators to the channels via SVDRP's NEWC command.

Lars.
  

Patch

diff --git a/svdrp.c b/svdrp.c
index 01366dd..ce806ac 100644
--- a/svdrp.c
+++ b/svdrp.c
@@ -257,8 +257,8 @@  const char *HelpPages[] = {
   "MOVC <number> <to>\n"
   "    Move a channel to a new position.",
   "NEWC <settings>\n"
-  "    Create a new channel. Settings must be in the same format as returned\n"
-  "    by the LSTC command.",
+  "    Create a new channel or group separator. Settings must be in the\n"
+  "    same format as returned by the LSTC command.",
   "NEWT <settings>\n"
   "    Create a new timer. Settings must be in the same format as returned\n"
   "    by the LSTT command. It is an error if a timer with the same channel,\n"
@@ -1294,7 +1294,7 @@  void cSVDRP::CmdNEWC(const char *Option)
   if (*Option) {
      cChannel ch;
      if (ch.Parse(Option)) {
-        if (Channels.HasUniqueChannelID(&ch)) {
+        if (ch.GroupSep() || Channels.HasUniqueChannelID(&ch)) {
            cChannel *channel = new cChannel;
            *channel = ch;
            Channels.Add(channel);