summaryrefslogtreecommitdiff
path: root/config.c
blob: 47333684e26960f2dc446596d7845eeaf017814e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "config.h"

cFlatConfig::cFlatConfig(void) {
    logoPath = "";
    iconPath = "";
}

cFlatConfig::~cFlatConfig(void) {
}


void cFlatConfig::Init(void) {
    if( !strcmp(logoPath, "") )
        logoPath = cString::sprintf("%s/logos/", PLUGINRESOURCEPATH);
    dsyslog("skinflat: logopath: %s", *logoPath);
    if( !strcmp(iconPath, "") )
        iconPath = cString::sprintf("%s/icons/", PLUGINRESOURCEPATH);
    dsyslog("skinflat: iconPath: %s", *iconPath);
}

void cFlatConfig::SetLogoPath(cString path) {
    logoPath = checkSlashAtEnd(*path);
}

cString cFlatConfig::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();
}