From ca759e5691df7d907fb523f7a5f3b32a51324892 Mon Sep 17 00:00:00 2001 From: svntcreutz Date: Fri, 27 Jul 2007 01:41:30 +0000 Subject: again fixes (~3 bugs left) git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/submenu/trunk@5649 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f --- src/xmlmenu.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/xmlmenu.cpp') diff --git a/src/xmlmenu.cpp b/src/xmlmenu.cpp index 1a66981..e63b455 100644 --- a/src/xmlmenu.cpp +++ b/src/xmlmenu.cpp @@ -41,7 +41,7 @@ void XmlMenu::loadXmlMenu() } } -void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode *parentNode) +void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode* parentNode) { const ContentNode* nodeContent = dynamic_cast(a_node); const TextNode* nodeText = dynamic_cast(a_node); @@ -82,6 +82,7 @@ void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode *paren { const Attribute* attribute = *iter; //cout << Parent << "-" << MainMenuIndex << "-" << myMenuNr << "-SystemItem=" << attribute->get_value() << endl; + //TODO: search a valid cast/convert code if (parentNode == NULL) newparentNode =_rootMenuNode.AddChild(new VdrMenuItem(tr((const char*) attribute->get_value()), geteOSState(attribute->get_value()))); else @@ -98,6 +99,7 @@ void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode *paren { const Attribute* attribute = *iter; //cout << Parent << "-" << MainMenuIndex << "-" << myMenuNr << "-MenuItem=" << attribute->get_value() << endl; + //TODO: search a valid cast/convert code if (parentNode == NULL) newparentNode =_rootMenuNode.AddChild(new SubMenuItem((const char*) attribute->get_value())); else @@ -114,16 +116,18 @@ void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode *paren { const Attribute* attribute = *iter; //cout << Parent << "-" << MainMenuIndex << "-" << myMenuNr << "-PluginItem=" << attribute->get_value() << endl; - if (getPluginIndex(attribute->get_value()) != NULL) + //TODO: get this running! +/* + PluginItemAndIndex *myPlugin = getPlugin(attribute->get_value()); + if (myPlugin) { - PluginItemAndIndex myPlugin = getPluginIndex(attribute->get_value()); if (parentNode == NULL) - newparentNode =_rootMenuNode.AddChild(new PluginMenuItem(myPlugin.item, myPlugin.index)); + newparentNode =_rootMenuNode.AddChild(new PluginMenuItem(myPlugin->item, myPlugin->index)); else - newparentNode = parentNode->AddChild(new PluginMenuItem(myPlugin.item, myPlugin.index)); + newparentNode = parentNode->AddChild(new PluginMenuItem(myPlugin->item, myPlugin->index)); } +*/ } - //subMenu2->AddChild(new PluginMenuItem(item, i)); } } } @@ -133,7 +137,7 @@ void XmlMenu::parseNode(const Node* a_node, unsigned int Parent, MenuNode *paren Node::NodeList list = a_node->get_children(); for(Node::NodeList::iterator iter = list.begin(); iter != list.end(); ++iter) { - parseNode(*iter, Parent+1, newparentNode); //recursive + parseNode(*iter, Parent+1, *newparentNode); //recursive } } } -- cgit v1.2.3