From 7bed3fd6ba154c108872f357a9e8e247122da411 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 14 Oct 2006 10:06:16 +0200 Subject: [PATCH] Fixed displaying the error log message in case an unknown plugin was requested in a key macro --- CONTRIBUTORS | 2 ++ HISTORY | 2 ++ vdr.c | 25 ++++++++++++++----------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 58985ed5..c675dfc7 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1827,6 +1827,8 @@ Petri Hintukainen .update file after the last NeedsUpdate() check for fixing a possible crash if cPluginManager::GetPlugin() is called with a NULL pointer + for fixing displaying the error log message in case an unknown plugin was requested + in a key macro Marcel Schaeben for his "Easy Input" patch diff --git a/HISTORY b/HISTORY index 175cb208..292424ed 100644 --- a/HISTORY +++ b/HISTORY @@ -4958,3 +4958,5 @@ Video Disk Recorder Revision History - Updated the Hungarian language texts (thanks to Guido Josten). - Fixed a possible crash if cPluginManager::GetPlugin() is called with a NULL pointer (thanks to Petri Hintukainen). +- Fixed displaying the error log message in case an unknown plugin was requested + in a key macro (thanks to Petri Hintukainen). diff --git a/vdr.c b/vdr.c index 46d65c84..73c5c918 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.279 2006/09/01 12:57:44 kls Exp $ + * $Id: vdr.c 1.280 2006/10/14 10:01:32 kls Exp $ */ #include @@ -923,17 +923,20 @@ int main(int argc, char *argv[]) case kCommands: DirectMainFunction(osCommands); break; case kUser1 ... kUser9: cRemote::PutMacro(key); key = kNone; break; case k_Plugin: { - DELETE_MENU; - if (cControl::Control()) - cControl::Control()->Hide(); - cPlugin *plugin = cPluginManager::GetPlugin(cRemote::GetPlugin()); - if (plugin) { - Menu = plugin->MainMenuAction(); - if (Menu) - Menu->Show(); + const char *PluginName = cRemote::GetPlugin(); + if (PluginName) { + DELETE_MENU; + if (cControl::Control()) + cControl::Control()->Hide(); + cPlugin *plugin = cPluginManager::GetPlugin(PluginName); + if (plugin) { + Menu = plugin->MainMenuAction(); + if (Menu) + Menu->Show(); + } + else + esyslog("ERROR: unknown plugin '%s'", PluginName); } - else - esyslog("ERROR: unknown plugin '%s'", cRemote::GetPlugin()); key = kNone; // nobody else needs to see these keys } break;