mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 12:36:17 +02:00
Use function getSkinPath() instead of reading the dir of the binary
... which was certain to fail as the skins are not located on /usr/bin.
This commit is contained in:
parent
a21650d6b3
commit
cf20f3673e
@ -43,7 +43,7 @@ ImageDialog::ImageDialog(
|
||||
string path;
|
||||
|
||||
if (!file.empty()) {
|
||||
path = strreplace(file, "skin:", gmenu2x->getExePath()+"skins/"+gmenu2x->confStr["skin"]+"/");
|
||||
path = strreplace(file, "skin:", gmenu2x->sc.getSkinPath(gmenu2x->confStr["skin"]));
|
||||
string::size_type pos = path.rfind("/");
|
||||
if (pos != string::npos)
|
||||
setPath(path.substr(0, pos));
|
||||
|
@ -84,7 +84,7 @@ const string &Link::getIcon() {
|
||||
}
|
||||
|
||||
void Link::setIcon(const string &icon) {
|
||||
string skinpath = gmenu2x->getExePath()+"skins/"+gmenu2x->confStr["skin"];
|
||||
string skinpath = gmenu2x->sc.getSkinPath(gmenu2x->confStr["skin"]);
|
||||
|
||||
if (icon.substr(0,skinpath.length()) == skinpath) {
|
||||
string tempIcon = icon.substr(skinpath.length(), icon.length());
|
||||
@ -99,7 +99,7 @@ void Link::setIcon(const string &icon) {
|
||||
|
||||
iconPath = strreplace(this->icon,"skin:",skinpath+"/");
|
||||
if (iconPath.empty() || !fileExists(iconPath)) {
|
||||
iconPath = strreplace(this->icon,"skin:",gmenu2x->getExePath()+"skins/Default/");
|
||||
iconPath = strreplace(this->icon,"skin:",gmenu2x->sc.getSkinPath("Default"));
|
||||
if (!fileExists(iconPath)) searchIcon();
|
||||
}
|
||||
|
||||
|
@ -40,10 +40,10 @@ void MenuSettingImage::edit() {
|
||||
}
|
||||
|
||||
void MenuSettingImage::setValue(const string &value) {
|
||||
string skinpath(gmenu2x->getExePath() + "skins/" + gmenu2x->confStr["skin"]);
|
||||
string skinpath(gmenu2x->sc.getSkinPath(gmenu2x->confStr["skin"]));
|
||||
bool inSkinDir = value.substr(0, skinpath.length()) == skinpath;
|
||||
if (!inSkinDir && gmenu2x->confStr["skin"] != "Default") {
|
||||
skinpath = gmenu2x->getExePath() + "skins/Default";
|
||||
skinpath = gmenu2x->sc.getSkinPath("Default");
|
||||
inSkinDir = value.substr(0, skinpath.length()) == skinpath;
|
||||
}
|
||||
if (inSkinDir) {
|
||||
|
Loading…
Reference in New Issue
Block a user