[vdr-plugin-undelete] 01/05: Imported Upstream version 0.0.7+git20150214

Tobias Grimm tiber-guest at moszumanska.debian.org
Sat Feb 14 14:31:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

tiber-guest pushed a commit to branch master
in repository vdr-plugin-undelete.

commit 7606cf35028465da441e6f85234eccc983eeeb94
Author: etobi <git at e-tobi.net>
Date:   Sat Feb 14 15:24:57 2015 +0100

    Imported Upstream version 0.0.7+git20150214
---
 .gitignore         |  7 +++++
 HISTORY            | 12 +++++++
 Makefile           | 92 ++++++++++++++++++++++++++++--------------------------
 README             | 18 ++++++++---
 menunoselectitem.h | 10 +-----
 menutext.c         | 36 ---------------------
 menutext.h         | 23 --------------
 menuundelete.c     | 50 +++++++----------------------
 menuundelete.h     |  4 ---
 undelete.c         | 81 ++++++++++++++++-------------------------------
 undelete.h         | 24 +++-----------
 vdrtools.c         | 29 -----------------
 vdrtools.h         | 14 ---------
 13 files changed, 126 insertions(+), 274 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..de3d2d5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+*.bak
+*.o
+*.so
+libvdr-undelete.so*
+*.tar.gz
+*.tgz
+*~
diff --git a/HISTORY b/HISTORY
index e7cc5dc..3d417d9 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,18 @@
 VDR Plugin 'undelete' Revision History
 --------------------------------------
 
+2012-10-08 Version: UNRELEASED
+-------------------------
+- edit plugin version string to reflect GIT commit IDs
+- new minimum vdr version 1.5.7, added code to ensure this
+- add version requirements to README
+- start code cleanup: remove conditional code for vdr <1.5.7
+- insert compile fix for vdr >=2.1.2, thx to hd_brummy
+    closes ticket #1858 http://projects.vdr-developer.org/issues/1858
+- new Makefile taken from vdr-2.1.6
+- remove conditional code for HAVE_SVDRP since SVDRP is always included
+  at least since vdr-1.5.7
+
 2012-10-05 Version: 0.0.7
 -------------------------
 - fix more typos
diff --git a/Makefile b/Makefile
index ac3c2a2..d39d2d3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,59 +1,56 @@
 #
 # Makefile for a Video Disk Recorder plugin
 #
-# $Id$
+# $Id: Makefile 3.1 2014/01/01 13:29:54 kls Exp $
 
 # The official name of this plugin.
 # This name will be used in the '-P...' option of VDR to load the plugin.
 # By default the main source file also carries this name.
-# IMPORTANT: the presence of this macro is important for the Make.config
-# file. So it must be defined, even if it is not used here!
-#
+
 PLUGIN = undelete
 
 ### The version number of this plugin (taken from the main source file):
 
 VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
-
-### The C++ compiler and options:
-
-CXX      ?= g++
-CXXFLAGS ?= -fPIC -O2 -Wall -Woverloaded-virtual
+GITTAG  = $(shell git describe --always 2>/dev/null)
 
 ### The directory environment:
 
-VDRDIR ?= ../../..
-LIBDIR ?= ../../lib
+# Use package data if installed...otherwise assume we're under the VDR source directory:
+PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell PKG_CONFIG_PATH="$$PKG_CONFIG_PATH:../../.." pkg-config --variable=$(1) vdr))
+LIBDIR = $(call PKGCFG,libdir)
+LOCDIR = $(call PKGCFG,locdir)
+PLGCFG = $(call PKGCFG,plgcfg)
+#
 TMPDIR ?= /tmp
 
-### Make sure that necessary options are included:
+### The compiler options:
 
--include $(VDRDIR)/Make.global
+export CFLAGS   = $(call PKGCFG,cflags)
+export CXXFLAGS = $(call PKGCFG,cxxflags)
 
-### Allow user defined options to overwrite defaults:
+### The version number of VDR's plugin API:
 
--include $(VDRDIR)/Make.config
+APIVERSION = $(call PKGCFG,apiversion)
 
