Skip to content

Commit

Permalink
Only display plugin menu items if the plugin has successfully loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartm committed Nov 18, 2012
1 parent a75dd13 commit 8bfc700
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions mythtv/libs/libmythui/myththemedmenu.cpp
Expand Up @@ -29,6 +29,9 @@
#include "mythversion.h"
#include "mythdate.h"

// libmythbase headers
#include "mythplugin.h"

MythThemedMenuState::MythThemedMenuState(MythScreenStack *parent,
const QString &name)
: MythScreenType(parent, name),
Expand Down Expand Up @@ -842,17 +845,17 @@ bool MythThemedMenu::findDepends(const QString &fileList)
{
QStringList files = fileList.split(" ");
QString filename;
MythPluginManager *pluginManager = gCoreContext->GetPluginManager();

for (QStringList::Iterator it = files.begin(); it != files.end(); ++it )
{
QString filename = findMenuFile(*it);
if (!filename.isEmpty() && filename.endsWith(".xml"))
return true;

QString newname = FindPluginName(*it);

QFile checkFile(newname);
if (checkFile.exists())
// Has plugin by this name been successfully loaded
MythPlugin *plugin = pluginManager->GetPlugin(*it);
if (plugin)
return true;
}

Expand Down

0 comments on commit 8bfc700

Please sign in to comment.