From 22b4b620972d29510263805563aa53e810a11165 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sat, 22 Mar 2008 09:01:48 +0100 Subject: support for a conf.d subdirectory --- conflictcheck.c | 6 +++--- epgsearch.c | 32 +++++++++++++++++++++++++++++++- epgsearch.h | 1 + menu_dirselect.c | 8 ++++++++ menu_dirselect.h | 2 ++ po/ca_ES.po | 2 +- po/cs_CZ.po | 2 +- po/da_DK.po | 2 +- po/de_DE.po | 2 +- po/el_GR.po | 2 +- po/es_ES.po | 2 +- po/et_EE.po | 2 +- po/fi_FI.po | 2 +- po/fr_FR.po | 2 +- po/hr_HR.po | 2 +- po/hu_HU.po | 2 +- po/it_IT.po | 2 +- po/nl_NL.po | 2 +- po/nn_NO.po | 2 +- po/pl_PL.po | 2 +- po/pt_PT.po | 2 +- po/ro_RO.po | 2 +- po/ru_RU.po | 2 +- po/sl_SI.po | 2 +- po/sv_SE.po | 2 +- po/tr_TR.po | 2 +- uservars.c | 10 ++++++++-- 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; id_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 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 {}; +class cConfDDirExts : public cList {}; 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: \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à \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 , Guido Josten \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \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: \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 \n" "Language-Team: \n" diff --git a/uservars.c b/uservars.c index a55e558..66abbd6 100644 --- a/uservars.c +++ b/uservars.c @@ -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; diff --git a/uservars.h b/uservars.h index 557cfb6..c16cd00 100644 --- a/uservars.h +++ b/uservars.h @@ -677,7 +677,7 @@ extern cUserVars UserVars; class cUserVarLine : public cListObject { public: - bool Parse(char *s); + static bool Parse(char *s); }; -- cgit v1.2.3