summaryrefslogtreecommitdiff
path: root/plugin.c
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2011-09-23 21:42:27 +0200
committermrwastl <mrwastl@users.sourceforge.net>2011-09-23 21:42:27 +0200
commit26af9d11d1802df2c4a151c537b1a5c5c07f0dfe (patch)
tree814b8ceb6810e6e4173ec738ea5b08287edbcc36 /plugin.c
parenta651288e07c48d120dc63160236072a028192c4e (diff)
downloadvdr-plugin-graphlcd-26af9d11d1802df2c4a151c537b1a5c5c07f0dfe.tar.gz
vdr-plugin-graphlcd-26af9d11d1802df2c4a151c537b1a5c5c07f0dfe.tar.bz2
fixed retrieval of configDir; fixed a typo in a help information
Diffstat (limited to 'plugin.c')
-rw-r--r--plugin.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/plugin.c b/plugin.c
index cbf11a5..ef36aad 100644
--- a/plugin.c
+++ b/plugin.c
@@ -76,6 +76,7 @@ private:
std::string mSkinNames;
std::string mConfigName;
std::string mSkinsPath;
+ std::string mConfigDir;
tDisplayData mDisplay[GRAPHLCD_MAX_DISPLAYS];
cExtData * mExtData;
@@ -230,9 +231,15 @@ bool cPluginGraphLCD::Initialize()
mDisplay[index].Skin = mSkinNames.substr(pos1, (pos2 == std::string::npos) ? pos2 : pos2 - pos1);
index++;
}
- while (pos2 != std::string::npos && index < GRAPHLCD_MAX_DISPLAYS);
-
-
+ while (pos2 != std::string::npos && index < GRAPHLCD_MAX_DISPLAYS);
+
+ const char* tempConfigDir = ConfigDirectory(kPluginName);
+ if (!tempConfigDir) {
+ return false;
+ } else {
+ mConfigDir = tempConfigDir;
+ }
+
bool connecting = false;
for (unsigned int i = 0; i < GRAPHLCD_MAX_DISPLAYS; i++)
{
@@ -274,8 +281,6 @@ int cPluginGraphLCD::DisplayIndex(std::string displayName)
bool cPluginGraphLCD::ConnectDisplay(unsigned int index, unsigned int displayNumber)
{
- const char *cfgDir;
-
mDisplay[index].Driver = GLCD::CreateDriver(GLCD::Config.driverConfigs[displayNumber].id, &GLCD::Config.driverConfigs[displayNumber]);
if (!mDisplay[index].Driver)
{
@@ -284,12 +289,6 @@ bool cPluginGraphLCD::ConnectDisplay(unsigned int index, unsigned int displayNum
return false;
}
- cfgDir = ConfigDirectory(kPluginName);
- if (!cfgDir) {
- mDisplay[index].Status = DEAD;
- return false;
- }
-
mDisplay[index].Disp = new cGraphLCDDisplay();
if (!mDisplay[index].Disp) {
mDisplay[index].Status = DEAD;
@@ -297,7 +296,7 @@ bool cPluginGraphLCD::ConnectDisplay(unsigned int index, unsigned int displayNum
}
if (mDisplay[index].Skin == "")
mDisplay[index].Skin = "default";
- if (!mDisplay[index].Disp->Initialise(mDisplay[index].Driver, cfgDir, mSkinsPath, mDisplay[index].Skin)) {
+ if (!mDisplay[index].Disp->Initialise(mDisplay[index].Driver, mConfigDir.c_str(), mSkinsPath, mDisplay[index].Skin)) {
mDisplay[index].Status = DEAD;
return false;
}
@@ -508,7 +507,7 @@ cString cPluginGraphLCD::SVDRPCommand(const char *Command, const char *Option, i
retval += buf;
return retval.c_str();
}
- return "CONNECT requires up to three parameters: CONNECT [<display> [<skin>]].";
+ return "CONNECT requires up to two parameters: CONNECT [<display> [<skin>]].";
} else
if (strcasecmp(Command, "DISCONN") == 0 || strcasecmp(Command, "DISCONNECT") == 0 ) {
if ( options.size() >= 0 && options.size() < 2 ) {