summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranbr <vdr07@deltab.de>2012-06-04 16:42:12 +0200
committeranbr <vdr07@deltab.de>2012-06-04 16:42:12 +0200
commita6193931be12663aa381e5a7d0b14613e613ddd8 (patch)
tree6fd807aa872fde9e8528fa6edbbb34153a95fe5b
parentb8b00fd3d3a9f6454fc8a299e765dc7e2bcad47b (diff)
downloadvdr-plugin-dvdswitch-a6193931be12663aa381e5a7d0b14613e613ddd8.tar.gz
vdr-plugin-dvdswitch-a6193931be12663aa381e5a7d0b14613e613ddd8.tar.bz2
Hold current MainMenuItem as constant data
-rw-r--r--commands.c6
-rw-r--r--commands.h6
-rw-r--r--dvdplugin.c2
-rw-r--r--dvdplugin.h2
-rw-r--r--menu-item.h4
-rw-r--r--menu.c2
6 files changed, 11 insertions, 11 deletions
diff --git a/commands.c b/commands.c
index 82d1e85..1d7bf5a 100644
--- a/commands.c
+++ b/commands.c
@@ -11,7 +11,7 @@
#include "volname.h"
// --- cCMD ----------------------------------------------------------
-eOSState cCMD::Play(cMainMenuItem *item)
+eOSState cCMD::Play(const cMainMenuItem *item)
{
if(item)
isyslog("dvdswitch: play %s, %i", item->FileName(), item->Type());
@@ -40,7 +40,7 @@ eOSState cCMD::Eject(bool close)
// --- cCMDMenu -------------------------------------------------------------
-cCMDMenu::cCMDMenu(cImageList &imagelist, cMainMenuItem *item, cMainMenu *osdobject)
+cCMDMenu::cCMDMenu(cImageList &imagelist, const cMainMenuItem *item, cMainMenu *osdobject)
: cOsdMenu(tr("Commands"))
, ImageList(imagelist)
{
@@ -312,7 +312,7 @@ eOSState cCMDDir::ProcessKey(eKeys Key)
}
else
{
- char *seldir = mItem->FileName();
+ const char *seldir = mItem->FileName();
for (unsigned int i = 0; i < strlen(DVDSwitchSetup.ImageDir); i++)
seldir++;
if(seldir[0] == '/')
diff --git a/commands.h b/commands.h
index 32efd10..e7d402f 100644
--- a/commands.h
+++ b/commands.h
@@ -35,7 +35,7 @@ enum eCMDState
class cCMD
{
public:
- static eOSState Play(cMainMenuItem *item = NULL);
+ static eOSState Play(const cMainMenuItem *item = NULL);
static eOSState Eject(bool close = false);
};
@@ -43,11 +43,11 @@ class cCMD
class cCMDMenu : public cOsdMenu
{
private:
- cMainMenuItem *iItem;
+ const cMainMenuItem *iItem;
cMainMenu *OsdObject;
cImageList &ImageList;
public:
- cCMDMenu(cImageList &ImageList, cMainMenuItem *item, cMainMenu *osdobject);
+ cCMDMenu(cImageList &ImageList, const cMainMenuItem *item, cMainMenu *osdobject);
virtual eOSState ProcessKey(eKeys Key);
};
diff --git a/dvdplugin.c b/dvdplugin.c
index b3044f1..5d1888a 100644
--- a/dvdplugin.c
+++ b/dvdplugin.c
@@ -148,7 +148,7 @@ void cDVDPlugin::SetLink(void)
}
}
-void cDVDPlugin::Start(char *image)
+void cDVDPlugin::Start(const char *image)
{
if(!thread)
{
diff --git a/dvdplugin.h b/dvdplugin.h
index 499093e..d6268bb 100644
--- a/dvdplugin.h
+++ b/dvdplugin.h
@@ -27,7 +27,7 @@ class cDVDPlugin
cFileCMD::Del(DVDSwitchSetup.DVDLink);
};
public:
- static void Start(char *image = NULL);
+ static void Start(const char *image = NULL);
static void Exit(void);
static void ChangeLink(const char *target, const char *link);
static void Init(void)
diff --git a/menu-item.h b/menu-item.h
index 6522e88..3cc2557 100644
--- a/menu-item.h
+++ b/menu-item.h
@@ -23,8 +23,8 @@ class cMainMenuItem : public cOsdItem
cMainMenuItem(eMainMenuItem itype, cImageList &ImageList, const char *file = NULL);
~cMainMenuItem(void);
- eMainMenuItem Type(void) { return iType; };
- char* FileName(void) { return File; };
+ eMainMenuItem Type(void) const { return iType; };
+ const char* FileName(void) const { return File; };
};
#endif // __MENUITEM_DVDSWITCH_H
diff --git a/menu.c b/menu.c
index b4fe18d..09a0ae2 100644
--- a/menu.c
+++ b/menu.c
@@ -787,7 +787,7 @@ eOSState cMainMenu::SelectItem(void)
eOSState cMainMenu::Commands(eKeys Key)
{
- cMainMenuItem *mItem = (cMainMenuItem*)Get(Current());
+ const cMainMenuItem *mItem = (const cMainMenuItem*)Get(Current());
eCMDs cmd = cmdNone;
cCMDImage *CMDImage = NULL;