diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-03-22 09:01:48 +0100 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-03-22 09:01:48 +0100 |
commit | 22b4b620972d29510263805563aa53e810a11165 (patch) | |
tree | 8627f768f16dafe9b0fc3edd963afdfdc5901563 | |
parent | eedb920807a5917ca63c6c8dd7c78e6e4bf2754e (diff) | |
download | vdr-plugin-epgsearch-22b4b620972d29510263805563aa53e810a11165.tar.gz vdr-plugin-epgsearch-22b4b620972d29510263805563aa53e810a11165.tar.bz2 |
support for a conf.d subdirectory
-rw-r--r-- | conflictcheck.c | 6 | ||||
-rw-r--r-- | epgsearch.c | 32 | ||||
-rw-r--r-- | epgsearch.h | 1 | ||||
-rw-r--r-- | menu_dirselect.c | 8 | ||||
-rw-r--r-- | menu_dirselect.h | 2 | ||||
-rw-r--r-- | po/ca_ES.po | 2 | ||||
-rw-r--r-- | po/cs_CZ.po | 2 | ||||
-rw-r--r-- | po/da_DK.po | 2 | ||||
-rw-r--r-- | po/de_DE.po | 2 | ||||
-rw-r--r-- | po/el_GR.po | 2 | ||||
-rw-r--r-- | po/es_ES.po | 2 | ||||
-rw-r--r-- | po/et_EE.po | 2 | ||||
-rw-r--r-- | po/fi_FI.po | 2 | ||||
-rw-r--r-- | po/fr_FR.po | 2 | ||||
-rw-r--r-- | po/hr_HR.po | 2 | ||||
-rw-r--r-- | po/hu_HU.po | 2 | ||||
-rw-r--r-- | po/it_IT.po | 2 | ||||
-rw-r--r-- | po/nl_NL.po | 2 | ||||
-rw-r--r-- | po/nn_NO.po | 2 | ||||
-rw-r--r-- | po/pl_PL.po | 2 | ||||
-rw-r--r-- | po/pt_PT.po | 2 | ||||
-rw-r--r-- | po/ro_RO.po | 2 | ||||
-rw-r--r-- | po/ru_RU.po | 2 | ||||
-rw-r--r-- | po/sl_SI.po | 2 | ||||
-rw-r--r-- | po/sv_SE.po | 2 | ||||
-rw-r--r-- | po/tr_TR.po | 2 | ||||
-rw-r--r-- | uservars.c | 10 | ||||
-rw-r--r-- | uservars.h | 2 |
28 files changed, 75 insertions, 28 deletions
diff --git a/conflictcheck.c b/conflictcheck.c index 6c0ea4b..2016842 100644 --- a/conflictcheck.c +++ b/conflictcheck.c @@ -183,7 +183,7 @@ void cConflictCheck::InitDevicesInfo() { devices = new cConflictCheckDevice[MAXDEVICES]; #ifdef DEBUG_CONFL - numDevices = 2; + numDevices = 1; for(int i=0; i<numDevices; i++) { devices[i].devicenr = i; @@ -579,10 +579,10 @@ int cConflictCheck::GetDevice(cConflictCheckTimerObj* TimerObj, bool *NeedsDetac imp <<= 1; imp |= !devices[i].Receiving() || ndr; imp <<= 1; imp |= devices[i].Receiving(); imp <<= 1; //imp |= devices[i] == ActualDevice(); // cannot be handled - imp <<= 1; imp |= devices[i].IsPrimaryDevice(); - imp <<= 1; imp |= devices[i].HasDecoder(); imp <<= 8; imp |= min(max(devices[i].Priority() + MAXPRIORITY, 0), 0xFF); imp <<= 8; imp |= min(max(devices[i].ProvidesCa(Channel), 0), 0xFF); + imp <<= 1; imp |= devices[i].IsPrimaryDevice(); + imp <<= 1; imp |= devices[i].HasDecoder(); if (imp < Impact) { Impact = imp; selDevice = i; diff --git a/epgsearch.c b/epgsearch.c index ba8b46e..84fa052 100644 --- a/epgsearch.c +++ b/epgsearch.c @@ -1,5 +1,5 @@ /* -Copyright (C) 2004-2007 Christian Wieninger +Copyright (C) 2004-2008 Christian Wieninger This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -64,6 +64,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch #include "epgsearchservices.h" #include "menu_quicksearch.h" #include "menu_announcelist.h" +#include "confdloader.h" static const char VERSION[] = "0.9.24.beta22"; static const char DESCRIPTION[] = trNOOP("search the EPG for repeats and more"); @@ -448,6 +449,7 @@ bool cPluginEpgsearch::Start(void) LoadMenuTemplates(); LoadUserVars(); + LoadConfD(); cSearchTimerThread::Init(this); cSwitchTimerThread::Init(); @@ -556,6 +558,34 @@ void cPluginEpgsearch::LoadUserVars() UserVars.InitExtEPGVars(); } +void cPluginEpgsearch::LoadConfD() +{ + const string dirPath(AddDirectory(CONFIGDIR, "conf.d")); + LogFile.Log(2, "loading entries in %s", dirPath.c_str()); + cReadDir d(dirPath.c_str()); + struct dirent* e; + string parent(".."); + string current("."); + int count = 0; + while ((e = d.Next())) { + if ((current == e->d_name) || (parent == e->d_name)) { + continue; + } + /* Check if entry is a directory: I do not rely on e->d_type + here because on some systems it is allways DT_UNKNOWN. Also + testing for DT_DIR does not take into account symbolic + links to directories. + */ + struct stat buf; + if ((stat((dirPath + "/" + e->d_name).c_str(), &buf) != 0) || (S_ISDIR(buf.st_mode))) { + continue; + } + cConfDLoader L((dirPath + "/" + e->d_name).c_str()); + count++; + } + LogFile.Log(2, "loaded %d entries in %s", count, dirPath.c_str()); +} + cMenuSetupPage *cPluginEpgsearch::SetupMenu(void) { // Return a setup menu in case the plugin supports one. diff --git a/epgsearch.h b/epgsearch.h index bb71cc3..a97c84c 100644 --- a/epgsearch.h +++ b/epgsearch.h @@ -51,6 +51,7 @@ public: virtual const char **SVDRPHelpPages(void); virtual cString SVDRPCommand(const char *Cmd, const char *Option, int &ReplyCode); void LoadUserVars(); + void LoadConfD(); }; #endif diff --git a/menu_dirselect.c b/menu_dirselect.c index 335eeae..25c4adf 100644 --- a/menu_dirselect.c +++ b/menu_dirselect.c @@ -29,6 +29,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch set<string> cMenuDirSelect::directorySet; cDirExts DirExts; +cConfDDirExts ConfDDirExts; // --- cMenuDirItem --------------------------------------------------------- class cMenuDirItem : public cOsdItem @@ -188,6 +189,13 @@ void cMenuDirSelect::CreateDirSet() directorySet.insert(DirExt->Name()); DirExt = DirExts.Next(DirExt); } + // add distinct directories from conf.d files + DirExt = ConfDDirExts.First(); + while (DirExt) + { + directorySet.insert(DirExt->Name()); + DirExt = ConfDDirExts.Next(DirExt); + } } diff --git a/menu_dirselect.h b/menu_dirselect.h index 77a3d05..a40d5f8 100644 --- a/menu_dirselect.h +++ b/menu_dirselect.h @@ -42,8 +42,10 @@ public: }; class cDirExts : public cConfig<cDirExt> {}; +class cConfDDirExts : public cList<cDirExt> {}; extern cDirExts DirExts; +extern cConfDDirExts ConfDDirExts; // --- cMenuDirSelect --------------------------------------------------------- diff --git a/po/ca_ES.po b/po/ca_ES.po index 93b47e5..79aec41 100644 --- a/po/ca_ES.po +++ b/po/ca_ES.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Jordi Vilà <jvila@tinet.org>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/cs_CZ.po b/po/cs_CZ.po index b4d9985..7404fdb 100644 --- a/po/cs_CZ.po +++ b/po/cs_CZ.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Vladimír Bárta <vladimir.barta@k2atmitec.cz>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/da_DK.po b/po/da_DK.po index 5bde02e..d42c154 100644 --- a/po/da_DK.po +++ b/po/da_DK.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Mogens Elneff <mogens@elneff.dk>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/de_DE.po b/po/de_DE.po index ffb04ce..8ac4dfb 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Klaus Schmidinger <kls@cadsoft.de>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/el_GR.po b/po/el_GR.po index 8ba836e..ad1449d 100644 --- a/po/el_GR.po +++ b/po/el_GR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Dimitrios Dimitrakos <mail@dimitrios.de>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/es_ES.po b/po/es_ES.po index da65c34..913451f 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-11-18 20:09+0200\n" "Last-Translator: bittor from open7x0.org <bittor7x0 _at_ gmail.com>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/et_EE.po b/po/et_EE.po index d4dff0d..3f3dac7 100644 --- a/po/et_EE.po +++ b/po/et_EE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Arthur Konovalov <kasjas@hot.ee>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/fi_FI.po b/po/fi_FI.po index 21c22c6..ab77346 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Rolf Ahrenberg <rahrenbe@cc.hut.fi>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/fr_FR.po b/po/fr_FR.po index a988e24..2d3c35a 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Nicolas Huillard <nhuillard@e-dition.fr>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/hr_HR.po b/po/hr_HR.po index 604c8e3..739aee2 100644 --- a/po/hr_HR.po +++ b/po/hr_HR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Drazen Dupor <drazen.dupor@dupor.com>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/hu_HU.po b/po/hu_HU.po index 683b1ea..2315c1f 100644 --- a/po/hu_HU.po +++ b/po/hu_HU.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Istvan Koenigsberger <istvnko@hotmail.com>, Guido Josten <guido.josten@t-online.de>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/it_IT.po b/po/it_IT.po index 2344d97..934f214 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-12-30 04:09+0100\n" "Last-Translator: Gringo <vdr-italian@tiscali.it>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/nl_NL.po b/po/nl_NL.po index 760658f..94e7e79 100644 --- a/po/nl_NL.po +++ b/po/nl_NL.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Maarten Wisse <Maarten.Wisse@urz.uni-hd.de>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/nn_NO.po b/po/nn_NO.po index b5b1355..f6941e6 100644 --- a/po/nn_NO.po +++ b/po/nn_NO.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Truls Slevigen <truls@slevigen.no>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/pl_PL.po b/po/pl_PL.po index d6eb2d6..bf3d41a 100644 --- a/po/pl_PL.po +++ b/po/pl_PL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Michael Rakowski <mrak@gmx.de>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/pt_PT.po b/po/pt_PT.po index ad9553e..bdd4f52 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Paulo Lopes <pmml@netvita.pt>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/ro_RO.po b/po/ro_RO.po index 7fd1de2..fa9a120 100644 --- a/po/ro_RO.po +++ b/po/ro_RO.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Lucian Muresan <lucianm@users.sourceforge.net>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/ru_RU.po b/po/ru_RU.po index d1d3af8..318ea8b 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Vyacheslav Dikonov <sdiconov@mail.ru>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/sl_SI.po b/po/sl_SI.po index 184e367..6e3b4ed 100644 --- a/po/sl_SI.po +++ b/po/sl_SI.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Matjaz Thaler <matjaz.thaler@guest.arnes.si>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/sv_SE.po b/po/sv_SE.po index 72d289f..d81c32e 100644 --- a/po/sv_SE.po +++ b/po/sv_SE.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Tomas Prybil <tomas@prybil.se>\n" "Language-Team: <vdr@linuxtv.org>\n" diff --git a/po/tr_TR.po b/po/tr_TR.po index 7c0a183..8c2d7b6 100644 --- a/po/tr_TR.po +++ b/po/tr_TR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <cwieninger@gmx.de>\n" -"POT-Creation-Date: 2008-03-05 20:06+0100\n" +"POT-Creation-Date: 2008-03-22 08:54+0100\n" "PO-Revision-Date: 2007-08-14 20:21+0200\n" "Last-Translator: Oktay Yolgeçen <oktay_73@yahoo.de>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -267,8 +267,14 @@ bool cUserVarLine::Parse(char *s) cUserVar* userVar = new cUserVar; if (userVar->varparser.Parse(s)) { - UserVars.userVars.insert(userVar); - return true; + cUserVar* oldVar = UserVars.GetFromName(userVar->Name()); + if (oldVar) // allow redefintion of existing vars + { + UserVars.userVars.erase(oldVar); + delete oldVar; + } + UserVars.userVars.insert(userVar); + return true; } } return false; @@ -677,7 +677,7 @@ extern cUserVars UserVars; class cUserVarLine : public cListObject { public: - bool Parse(char *s); + static bool Parse(char *s); }; |