-### The version number of VDR's plugin API (taken from VDR's "config.h"):
+### Allow user defined options to overwrite defaults:
 
-VDRVERSNUM = $(shell grep 'define VDRVERSNUM ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
-APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
+-include $(PLGCFG)
 
 ### The name of the distribution archive:
 
 ARCHIVE = $(PLUGIN)-$(VERSION)
 PACKAGE = vdr-$(ARCHIVE)
 
-### Includes and Defines (add further entries here):
+### The name of the shared object file:
+
+SOFILE = libvdr-$(PLUGIN).so
 
-INCLUDES += -I$(VDRDIR)/include
+### Includes and Defines (add further entries here):
 
-DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+INCLUDES +=
 
-### Test SVDRP
-ifeq ($(shell grep -q ReplyCode $(VDRDIR)/plugin.h ; echo $$?),0)
-  DEFINES += -DHAVE_SVDRP
-endif
+DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
 
 ### Test Elchi
 ifeq ($(shell test -f $(VDRDIR)/theme.h ; echo $$?),0)
@@ -73,59 +70,66 @@ endif
 ### The object files (add further files here):
 
 OBJS = $(PLUGIN).o menuundelete.o menusetup.o vdrtools.o menueditkeys.o menudispkey.o
-#FIXME
-ifeq ($(shell test $(VDRVERSNUM) -lt 10308 ; echo $$?),0)
-  OBJS += menutext.o
+
+ifneq ($(strip $(GITTAG)),)
+  DEFINES += -DGITVERSION='"-GIT-$(GITTAG)"'
 endif
 
+### The main target:
+
+all: $(SOFILE) i18n
+
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
+	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
 ### Internationalization (I18N):
 
 PODIR     = po
-LOCALEDIR = $(VDRDIR)/locale
 I18Npo    = $(wildcard $(PODIR)/*.po)
-I18Nmsgs  = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
+I18Nmo    = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
+I18Nmsgs  = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
 I18Npot   = $(PODIR)/$(PLUGIN).pot
 
 %.mo: %.po
 	msgfmt -c -o $@ $<
 
 $(I18Npot): $(wildcard *.c)
-	xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<martin.dummer at gmx.net>' -o $@ $^
+	xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^`
 
 %.po: $(I18Npot)
-	msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
+	msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
 	@touch $@
 
-$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
-	@mkdir -p $(dir $@)
-	cp $< $@
+$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
+	install -D -m644 $< $@
 
 .PHONY: i18n
-i18n: $(I18Nmsgs)
+i18n: $(I18Nmo) $(I18Npot)
 
-### Targets:
+install-i18n: $(I18Nmsgs)
 
-all: libvdr-$(PLUGIN).so i18n
+### Targets:
 
-libvdr-$(PLUGIN).so: $(OBJS)
+$(SOFILE): $(OBJS)
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
-	@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
 
-dist: clean
+install-lib: $(SOFILE)
+	install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
+
+install: install-lib install-i18n
+
+dist: $(I18Npo) clean
 	@-rm -rf $(TMPDIR)/$(ARCHIVE)
 	@mkdir $(TMPDIR)/$(ARCHIVE)
 	@cp -a * $(TMPDIR)/$(ARCHIVE)
@@ -135,4 +139,4 @@ dist: clean
 
 clean:
 	@-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
-	@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ *.bak
+	@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~
diff --git a/README b/README
index 81d7242..b5a071f 100644
--- a/README
+++ b/README
@@ -1,12 +1,12 @@
 This is a "plugin" for the Video Disk Recorder (VDR).
 
 Written by:                  Hardy Flor <HFlor at gmx.de>
+cont'd by:                   Martin Dummer <martin.dummer at gmx.net>
 
 Project's homepage:          http://projects.vdr-developer.org/projects/plg-undelete
 
 See the file COPYING for license information.
 
-undelete-plugin version 0.0.6
 
 Description:
 ============
@@ -24,13 +24,23 @@ The plugin can also show the size of the deleted recordings and and immediate de
 can be triggered.
 
 
+Requirements:
+=============
+
+up to undelete-plugin v0.0.6: VDR >=1.3.8
+
+undelete-plugin v0.0.7 and later: VDR >=1.5.7
+
+
+
 Usage:
 ======
 
-You can build the current list of deleted from the plugin-setup menu 
-(by 'Display deleted recordings now') or from the plugin's mainmenu entry (mainmenuentry visible from then mainmenu.
+You can build the current list of deleted recordings from the plugin-setup menu 
+(by 'Display deleted recordings now') or from the plugin's mainmenu entry (if 
+mainmenuentry is visible in the main menu).
 
-The keys for purge and salvage can you change in the setup of plugin
+The keys for purge and salvage are adjustable in the plugin's setup
 
 
 The plugin has the following SVDRP commands:
diff --git a/menunoselectitem.h b/menunoselectitem.h
index 9bc69be..0161dee 100644
--- a/menunoselectitem.h
+++ b/menunoselectitem.h
@@ -19,15 +19,7 @@
 
 class cMenuOsdNoSelectItem : public cOsdItem {
 public:
-#if VDRVERSNUM >= 10307
   cMenuOsdNoSelectItem(const char *Text):cOsdItem(Text) { SetSelectable(false); }
-#else
-  #ifdef HAVE_ELCHI
-  cMenuOsdNoSelectItem(const char *Text):cOsdItem(Text) { SetColor(Setup.Theme == themeVanilla ? clrCyan : clrScrolLine, clrBackground); }
-  #else
-  cMenuOsdNoSelectItem(const char *Text):cOsdItem(Text) { SetColor(clrCyan, clrBackground); }
-  #endif
-#endif
-  };
+};
 
 #endif //__MENUNOSELECTITEM_H
diff --git a/menutext.c b/menutext.c
deleted file mode 100644
index 83e5a20..0000000
--- a/menutext.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * undelete: A plugin for the Video Disk Recorder
- *
- * See the README file for copyright information and how to reach the author.
- *
- * $Id: menutext.c 0.4 2005/11/16 18:39:18 hflor Exp $
- */
-
-#include "menutext.h"
-#include <vdr/menuitems.h>
-
-// --- cMenuText -------------------------------------------------------------
-
-cMenuText::cMenuText(const char *Title, const char *Text, eDvbFont Font)
-:cOsdMenu(Title)
-{
-  Add(new cMenuTextItem(Text, 1, 2, Setup.OSDwidth - 2, MAXOSDITEMS, clrWhite, clrBackground, Font));
-}
-
-eOSState cMenuText::ProcessKey(eKeys Key)
-{
-  eOSState state = cOsdMenu::ProcessKey(Key);
-
-  switch (state)
-  {
-    case osUnknown:  switch (NORMALKEY(Key))
-                     {
-                       case kOk:     state = osBack;
-                                     break;
-                       default: break;
-                     }
-                     break;
-    default:         break;
-  }
-  return state;
-}
diff --git a/menutext.h b/menutext.h
deleted file mode 100644
index 1f163fe..0000000
--- a/menutext.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * undelete: A plugin for the Video Disk Recorder
- *
- * See the README file for copyright information and how to reach the author.
- *
- * $Id: menutext.h 0.4 2005/11/16 18:39:18 hflor Exp $
- */
-
-#ifndef __MENUTEXT_H
-#define __MENUTEXT_H
-
-#include <vdr/osd.h>
-#include <vdr/osdbase.h>
-
-// --- cMenuText -------------------------------------------------------------
-
-class cMenuText : public cOsdMenu {
-public:
-  cMenuText(const char *Title, const char *Text, eDvbFont Font = fontOsd);
-  virtual eOSState ProcessKey(eKeys Key);
-  };
-
-#endif // __MENUTEXT_H
diff --git a/menuundelete.c b/menuundelete.c
index e457703..ac259ca 100644
--- a/menuundelete.c
+++ b/menuundelete.c
@@ -7,9 +7,6 @@
  */
 
 #include "menuundelete.h"
-#if VDRVERSNUM < 10307
-  #include "menutext.h"
-#endif
 #include "undelete.h"
 #include "menudispkey.h"
 #include "vdrtools.h"
@@ -51,7 +48,6 @@ cMenuRecordingSelectItem::~cMenuRecordingSelectItem()
   freenull(name);
 }
 
-#if VDRVERSNUM >= 10315
 int cMenuRecordingSelectItem::compare(const cListObject &ListObject) const
 {
   cMenuRecordingSelectItem *temp = (cMenuRecordingSelectItem *)&ListObject;
@@ -61,17 +57,6 @@ int cMenuRecordingSelectItem::compare(const cListObject &ListObject) const
     return strcasecmp(name, temp->name);
   return start == temp->start ? 0 : start < temp->start ? -1 : 1;
 }
-#else
-bool cMenuRecordingSelectItem::operator< (const cListObject &ListObject)
-{
-  cMenuRecordingSelectItem *temp = (cMenuRecordingSelectItem *)&ListObject;
-  if (isdir != temp->isdir)
-    return isdir;
-  if (isdir)
-    return strcasecmp(name, temp->name) < 0;
-  return start < temp->start;
-}
-#endif
 
 void cMenuRecordingSelectItem::IncrementCounter(bool New)
 {
@@ -109,7 +94,11 @@ char *cMenuRecordingSelectItem::DirName(bool Parent)
   if (isdir || Parent)
   {
     temp = strdup(filename);
+#if VDRVERSNUM >= 20102
+    char *last = temp + strlen(cVideoDirectory::Name()) + 1;
+#else
     char *last = temp + strlen(VideoDirectory) + 1;
+#endif
     for (int i = level; *last && i >= Parent ? -1 : 0; i--)
     {
       last = strchr(last, '/');
@@ -127,11 +116,7 @@ char *cMenuRecordingSelectItem::DirName(bool Parent)
 // --- cMenuRecordingSelect --------------------------------------------------------
 
 cMenuRecordingSelect::cMenuRecordingSelect(const char *Base, int Level)
-#if VDRVERSNUM >= 10307
 :cOsdMenu(Base ? Base : tr("Deleted Recordings"), 9, 6, 6)
-#else
-:cOsdMenu(Base ? Base : tr("Deleted Recordings"), 6, 6, 6)
-#endif
 {
 #ifdef UND_Debug
   objID = ++cMenuRecordingSelect_nextID;
@@ -294,11 +279,7 @@ void cMenuRecordingSelect::SetHelpKeys(void)
       case 7:   if (IsRecording(item))
                 {
                   cRecording *recording = GetRecording(item);
-#if VDRVERSNUM >= 10325
                   functionavailable = (recording && recording->Info() && recording->Info()->Description() && *recording->Info()->Description());
-#else 
-                  functionavailable = (recording && recording->Summary() && *recording->Summary());
-#endif
                 }
                 break;
       case 8:   functionavailable = KeyState != 1 || functionkey[8].u != functionkey[9].u;
@@ -423,13 +404,8 @@ eOSState cMenuRecordingSelect::FunctionCall(int FunctionNumber)
 
     // summary
     case 7:   recording = GetRecording(item);
-#if VDRVERSNUM >= 10325
               if (recording && recording->Info() && recording->Info()->Description() && *recording->Info()->Description())
                 state = AddSubMenu(new cMenuText(tr("Info"), recording->Info()->Description()));
-#else 
-              if (recording && recording->Summary() && *recording->Summary())
-                state = AddSubMenu(new cMenuText(tr("Summary"), recording->Summary()));
-#endif
               break;
    
     // switch hotkeys to 1
@@ -583,14 +559,8 @@ cMenuUndelete::~cMenuUndelete()
   if (PurgeRecording && !oRemoveThread.ActiveWithCancel())
     oRemoveThread.Start();
   DeletedRecordings.Clear();
-#if VDRVERSNUM >= 10311
   if (SalvageRecording)
-#if VDRVERSNUM >= 10333
     Recordings.Update();
-#else
-    Recordings.TriggerUpdate();
-#endif
-#endif
   MenuIsOpen = false;
 }
 
@@ -598,11 +568,7 @@ void cMenuUndelete::FillMenu(void)
 {
   STATUS(tr("Display$prepare recording display..."));
   DeletedRecordings.Clear();
-#if VDRVERSNUM >= 10311
   DeletedRecordings.Load();
-#else
-  DeletedRecordings.Load(true);
-#endif
   DeletedRecordings.Sort();
   KeyState = 1;
   AddSubMenu(new cMenuRecordingSelect);
@@ -635,7 +601,11 @@ eOSState cMenuUndelete::ProcessKey(eKeys Key)
                             {
                               if (verbose.u)
                                 isyslog("%s: purge deleted recording (%s)", plugin_name, recording->FileName());
+#if VDRVERSNUM >= 20102
+                              if (!cVideoDirectory::RemoveVideoFile(recording->FileName()))
+#else
                               if (!RemoveVideoFile(recording->FileName()))
+#endif
                               {
                                 esyslog("%s: Error while remove deleted recording (%s)", plugin_name, recording->FileName());
                                 processerror = true;
@@ -669,7 +639,11 @@ eOSState cMenuUndelete::ProcessKey(eKeys Key)
                                   processerror = true;
                                 } else
                                 {
+#if VDRVERSNUM >= 20102
+                                  if (!cVideoDirectory::RenameVideoFile(recording->FileName(), NewName))
+#else
                                   if (!RenameVideoFile(recording->FileName(), NewName))
+#endif
                                   {
                                     esyslog("%s: Error while rename deleted recording (%s) to (%s)", plugin_name, recording->FileName(), NewName);
                                     processerror = true;
diff --git a/menuundelete.h b/menuundelete.h
index 47db6b4..5897a22 100644
--- a/menuundelete.h
+++ b/menuundelete.h
@@ -36,11 +36,7 @@ public:
 #endif
   cMenuRecordingSelectItem(cRecording *Recording, int Level);
   ~cMenuRecordingSelectItem(void);
-#if VDRVERSNUM >= 10315
   virtual int compare(const cListObject &ListObject) const;
-#else
-  virtual bool operator< (const cListObject &ListObject);
-#endif
   void IncrementCounter(bool New);
   void RefreshCounter(void);
   const char *FileName(void) { return filename; }
diff --git a/undelete.c b/undelete.c
index ce3c2d8..a7b61eb 100644
--- a/undelete.c
+++ b/undelete.c
@@ -15,8 +15,16 @@
 #include <vdr/recording.h>
 #include <vdr/videodir.h>
 
-static const char *VERSION           = "0.0.7";
-static const char DESCRIPTION[]      = trNOOP("undelete for recordings");
+#if defined(APIVERSNUM) && APIVERSNUM < 10507
+#error "VDR-1.5.7 API version or greater is required!"
+#endif
+
+#ifndef GITVERSION
+#define GITVERSION ""
+#endif
+
+static const char *VERSION           = "0.0.7" GITVERSION;
+static const char *DESCRIPTION       = trNOOP("undelete for recordings");
 
 
 // Global variables that control the overall behaviour:
@@ -57,11 +65,7 @@ char        plugin_name[MaxFileName]  = "Undelete";
 cPlugin     *plugin = NULL;
 bool        PurgeRecording = false;
 bool        SalvageRecording = false;
-#if VDRVERSNUM >= 10311
 cRecordings DeletedRecordings(true);
-#else
-cRecordings DeletedRecordings;
-#endif
 bool        MenuIsOpen = false;
 char        *SVDRP_Process = NULL;
 char        *WorkFilename = NULL;
@@ -198,11 +202,7 @@ class cPluginUndelete : public cPlugin {
 private:
   // Add any member variables or functions you may need here.
   void FreeKeyNames(void);
-#if VDRVERSNUM >= 10507
   char* OSDLanguage;
-#else
-  int OSDLanguage;
-#endif
   void TestAndSetOSDLanguage(void);
   bool ProcessArg(int argc, char *argv[]);
 #ifdef UND_Debug
@@ -225,10 +225,8 @@ public:
   virtual cMenuSetupPage *SetupMenu(void)                       { TestAndSetOSDLanguage(); return new cMenuSetupUndelete; }
   virtual bool SetupParse(const char *Name, const char *Value);
 
-#ifdef HAVE_SVDRP
   virtual const char **SVDRPHelpPages(void);
   virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode);
-#endif
   };
 
 cPluginUndelete::cPluginUndelete(void)
@@ -262,7 +260,7 @@ void cPluginUndelete::FreeKeyNames(void)
 
 void cPluginUndelete::TestAndSetOSDLanguage(void)
 {
-  d2syslog("cPluginUndelete::TestAndSetOSDLanguage", "OSDLanguage=%d", Setup.OSDLanguage);
+  d2syslog("cPluginUndelete::TestAndSetOSDLanguage", "OSDLanguage=%s", Setup.OSDLanguage);
   if (OSDLanguage != Setup.OSDLanguage) {
     FreeKeyNames();
     OSDLanguage = Setup.OSDLanguage;
@@ -286,11 +284,7 @@ void cPluginUndelete::TestAndSetOSDLanguage(void)
     FunctionHotKey[4] = tr("Display$purge all");
     FunctionHotKey[5] = tr("Display$salvage all");
     FunctionHotKey[6] = tr("Open");
-#if VDRVERSNUM >= 10325
     FunctionHotKey[7] = tr("Info");
-#else
-    FunctionHotKey[7] = tr("Summary");
-#endif
     FunctionHotKey[8] = tr("Display$<--1");
     FunctionHotKey[9] = tr("Display$2-->");
     FunctionHotKey[10] = tr("Display$disp. keys");
@@ -665,7 +659,6 @@ bool cPluginUndelete::SetupParse(const char *Name, const char *Value)
   #undef SetParamChar
 }
 
-#ifdef HAVE_SVDRP
 const char **cPluginUndelete::SVDRPHelpPages(void)
 {
   static const char *HelpPages[] = {
@@ -707,13 +700,9 @@ cString cPluginUndelete::SVDRPCommand(const char *Command, const char *Option, i
         cRecording *recording = DeletedRecordings.Get(atoi(Option) - 1);
         if (recording)
         {
-#if VDRVERSNUM >= 10325
           const char *summary = NULL;
           if (recording->Info())
             summary = recording->Info()->Description();
-#else 
-          const char *summary = recording->Summary();
-#endif
           if (summary && *summary)
           {
             ReplyCode = 902;
@@ -730,11 +719,7 @@ cString cPluginUndelete::SVDRPCommand(const char *Command, const char *Option, i
     } else
     {
       // list deleted recordings
-#if VDRVERSNUM >= 10311
       DeletedRecordings.Load();
-#else
-      DeletedRecordings.Load(true);
-#endif
       DeletedRecordings.Sort();
       freenull(SVDRP_Process);
       char *list = NULL;
@@ -772,11 +757,7 @@ cString cPluginUndelete::SVDRPCommand(const char *Command, const char *Option, i
       }
     } else
     {
-#if VDRVERSNUM >= 10311
       DeletedRecordings.Load();
-#else
-      DeletedRecordings.Load(true);
-#endif
       for (cRecording *recording = DeletedRecordings.First(); recording; recording = DeletedRecordings.Next(recording))
         GetVDRSize(recording->FileName(), llsize);
       DeletedRecordings.Clear();
@@ -840,7 +821,11 @@ cString cPluginUndelete::SVDRPCommand(const char *Command, const char *Option, i
           {
             if (verbose.u)
               isyslog("%s: purge deleted recording (%s)", plugin_name, recording->FileName());
+#if VDRVERSNUM >= 20102
+            if (!cVideoDirectory::RemoveVideoFile(recording->FileName()))
+#else
             if (!RemoveVideoFile(recording->FileName()))
+#endif
             {
               esyslog("%s: Error while removing deleted recording (%s)", plugin_name, recording->FileName());
               return cString::sprintf("error while purging the deleted recording \"%s\"  [%s]", Option, recording->Title());
@@ -859,11 +844,7 @@ cString cPluginUndelete::SVDRPCommand(const char *Command, const char *Option, i
       {
         if (!DeletedRecordings.Count())
         {
-#if VDRVERSNUM >= 10311
           DeletedRecordings.Load();
-#else
-          DeletedRecordings.Load(true);
-#endif
           DeletedRecordings.Sort();
           freenull(SVDRP_Process);
           if (!DeletedRecordings.Count())
@@ -887,11 +868,7 @@ cString cPluginUndelete::SVDRPCommand(const char *Command, const char *Option, i
           oRemoveThread.Start();
         DeletedRecordings.Clear();
         freenull(SVDRP_Process);
-#if VDRVERSNUM >= 10311
         DeletedRecordings.Load();
-#else
-        DeletedRecordings.Load(true);
-#endif
         bool recordingsavailable = DeletedRecordings.Count();
         DeletedRecordings.Clear();
         if (recordingsavailable)
@@ -952,7 +929,11 @@ cString cPluginUndelete::SVDRPCommand(const char *Command, const char *Option, i
                 return cString::sprintf("recording with the same name exists \"%s\" [%s]", Option, recording->Title());
               } else
               {
+#if VDRVERSNUM >= 20102
+                if (!cVideoDirectory::RenameVideoFile(recording->FileName(), (const char *)NewName))
+#else
                 if (!RenameVideoFile(recording->FileName(), (const char *)NewName))
+#endif
                 {
                   esyslog("%s: Error while renaming deleted recording (%s) to (%s)", plugin_name, recording->FileName(), (const char *)NewName);
                   return cString::sprintf("error while renaming deleted recording \"%s\" [%s]", Option, recording->Title());
@@ -1006,11 +987,7 @@ cString cPluginUndelete::SVDRPCommand(const char *Command, const char *Option, i
       {
         if (!DeletedRecordings.Count())
         {
-#if VDRVERSNUM >= 10311
           DeletedRecordings.Load();
-#else
-          DeletedRecordings.Load(true);
-#endif
           DeletedRecordings.Sort();
           freenull(SVDRP_Process);
           if (!DeletedRecordings.Count())
@@ -1032,11 +1009,7 @@ cString cPluginUndelete::SVDRPCommand(const char *Command, const char *Option, i
         }
         DeletedRecordings.Clear();
         freenull(SVDRP_Process);
-#if VDRVERSNUM >= 10311
         DeletedRecordings.Load();
-#else
-        DeletedRecordings.Load(true);
-#endif
         bool recordingsavailable = DeletedRecordings.Count();
         DeletedRecordings.Clear();
         if (recordingsavailable)
@@ -1064,25 +1037,25 @@ cString cPluginUndelete::SVDRPCommand(const char *Command, const char *Option, i
   return NULL;
 #undef CMD
 }
-#endif
 
 void cRemoveThread::Action(void)
+#if VDRVERSNUM >= 20102
+{
+  d1syslogi("cRemoveThread::Action", "cVideoDirectory::RemoveEmptyVideoDirectories thread started (pid=%d)", getpid());
+  cVideoDirectory::RemoveEmptyVideoDirectories();
+  d1syslogi("cRemoveThread::Action", "cVideoDirectory::RemoveEmptyVideoDirectories thread ended (pid=%d)", getpid());
+}
+#else
 {
   d1syslogi("cRemoveThread::Action", "RemoveEmptyVideoDirectories thread started (pid=%d)", getpid());
   RemoveEmptyVideoDirectories();
   d1syslogi("cRemoveThread::Action", "RemoveEmptyVideoDirectories thread ended (pid=%d)", getpid());
 }
+#endif
 
 bool cRemoveThread::ActiveWithCancel(void)
 {
-#if VDRVERSNUM >= 10318
   return Active();
-#else
-  if (Active())
-    return true;
-  Cancel(1); // reset the var "running" to restart the thread, fixed in 1.3.18
-  return false;
-#endif
 }
 
 VDRPLUGINCREATOR(cPluginUndelete); // Don't touch this!
diff --git a/undelete.h b/undelete.h
index f8a247a..a41a994 100644
--- a/undelete.h
+++ b/undelete.h
@@ -15,25 +15,11 @@
 #include <vdr/plugin.h>
 
 #define freenull(T) { if (T) { free(T); T = NULL; } }
-#if VDRVERSNUM > 10307
-  #define MAXOSDTEXTWIDTH 45
-  #define AKTOSDTEXTWIDTH 45
-  #define ERROR(E)  Skins.Message(mtError, E)
-  #define INFO(I)   Skins.Message(mtInfo, I)
-  #define STATUS(S) Skins.Message(mtStatus, S)
-#elif VDRVERSNUM == 10307
-  #error "cMenuText is in VDR 1.3.7 not in menu.h"
-#else
-  #define MAXOSDTEXTWIDTH MAXOSDWIDTH
-  #define AKTOSDTEXTWIDTH Setup.OSDwidth
-  #define ERROR(E)  Interface->Error(E)
-  #define INFO(I)   Interface->Info(I)
-  #ifdef HAVE_ELCHI
-    #define STATUS(S) { Interface->Status(S, Setup.Theme == themeVanilla ? clrBlack : (eDvbColor)fginfofont, Setup.Theme == themeVanilla ? clrCyan : clrInfoLine); Interface->Flush(); }
-  #else
-    #define STATUS(S) { Interface->Status(S); Interface->Flush(); }
-  #endif
-#endif
+#define MAXOSDTEXTWIDTH 45
+#define AKTOSDTEXTWIDTH 45
+#define ERROR(E)  Skins.Message(mtError, E)
+#define INFO(I)   Skins.Message(mtInfo, I)
+#define STATUS(S) Skins.Message(mtStatus, S)
 
 #ifdef UND_Debug
 extern int cMenuRecordingSelectItem_nextID;
diff --git a/vdrtools.c b/vdrtools.c
index fc44f5b..648572b 100644
--- a/vdrtools.c
+++ b/vdrtools.c
@@ -11,34 +11,6 @@
 #include <vdr/menu.h>
 #include <vdr/interface.h>
 
-#if VDRVERSNUM < 10318
-// --- cReadLine -------------------------------------------------------------
-
-cReadLine::cReadLine(void)
-{
-  size = 0;
-  buffer = NULL;
-}
-
-cReadLine::~cReadLine()
-{
-  free(buffer);
-}
-
-char *cReadLine::Read(FILE *f)
-{
-  int n = getline(&buffer, &size, f);
-  if (n > 0) {
-     n--;
-     if (buffer[n] == '\n')
-        buffer[n] = 0;
-     return buffer;
-     }
-  return NULL;
-}
-#endif
-
-#ifdef HAVE_SVDRP
 bool GetVDRSize(const char *dir, long long &llSize)
 {
   bool bRet = false;
@@ -60,7 +32,6 @@ bool GetVDRSize(const char *dir, long long &llSize)
   }
   return bRet;
 }
-#endif
 
 char *SkipQuote(char *s)
 {
diff --git a/vdrtools.h b/vdrtools.h
index 95a27b1..d94cffd 100644
--- a/vdrtools.h
+++ b/vdrtools.h
@@ -13,21 +13,7 @@
 #include <vdr/osd.h>
 #include <vdr/osdbase.h>
 
-#if VDRVERSNUM < 10318
-class cReadLine {
-private:
-  size_t size;
-  char *buffer;
-public:
-  cReadLine(void);
-  ~cReadLine();
-  char *Read(FILE *f);
-  };
-#endif
-
-#ifdef HAVE_SVDRP
 bool GetVDRSize(const char *dir, long long &llSize);
-#endif
 char *SkipQuote(char *s);
 char *ExchangeChars(char *s, bool ToFileSystem);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr-plugin-undelete.git



More information about the pkg-vdr-dvb-changes mailing list