diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2009-06-01 15:04:41 +0200 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2009-06-01 15:04:41 +0200 |
commit | aa62bc397b15c060c9326a22db26797d18b52789 (patch) | |
tree | 69d3e1c3f86508f901237f7ebf1d0e6164a68ceb | |
parent | c538fe29b1460f9fa8062b9b075e19b11833e3db (diff) | |
download | vdr-plugin-epgsearch-aa62bc397b15c060c9326a22db26797d18b52789.tar.gz vdr-plugin-epgsearch-aa62bc397b15c060c9326a22db26797d18b52789.tar.bz2 |
patches by Bittor Corl
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | HISTORY.DE | 4 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | epgsearch.c | 2 | ||||
-rw-r--r-- | epgsearchonly.c | 6 | ||||
-rw-r--r-- | epgsearchtools.c | 126 | ||||
-rw-r--r-- | menu_whatson.c | 6 | ||||
-rw-r--r-- | po/es_ES.po | 55 | ||||
-rw-r--r-- | searchtimer_thread.c | 2 | ||||
-rw-r--r-- | templatefile.c | 2 |
10 files changed, 117 insertions, 91 deletions
@@ -45,6 +45,8 @@ new: this patch against VDR integrates epgsearch's timer edit menu to VDR's timer menu, thanks S:oren@vdr-portal for providing it. - some speed enhancements, thanks to Tobias Bratfisch for providing patches +- if the VPS time differs from the start time of an event the VPS marker is now 'v' + instead of 'V' fixes: - fixed a crash when pressing 'Ok' in an empty timers done menu @@ -64,6 +66,7 @@ fixes: also listed more than once. Thanks to Andreas Mair for reporting. - fixed a bug in search timer announcements concerning the display of the corresponding search timer +- fixed some memory leaks, thanks to Bittor Corl for providing a patch 2008-04-29: Version 0.9.24 new: @@ -50,6 +50,8 @@ neu: Dieser VDR-Patch integriert epgsearch's Timer-Edit-Menü in VDR's Timer-Menü, Danke dafür an S:oren@vdr-portal. - einige Geschwindigkeitsverbesserungen, Danke an Tobias Bratfisch für die Patches +- falls die VPS-Zeit von der Startzeit einer Sendung abweicht, wird die VPS-Kennung nun mit + 'v' statt 'V' angezeigt. fixes: - Absturz beim Drücken von 'Ok' in leerem Menü erledigter Timer behoben @@ -69,7 +71,7 @@ fixes: mehrfach gelistet, Danke an Andreas Mair für den Hinweis. - Fehler bei "Nur ankündigen"-Suchtimer im Zusammenhang mit der Anzeige des zugehörigen Such- timernamens korrigiert. - +- Einige Speicherlecks korrigiert, Danke an Bittor Corl für einen Patch 2008-04-29: Version 0.9.24 neu: @@ -185,7 +185,7 @@ quickepgsearch.o: quickepgsearch.c # Dependencies: -MAKEDEP = g++ -MM -MG +MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) $(OBJS2:%.o=%.c) $(OBJS3:%.o=%.c) $(OBJS4:%.o=%.c)> $@ diff --git a/epgsearch.c b/epgsearch.c index 90d7e41..2117bd8 100644 --- a/epgsearch.c +++ b/epgsearch.c @@ -66,7 +66,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch #include "menu_announcelist.h" #include "confdloader.h" -static const char VERSION[] = "0.9.25.beta13"; +static const char VERSION[] = "0.9.25.beta14"; static const char DESCRIPTION[] = trNOOP("search the EPG for repeats and more"); // globals diff --git a/epgsearchonly.c b/epgsearchonly.c index 0f0c077..3002635 100644 --- a/epgsearchonly.c +++ b/epgsearchonly.c @@ -49,7 +49,7 @@ const tI18nPhrase PhrasesLocal[] = { "", // TODO "Suoratoiminto EPGSearch-laajennoksen haulle", "", // TODO Polski - "Acceso directo al menú de búsqueda EPGSearch", // Español + "Acceso directo al menú de búsquedas en EPG", // Español "", // TODO ÅëëçíéêÜ (Greek) "", // TODO Svenska "", // TODO Romaneste @@ -72,7 +72,7 @@ const tI18nPhrase PhrasesLocal[] = { "", // TODO "Etsi ohjelmaoppaasta", "", // TODO - "Buscar", + "Búsquedas en EPG", "", // TODO "", // TODO "", // TODO @@ -95,7 +95,7 @@ const tI18nPhrase PhrasesLocal[] = { "", // TODO "EpgSearch-laajennoksen hakutoiminto päävalikossa", "", // TODO Polski - "Buscar EPG en menú principal", + "Búsquedas en EPG en menú principal", "", // TODO ÅëëçíéêÜ (Greek) "", // TODO Svenska "", // TODO Romaneste diff --git a/epgsearchtools.c b/epgsearchtools.c index 89f820c..f51e9be 100644 --- a/epgsearchtools.c +++ b/epgsearchtools.c @@ -453,33 +453,44 @@ char* GetAuxValue(const char* aux, const char* name) char* descr = strdup(aux); char* beginaux = strstr(descr, "<epgsearch>"); char* endaux = strstr(descr, "</epgsearch>"); - if (!beginaux || !endaux) return NULL; - strn0cpy(descr, beginaux + strlen("<epgsearch>"), endaux - (beginaux + strlen("<epgsearch>")) + 1); - if (strcmp(name, "epgsearch") == 0) return descr; // full aux + if (!beginaux || !endaux) { + free(descr); + return NULL; + } + + beginaux += 11; // strlen("<epgsearch>"); + endaux[0] = 0; + memmove(descr, beginaux, endaux - beginaux + 1); + + if (strcmp(name, "epgsearch") == 0) + return descr; // full aux + int namelen = strlen(name); char catname[100] = ""; - sprintf(catname, "<%s>", name); - - char* cat = NULL; - int iPosCat = FindIgnoreCase(descr, catname); - if (iPosCat < 0) return NULL; - cat = descr + iPosCat; + catname[0] = '<'; + memcpy(catname + 1, name, namelen); + catname[1 + namelen] = '>'; + catname[2 + namelen] = 0; + char* cat = strcasestr(descr, catname); + if (!cat) { + free(descr); + return NULL; + } + + cat += namelen + 2; char* end = strstr(cat, "</"); - int endpos = strlen(cat); - if (end) - endpos = end - cat; - else - { + if (!end) { free(descr); return NULL; - } - cat[endpos] = 0; - - char* value = NULL; - msprintf(&value, "%s", cat + strlen(name)+2); - free(descr); + } + end[0] = 0; + int catlen = end - cat + 1; + char* value = (char *) malloc(catlen); + memcpy(value, cat, catlen); + + free(descr); return value; } @@ -519,17 +530,13 @@ char *strreplacei(char *s, const char *s1, const char *s2) char *p = strcasestr(s, s1); if (p) { int of = p - s; - int l = 0; - if (s) - l = strlen(s); - int l1 = 0; - if (s1) - l1 = strlen(s1); + int l = strlen(s); + int l1 = strlen(s1); int l2 = 0; if (s2) l2 = strlen(s2); if (l2 > l1) - s = (char *)realloc(s, strlen(s) + l2 - l1 + 1); + s = (char *)realloc(s, l + l2 - l1 + 1); if (l2 != l1) memmove(s + of + l2, s + of + l1, l - of - l1 + 1); memcpy(s + of, s2, l2); @@ -859,25 +866,40 @@ void DelTimer(int index) char* FixSeparators(char* buffer, char sep) { - char tmp[5]; - tmp[0] = sep; tmp[1] = '\t'; tmp[2] = '\0'; - buffer = strreplacei(buffer, tmp, '\t'); - tmp[0] = sep; tmp[1] = ' '; tmp[2] = '\t'; tmp[3] = '\0'; - buffer = strreplacei(buffer, tmp, '\t'); - tmp[0] = sep; tmp[1] = ' '; tmp[2] = '\0'; - - unsigned int len = strlen(buffer); - if (strstr(buffer, tmp) == buffer + len - 2) - buffer[len-2] = '\0'; - if (buffer[len-1] == sep) - buffer[len-1] = '\0'; - - tmp[0] = '\t'; tmp[1] = sep; tmp[2] = '\0'; - buffer = strreplacei(buffer, tmp, '\t'); - tmp[0] = '\t'; tmp[1] = ' '; tmp[2] = sep; tmp[3] = '\0'; - buffer = strreplacei(buffer, tmp, '\t'); - tmp[0] = '\t'; tmp[1] = ' '; tmp[2] = ' '; tmp[3] = sep; tmp[4] = '\0'; - buffer = strreplacei(buffer, tmp, '\t'); + int l = strlen(buffer); + char *dest = buffer; + for (int i = 0; i < l; i ++) { + char c = buffer[i]; + int j = i; + if (c == sep) { + for (j = i + 1; (j < l) & (buffer[j] == ' '); j++) + ; + + if ((j < l) | (i + 1 < j)) { + switch (buffer[j]) { + case '\t': + i = j; + c = '\t'; + break; + case 0: + i = j; + c = 0; + break; + } + } + } + if (c == '\t') { + for (; (j < l) & (buffer[j] == ' '); j++) + ; + if (j < l && buffer[j] == sep) { + buffer[j] = '\t'; + i = j - 1; + continue; + } + } + *dest++ = c; + } + *dest = 0; return buffer; } @@ -901,15 +923,17 @@ string NumToString(long num) int FindIgnoreCase(const string& expr, const string& query) { - icstring exprIC(expr.c_str()); - icstring queryIC(query.c_str()); - int pos = exprIC.find(queryIC); - return pos; + const char *p = expr.c_str(); + const char *r = strcasestr(p, query.c_str()); + + if (!r) + return string::npos; + return r - p; } bool EqualsNoCase(const string& a, const string& b) { - return (FindIgnoreCase(a,b) == 0 && a.size() == b.size()); + return strcasecmp(a.c_str(), b.c_str()) == 0; } string Strip(const string& input) diff --git a/menu_whatson.c b/menu_whatson.c index cecf205..8b393b5 100644 --- a/menu_whatson.c +++ b/menu_whatson.c @@ -173,7 +173,7 @@ bool cMenuMyScheduleItem::Update(bool Force) else { t[0] = event && hasMatch ? (timerMatch == tmFull) ? ((timer && timer->Recording())?'R':'T') : 't' : ' '; - v[0] = event && event->Vps() && (event->Vps() - event->StartTime()) ? 'V' : ' '; + v[0] = event && event->Vps() && (event->Vps() - event->StartTime()) ? 'V' : 'v'; r[0] = event && event->IsRunning() ? '*' : ' '; } @@ -201,7 +201,7 @@ bool cMenuMyScheduleItem::Update(bool Force) strreplace(buffer, '|', '\t'); char* title = NULL; - msprintf(&title, "%s", event?event->Title():tr(">>> no info! <<<")); + title = strdup(event?event->Title():tr(">>> no info! <<<")); title = strreplacei(title, ":", "%colon%"); // asume a title has the form "a?b:c", // we need to replace the colon to avoid misinterpretation the expression as a condition buffer = strreplacei(buffer, "%title%", title); @@ -229,8 +229,6 @@ bool cMenuMyScheduleItem::Update(bool Force) buffer = strreplacei(buffer, "$v_status$", v); buffer = strreplacei(buffer, "$r_status$", r); - - buffer = FixSeparators(buffer, '~'); buffer = FixSeparators(buffer, ':'); buffer = FixSeparators(buffer, '-'); diff --git a/po/es_ES.po b/po/es_ES.po index 60a9309..8b91643 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -68,20 +68,19 @@ msgid "search the EPG for repeats and more" msgstr "Buscar repeticiones en la EPG" msgid "Program guide" -msgstr "Guía de Programación" +msgstr "Guía de programación" -#, fuzzy msgid "search timer update running" -msgstr "¡Programación por búsqueda actualizada!" +msgstr "Actualizando programación por búsqueda" msgid "Direct access to epgsearch's search menu" -msgstr "Acceso directo al menú de búsqueda EPGSearch" +msgstr "Acceso directo al menú de búsquedas en EPG" msgid "Search" -msgstr "Buscar" +msgstr "Búsquedas en EPG" msgid "EpgSearch-Search in main menu" -msgstr "Buscar EPG en menú principal" +msgstr "Búsquedas en EPG en menú principal" msgid "Button$Help" msgstr "Ayuda" @@ -117,7 +116,7 @@ msgid "after user-def. times" msgstr "después hora-def." msgid "before 'next'" -msgstr "antes 'Después'" +msgstr "antes de 'Después'" msgid "General" msgstr "General" @@ -144,25 +143,25 @@ msgid "Hide main menu entry" msgstr "Ocultar entrada del menú principal" msgid "Help$Hides the main menu entry and may be useful if this plugin is used to replace the original 'Schedule' entry." -msgstr "Oculta la entrada del menú principal y puede ser útil si este plugin sustituye a la entrada 'Guía de Programación' original." +msgstr "Oculta la entrada del menú principal y puede ser útil si este plugin sustituye a la entrada 'Guía de programación' original." msgid "Main menu entry" msgstr "Entrada en el menú principal" msgid "Help$The name of the main menu entry which defaults to 'Programm guide'." -msgstr "El nombre de la entrada para el menú principal, que por defecto es 'Guía de Programación'." +msgstr "El nombre de la entrada para el menú principal, que por defecto es 'Guía de programación'." msgid "Replace original schedule" msgstr "Sustituir guía de prog. original" msgid "Help$When VDR is patched to allow this plugin to replace the original 'Schedule' entry, you can de/activate this replacement here." -msgstr "Aquí puede des/activar que éste plugin sustituya la entrada original 'Guía de Programación', pero sólo funciona cuando el VDR está parcheado para permitirlo." +msgstr "Aquí puede des/activar que éste plugin sustituya la entrada original 'Guía de programación', pero sólo funciona cuando el VDR está parcheado para permitirlo." msgid "Start menu" msgstr "Menú de inicio" msgid "Help$Choose between 'Overview - Now' and 'Schedule' as start menu when this plugin is called." -msgstr "Elija entre 'Ahora' y 'Guía de Programación' como menú inicial cuando se llama a este plugin." +msgstr "Elija entre 'Ahora' y 'Guía de programación' como menú inicial cuando se llama a este plugin." msgid "Ok key" msgstr "Botón OK" @@ -226,7 +225,7 @@ msgid "Show day separators" msgstr "Mostrar separadores de día" msgid "Help$Display a separator line at day break in 'Schedule'." -msgstr "Muestra una línea de separación al cambiar de día en la 'Guía de Programación'." +msgstr "Muestra una línea de separación al cambiar de día en la 'Guía de programación'." msgid "Show radio channels" msgstr "Mostrar los canales de radio" @@ -542,13 +541,13 @@ msgid "Auth user" msgstr "Usuario" msgid "Help$Specify the auth user, if this account needs authentication for SMTP." -msgstr "Si ésta cuenta necesita autenticación SMTP, especifique el usuario." +msgstr "Si esta cuenta necesita autenticación SMTP, especifique el usuario." msgid "Auth password" msgstr "Contraseña" msgid "Help$Specify the auth password, if this account needs authentication for SMTP." -msgstr "Si ésta cuenta necesita autenticación SMTP, especifique la contraseña." +msgstr "Si esta cuenta necesita autenticación SMTP, especifique la contraseña." msgid "Mail account check failed!" msgstr "¡Falló la prueba de cuenta de correo!" @@ -557,7 +556,7 @@ msgid "Button$Test" msgstr "Probar" msgid "$ abcdefghijklmnopqrstuvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&" -msgstr " aábcdeéfghiíjklmnñoópqrstuúvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&" +msgstr " aábcçdeéfghiíjklmnñoópqrstuúüvwxyz0123456789-_.,#~\\^$[]|()*+?{}/:%@&" msgid "Start/Stop time has changed" msgstr "Ha cambiado el tiempo inicial/final" @@ -642,7 +641,7 @@ msgid "channel group" msgstr "grupo de canales" msgid "only FTA" -msgstr "sin encriptar" +msgstr "sólo en abierto" msgid "Search term" msgstr "Buscar palabra" @@ -944,9 +943,8 @@ msgstr "Sólo avisar" msgid "Switch only" msgstr "Cambiar de canal" -#, fuzzy msgid "Announce and switch" -msgstr "Sólo avisar" +msgstr "Avisar y cambiar" msgid "Selection" msgstr "selección" @@ -961,7 +959,7 @@ msgid "count days" msgstr "incluir días" msgid "if present" -msgstr "" +msgstr "si existe" msgid "Template name" msgstr "Nombre de la plantilla" @@ -1007,13 +1005,13 @@ msgid "Help$Set this to 'Yes' if you like to search in the summary of an event." msgstr "Establecer a 'Sí' cuando desee buscar en el resumen de una emisión." msgid "Help$The summary of an event, can contain additional information like 'Genre', 'Category', 'Year',... called 'EPG categories' within EPGSearch. External EPG providers often deliver this information. This allows refining a search and other nice things, like searching for the 'tip of the day'. To use it set this to 'Yes'." -msgstr "El resumen de una emisión puede contener información adicional como 'Género', 'Categoría', 'Año', ... llamada 'categorías EPG' en el EPGSearch. A menudo los proveedores EPG externos ofrecen esta información. Ésto permite refinar una búsqueda y otras funcionalidades atractivas, como buscar por el 'consejo del día'. Para usarlo, establecer a 'Sí'." +msgstr "El resumen de una emisión puede contener información adicional como 'Género', 'Categoría', 'Año', ... llamada 'categorías EPG' en el EPGSearch. A menudo los proveedores EPG externos ofrecen esta información. Esto permite refinar una búsqueda y otras funcionalidades atractivas, como buscar por el 'consejo del día'. Para usarlo, establecer a 'Sí'." msgid "Help$The file epgsearchcats.conf specifies the search mode for this entry. One can search by text or by value. You can also edit a list of predefined values in this file that can be selected here." msgstr "El archivo epgsearchcats.conf especifica el modo de búsqueda de esta entrada. Se puede buscar por texto o por valor. También puede editar una lista de valores predefinidos en este archivo que puede seleccionar aquí." msgid "Help$If a selected category is not part of the summary of an event this normally excludes this event from the search results. To avoid this, set this option to 'Yes', but please handle this with care to avoid a huge amount of results." -msgstr "Si una categoría seleccionada no es parte del resumen de una emisión, normalmente esta no incluye ese evento en los resultados de la búsqueda. Para evitarlo establezca esta opción a 'Sí', pero maneje esto con cuidado para evitar una gran cantidad de resultados." +msgstr "Si una categoría seleccionada no es parte del resumen de una emisión, normalmente ésta no incluye ese evento en los resultados de la búsqueda. Para evitarlo establezca esta opción a 'Sí', pero maneje esto con cuidado para evitar una gran cantidad de resultados." msgid "Use in favorites menu" msgstr "Usar en el menú favoritos" @@ -1033,9 +1031,8 @@ msgstr "Cambiar ... minutos antes del inicio" msgid "Unmute sound" msgstr "Sonido quitar silencio" -#, fuzzy msgid "Ask ... minutes before start" -msgstr "Cambiar ... minutos antes del inicio" +msgstr "Preguntar ... minutos antes del inicio" msgid " Series recording" msgstr " Grabación en serie" @@ -1128,7 +1125,7 @@ msgid "Button$all channels" msgstr "todos los canales" msgid "Button$only FTA" -msgstr "sin encriptar" +msgstr "sólo en abierto" msgid "Button$Timer preview" msgstr "Previsualizar programación" @@ -1154,13 +1151,11 @@ msgstr "¿Sobrescribir las entradas existentes?" msgid "Edit entry" msgstr "Editar entrada" -#, fuzzy msgid "Switch" -msgstr "Cambiar de canal" +msgstr "Cambiar" -#, fuzzy msgid "Announce ... minutes before start" -msgstr "Cambiar ... minutos antes del inicio" +msgstr "Avisar ... minutos antes del inicio" msgid "action at" msgstr "ejecutar a las" @@ -1175,7 +1170,7 @@ msgid "Timers" msgstr "Programaciones" msgid ">>> no info! <<<" -msgstr ">>> ¡sin información! <<<" +msgstr " «sin información» " msgid "Overview" msgstr "Resumen" @@ -1201,7 +1196,7 @@ msgstr "¡Programación por búsqueda actualizada!" #, c-format msgid "Switch to (%d) '%s'?" -msgstr "" +msgstr "¿Cambiar a (%d) '%s'?" msgid "Programming timer failed!" msgstr "¡La programación ha fallado!" diff --git a/searchtimer_thread.c b/searchtimer_thread.c index 57d69e9..687656f 100644 --- a/searchtimer_thread.c +++ b/searchtimer_thread.c @@ -769,6 +769,8 @@ void cSearchTimerThread::CheckExpiredRecs() if (searchName) free(searchName); continue; } + free(searchID); + free(searchName); LogFile.Log(3, "recording triggered from search timer %s", search->search); if (search->delAfterDays == 0) continue; time_t now = time(NULL); diff --git a/templatefile.c b/templatefile.c index 5b01534..102be37 100644 --- a/templatefile.c +++ b/templatefile.c @@ -145,9 +145,11 @@ cMenuTemplate* cTemplFile::GetTemplateByName(const char* Name) bool cTemplFile::Load(const char *FileName) { +#if APIVERSNUM >= 10503 // auto-enable WarEagle-Icons if VDRSymbols font is used if (strstr(Setup.FontOsd, "VDRSymbols") == Setup.FontOsd) EPGSearchConfig.WarEagle = 1; +#endif if (cConfig<cTemplLine>::Load(FileName, true)) { |