summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/config.c b/config.c
index d795033..084ba76 100644
--- a/config.c
+++ b/config.c
@@ -261,20 +261,29 @@ void cNopacityConfig::loadRssFeeds(void) {
void cNopacityConfig::SetLogoPath(cString path) {
- logoPath = path;
+ logoPath = checkSlashAtEnd(*path);
logoPathSet = true;
}
void cNopacityConfig::SetIconPath(cString path) {
- iconPath = path;
+ iconPath = checkSlashAtEnd(*path);
iconPathSet = true;
}
void cNopacityConfig::SetEpgImagePath(cString path) {
- epgImagePath = path;
+ epgImagePath = checkSlashAtEnd(*path);
epgImagePathSet = true;
}
+cString cNopacityConfig::checkSlashAtEnd(std::string path) {
+ try {
+ if (!(path.at(path.size()-1) == '/'))
+ return cString::sprintf("%s/", path.c_str());
+ } catch (...) {return path.c_str();}
+ return path.c_str();
+}
+
+
bool cNopacityConfig::SetupParse(const char *Name, const char *Value) {
if (strcmp(Name, "fontIndex") == 0) fontIndex = atoi(Value);
else if (strcmp(Name, "channelFadeTime") == 0) channelFadeTime = atoi(Value);