diff options
author | Midas <vdrportal_midas@gmx.de> | 2010-08-09 04:33:36 +0200 |
---|---|---|
committer | Midas <vdrportal_midas@gmx.de> | 2010-08-09 04:33:36 +0200 |
commit | be9c683e1bb190de3f52238bd698a3d90f6d1a97 (patch) | |
tree | 967beb8e77d948f13a88b674279c7fab8d0d5e13 | |
parent | d04ad65095872e60613282b584ee10013ea18f44 (diff) | |
download | vdr-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.c | 3 | ||||
-rw-r--r-- | event.c | 6 | ||||
-rw-r--r-- | event.h | 11 | ||||
-rw-r--r-- | setup.c | 2 | ||||
-rw-r--r-- | status.c | 1 |
5 files changed, 17 insertions, 6 deletions
@@ -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 @@ -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); @@ -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> { @@ -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; } @@ -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) { |