summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2010-08-02 22:20:20 +0200
committerJochen Dolze <vdr@dolze.de>2010-08-02 22:20:20 +0200
commitbdcd398b28d73222ae9aec843f7ef56f63411365 (patch)
tree771e2d3d8da8b8e3d6802f734199dd0c88d6e16f
parentf79593139e7c46f7ce92711229485a46fa5d7c58 (diff)
downloadvdr-plugin-tvonscreen-bdcd398b28d73222ae9aec843f7ef56f63411365.tar.gz
vdr-plugin-tvonscreen-bdcd398b28d73222ae9aec843f7ef56f63411365.tar.bz2
Fixed config logo path bug
-rw-r--r--config.cpp51
-rw-r--r--config.h5
-rw-r--r--magazine.cpp10
3 files changed, 26 insertions, 40 deletions
diff --git a/config.cpp b/config.cpp
index fc85d8c..5b8d77a 100644
--- a/config.cpp
+++ b/config.cpp
@@ -12,6 +12,8 @@
#include <unistd.h>
#include <vdr/menuitems.h>
+extern int getTL_YSTART();
+
tvonscreenConfig tvonscreenCfg;
tvonscreenConfig::tvonscreenConfig(void)
@@ -29,15 +31,8 @@ tvonscreenConfig::tvonscreenConfig(void)
thenshownextday=true;
showsearchinitiator=true;
- logos=NULL;
- vdradminfile=NULL;
-}
-tvonscreenConfig::~tvonscreenConfig()
-{
- if (logos)
- free(logos);
- if (vdradminfile)
- free(vdradminfile);
+ memset(logos,0,sizeof(logos));
+ memset(vdradminfile,0,sizeof(vdradminfile));
}
bool tvonscreenConfig::SetupParse(const char *Name, const char *Value)
@@ -81,21 +76,13 @@ bool tvonscreenConfig::ProcessArgs(int argc, char *argv[])
switch (c)
{
case 'l':
- if (logos)
- {
- free(logos);
- logos=NULL;
- }
- logos = strdup(optarg);
+ strncpy(logos,optarg,sizeof(logos)-1);
+ logos[sizeof(logos)-1]=0;
retval=true;
break;
case 'v':
- if (vdradminfile)
- {
- free(vdradminfile);
- vdradminfile=NULL;
- }
- vdradminfile = strdup(optarg);
+ strncpy(vdradminfile,optarg,sizeof(vdradminfile)-1);
+ vdradminfile[sizeof(vdradminfile)-1]=0;
retval=true;
break;
default:
@@ -110,17 +97,17 @@ bool tvonscreenConfig::ProcessArgs(int argc, char *argv[])
tvonscreenConfigPage::tvonscreenConfigPage(void) : cMenuSetupPage()
{
m_NewConfig = tvonscreenCfg;
-
-#if TL_YSTART == 48
- Add(new cMenuEditBoolItem(tr("show channel logos"),
- &m_NewConfig.showLogos));
- Add(new cMenuEditBoolItem(tr("show channel names"),
- &m_NewConfig.showChannels));
- Add(new cMenuEditBoolItem(tr("show logos in black&white"),
- &m_NewConfig.bwlogos));
- Add(new cMenuEditBoolItem(tr("enable color problem work around"),
- &m_NewConfig.colorworkaround));
-#endif
+ if (getTL_YSTART()>24)
+ {
+ Add(new cMenuEditBoolItem(tr("show channel logos"),
+ &m_NewConfig.showLogos));
+ Add(new cMenuEditBoolItem(tr("show channel names"),
+ &m_NewConfig.showChannels));
+ Add(new cMenuEditBoolItem(tr("show logos in black&white"),
+ &m_NewConfig.bwlogos));
+ Add(new cMenuEditBoolItem(tr("enable color problem work around"),
+ &m_NewConfig.colorworkaround));
+ }
Add(new cMenuEditBoolItem(tr("use XL fonts"),
&m_NewConfig.XLfonts));
Add(new cMenuEditBoolItem(tr("hide info line"),
diff --git a/config.h b/config.h
index 7dc9bbe..5b4b4be 100644
--- a/config.h
+++ b/config.h
@@ -16,7 +16,6 @@ class tvonscreenConfig
public:
tvonscreenConfig(void);
- ~tvonscreenConfig();
bool SetupParse(const char *Name, const char *Value);
bool ProcessArgs(int argc, char *argv[]);
const char *CommandLineHelp(void);
@@ -33,8 +32,8 @@ public:
int thenshownextday;
int showsearchinitiator;
- char *logos;
- char *vdradminfile;
+ char logos[PATH_MAX];
+ char vdradminfile[PATH_MAX];
};
extern tvonscreenConfig tvonscreenCfg;
diff --git a/magazine.cpp b/magazine.cpp
index b2af77f..ee2df16 100644
--- a/magazine.cpp
+++ b/magazine.cpp
@@ -1009,11 +1009,11 @@ void magazine::Show(void)
delete f4;
delete f5;
- f1=new anyFont(osd,(round(12*Width) / 720),1); // Sendung
- f2=new anyFont(osd,(round(11*Width) / 720),1); // Extra-Info
- f3=new anyFont(osd,(round(12*Width) / 720),1); // Sender
- f4=new anyFont(osd,(round(11*Width) / 720)); // Tasten
- f5=new anyFont(osd,(round(11*Width) / 720)); // Datum
+ f1=new anyFont(osd,(round(12*Width) / Height),1); // Sendung
+ f2=new anyFont(osd,(round(11*Width) / Height),1); // Extra-Info
+ f3=new anyFont(osd,(round(12*Width) / Height),1); // Sender
+ f4=new anyFont(osd,(round(11*Width) / Height)); // Tasten
+ f5=new anyFont(osd,(round(11*Width) / Height)); // Datum
for (int i=0; i < (int)(sizeof(Areas)/sizeof(tArea)); i++)
{