diff options
author | anbr <vdr07@deltab.de> | 2012-06-04 16:42:12 +0200 |
---|---|---|
committer | anbr <vdr07@deltab.de> | 2012-06-04 16:42:12 +0200 |
commit | a6193931be12663aa381e5a7d0b14613e613ddd8 (patch) | |
tree | 6fd807aa872fde9e8528fa6edbbb34153a95fe5b | |
parent | b8b00fd3d3a9f6454fc8a299e765dc7e2bcad47b (diff) | |
download | vdr-plugin-dvdswitch-a6193931be12663aa381e5a7d0b14613e613ddd8.tar.gz vdr-plugin-dvdswitch-a6193931be12663aa381e5a7d0b14613e613ddd8.tar.bz2 |
Hold current MainMenuItem as constant data
-rw-r--r-- | commands.c | 6 | ||||
-rw-r--r-- | commands.h | 6 | ||||
-rw-r--r-- | dvdplugin.c | 2 | ||||
-rw-r--r-- | dvdplugin.h | 2 | ||||
-rw-r--r-- | menu-item.h | 4 | ||||
-rw-r--r-- | menu.c | 2 |
6 files changed, 11 insertions, 11 deletions
@@ -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] == '/') @@ -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 @@ -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; |