Fixed displaying the error log message in case an unknown plugin was requested in a key macro

This commit is contained in:
Klaus Schmidinger 2006-10-14 10:06:16 +02:00
parent 6a15d77429
commit 7bed3fd6ba
3 changed files with 18 additions and 11 deletions

View File

@ -1827,6 +1827,8 @@ Petri Hintukainen <Petri.Hintukainen@hut.fi>
.update file after the last NeedsUpdate() check .update file after the last NeedsUpdate() check
for fixing a possible crash if cPluginManager::GetPlugin() is called with a NULL for fixing a possible crash if cPluginManager::GetPlugin() is called with a NULL
pointer pointer
for fixing displaying the error log message in case an unknown plugin was requested
in a key macro
Marcel Schaeben <mts280@gmx.de> Marcel Schaeben <mts280@gmx.de>
for his "Easy Input" patch for his "Easy Input" patch

View File

@ -4958,3 +4958,5 @@ Video Disk Recorder Revision History
- Updated the Hungarian language texts (thanks to Guido Josten). - Updated the Hungarian language texts (thanks to Guido Josten).
- Fixed a possible crash if cPluginManager::GetPlugin() is called with a NULL - Fixed a possible crash if cPluginManager::GetPlugin() is called with a NULL
pointer (thanks to Petri Hintukainen). 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).

25
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/vdr * 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 <getopt.h> #include <getopt.h>
@ -923,17 +923,20 @@ int main(int argc, char *argv[])
case kCommands: DirectMainFunction(osCommands); break; case kCommands: DirectMainFunction(osCommands); break;
case kUser1 ... kUser9: cRemote::PutMacro(key); key = kNone; break; case kUser1 ... kUser9: cRemote::PutMacro(key); key = kNone; break;
case k_Plugin: { case k_Plugin: {
DELETE_MENU; const char *PluginName = cRemote::GetPlugin();
if (cControl::Control()) if (PluginName) {
cControl::Control()->Hide(); DELETE_MENU;
cPlugin *plugin = cPluginManager::GetPlugin(cRemote::GetPlugin()); if (cControl::Control())
if (plugin) { cControl::Control()->Hide();
Menu = plugin->MainMenuAction(); cPlugin *plugin = cPluginManager::GetPlugin(PluginName);
if (Menu) if (plugin) {
Menu->Show(); 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 key = kNone; // nobody else needs to see these keys
} }
break; break;