diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/menuorg.cpp | 6 | ||||
-rw-r--r-- | src/menuorg.h | 2 | ||||
-rw-r--r-- | src/xmlmenu.cpp | 8 | ||||
-rw-r--r-- | src/xmlmenu.h | 2 |
4 files changed, 8 insertions, 10 deletions
diff --git a/src/menuorg.cpp b/src/menuorg.cpp index 2dee9c6..a0188ef 100644 --- a/src/menuorg.cpp +++ b/src/menuorg.cpp @@ -13,7 +13,9 @@ #include "version.h" #include "menuorg.h" #include "i18n.h" +#include <string> +using namespace std; using namespace SubMenuPatch; MenuOrgPlugin::MenuOrgPlugin(void) @@ -67,7 +69,9 @@ bool MenuOrgPlugin::Initialize(void) { XmlMenu xmlMenu; - MenuNode* menu = xmlMenu.LoadXmlMenu(); + string configFile = (string) ConfigDirectory() + "/menuorg.xml"; + + MenuNode* menu = xmlMenu.LoadXmlMenu(configFile); if (menu) { _subMenuProvider = new SubMenuProvider(menu); diff --git a/src/menuorg.h b/src/menuorg.h index f6ca6be..5f7aa2a 100644 --- a/src/menuorg.h +++ b/src/menuorg.h @@ -2,8 +2,6 @@ #define ___MENUORGPLUGIN_H #include <vdr/plugin.h> -//#include <vdr/config.h> -//#include <vdr/tools.h> #include "submenuprovider.h" using namespace SubMenuPatch; diff --git a/src/xmlmenu.cpp b/src/xmlmenu.cpp index b3dea53..d2308ca 100644 --- a/src/xmlmenu.cpp +++ b/src/xmlmenu.cpp @@ -10,12 +10,8 @@ using namespace xmlpp; using namespace std; -MenuNode* XmlMenu::LoadXmlMenu() +MenuNode* XmlMenu::LoadXmlMenu(string menuFileName) { - // TODO: show how vdr handels the path vars (developer doc) - // and change code for dynamic path vars - const char *File = "/var/lib/vdr/plugins/vdr-menu.xml"; - MenuNode* menuRoot = new MenuNode(); try @@ -25,7 +21,7 @@ MenuNode* XmlMenu::LoadXmlMenu() //TODO: patch the xmlfile with the xsd definition for validate the schema //parser.set_validate(); parser.set_substitute_entities(); //We just want the text to be resolved/unescaped automatically. - parser.parse_file(File); + parser.parse_file(menuFileName); const Element* rootElement = parser.get_document()->get_root_node(); diff --git a/src/xmlmenu.h b/src/xmlmenu.h index 4342d3d..59cf059 100644 --- a/src/xmlmenu.h +++ b/src/xmlmenu.h @@ -10,7 +10,7 @@ namespace xmlpp { class Element; } class XmlMenu { public: - MenuNode* LoadXmlMenu(); + MenuNode* LoadXmlMenu(std::string menuFileName); private: void ParseElement(const xmlpp::Element* a_node, MenuNode* menuNode); |