summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMidas <vdrportal_midas@gmx.de>2010-08-09 04:33:36 +0200
committerMidas <vdrportal_midas@gmx.de>2010-08-09 04:33:36 +0200
commitbe9c683e1bb190de3f52238bd698a3d90f6d1a97 (patch)
tree967beb8e77d948f13a88b674279c7fab8d0d5e13
parentd04ad65095872e60613282b584ee10013ea18f44 (diff)
downloadvdr-plugin-block-be9c683e1bb190de3f52238bd698a3d90f6d1a97.tar.gz
vdr-plugin-block-be9c683e1bb190de3f52238bd698a3d90f6d1a97.tar.bz2
Renewed dev branch to 0.0.4. Added blacklist sorting.
-rw-r--r--block.c3
-rw-r--r--event.c6
-rw-r--r--event.h11
-rw-r--r--setup.c2
-rw-r--r--status.c1
5 files changed, 17 insertions, 6 deletions
diff --git a/block.c b/block.c
index be5c1ea..abf54fa 100644
--- a/block.c
+++ b/block.c
@@ -21,7 +21,7 @@
#include "common.h"
#include <vdr/interface.h>
-static const char *VERSION = "0.0.4";
+static const char *VERSION = "0.0.4+201008090412";
static const char *DESCRIPTION = trNOOP("Block unwanted shows by EPG title");
static const char *MAINMENUENTRY = trNOOP("(De)Block broadcast");
@@ -96,6 +96,7 @@ cOsdObject *cPluginBlock::MainMenuAction(void)
if (EventsBlock.Acceptable(present->Title()))
{
EventsBlock.Add(new cEventBlock(present->Title()));
+ EventsBlock.Sort();
EventsBlock.Save();
}
else
diff --git a/event.c b/event.c
index 4ec0b47..5e7fb80 100644
--- a/event.c
+++ b/event.c
@@ -9,7 +9,7 @@
#include <ctype.h>
-static char *duptolower(const char *s) {
+char* cEventBlock::duptolower(const char *s) {
char *c = strdup(s);
char *p = c;
for (; *p; ++p)
@@ -65,8 +65,8 @@ bool cEventBlock::Acceptable(const char *Event) const
if (mRegularExp)
return regexec(&mExpression, Event, 0, NULL, 0) != 0;
else if (mIgnoreCase) {
- char *ev = duptolower(Event);
- char *pa = duptolower(mPattern);
+ char *ev = cEventBlock::duptolower(Event);
+ char *pa = cEventBlock::duptolower(mPattern);
printf("check for %s in %s\n", pa, ev);
bool res = strstr(ev, pa) == NULL;
free(ev); free(pa);
diff --git a/event.h b/event.h
index a205aab..bd8fa09 100644
--- a/event.h
+++ b/event.h
@@ -42,8 +42,17 @@ public:
bool Save(FILE *f);
static const char *LastTitle;
static const bool *ReplayingRecording;
-
+
+ static char *duptolower(const char*);
+
const char *Pattern(void) const { return mPattern; }
+
+ virtual int Compare(const cListObject &src) const
+ {
+ cEventBlock* rhs=(cEventBlock*)&src;
+ char* l=cEventBlock::duptolower(mPattern);
+ char* r=cEventBlock::duptolower(rhs->mPattern);
+ return strcmp(l,r); }
};
class cEventsBlock : public cConfig<cEventBlock> {
diff --git a/setup.c b/setup.c
index 359e633..0b3eab2 100644
--- a/setup.c
+++ b/setup.c
@@ -80,6 +80,7 @@ void cMenuSetupBlock::SetHelpKeys(void)
void cMenuSetupBlock::Store(void)
{
EventsBlock = mEventsData;
+ EventsBlock.Sort();
EventsBlock.Save();
SetupBlock = mSetupData;
@@ -192,5 +193,6 @@ eOSState cMenuSetupEditBlock::ProcessKey(eKeys Key)
break;
}
}
+ EventsBlock.Sort();
return state;
}
diff --git a/status.c b/status.c
index 0a0ae22..bdc0a4b 100644
--- a/status.c
+++ b/status.c
@@ -20,7 +20,6 @@ cStatusBlock::cStatusBlock(void):
void cStatusBlock::ChannelSwitch(const cDevice *Device, int ChannelNumber)
{
int current_channel=cDevice::CurrentChannel();
- int device_number=Device->DeviceNumber();
if (cSetupBlock::LastChannel==0)
{