summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsvntobi <svntobi@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-08-11 15:26:03 +0000
committersvntobi <svntobi@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-08-11 15:26:03 +0000
commit51cf7b47ffd152f62cb187daeec12606bbd57883 (patch)
treed50f92d2cde2985e77ae9e3a18dc13c97a45f859 /src
parentac017fe51eb1a457d8ae87884252ab2f7ed79eee (diff)
downloadvdr-plugin-menuorg-51cf7b47ffd152f62cb187daeec12606bbd57883.tar.gz
vdr-plugin-menuorg-51cf7b47ffd152f62cb187daeec12606bbd57883.tar.bz2
Load menu from menuorg.xml in VDR's plugin config dir
git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/submenu/trunk@5676 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f
Diffstat (limited to 'src')
-rw-r--r--src/menuorg.cpp6
-rw-r--r--src/menuorg.h2
-rw-r--r--src/xmlmenu.cpp8
-rw-r--r--src/xmlmenu.h2
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);