1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-26 19:50:35 +02:00

Removed ability to configure custom working directory.

Working directory was only configurable in the ini files, not in the GUI.

Many GP2X/Dingoo applications break if the working directory is changed
because they use relative paths for locating their data files.

I don't see a reason to keep this feature, since I don't know of a realistic
scenario where it would be useful. In any case, the functionality can be
re-created by using a wrapper script to change the working directory based on
a parameter value.
This commit is contained in:
Maarten ter Huurne 2011-12-23 15:20:28 +01:00
parent c2afbfdc91
commit 0622c4227f
2 changed files with 4 additions and 27 deletions

View File

@ -76,8 +76,6 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, Touchscreen &ts, InputManager &inputMgr_,
exec = value;
} else if (name == "params") {
params = value;
} else if (name == "workdir") {
workdir = value;
} else if (name == "manual") {
manual = value;
} else if (name == "wrapper") {
@ -174,11 +172,7 @@ void LinkApp::setGamma(int gamma) {
bool LinkApp::targetExists()
{
string target = exec;
if (!exec.empty() && exec[0]!='/' && !workdir.empty())
target = workdir + "/" + exec;
return fileExists(target);
return fileExists(exec);
}
bool LinkApp::save() {
@ -191,7 +185,6 @@ bool LinkApp::save() {
if (icon!="" ) f << "icon=" << icon << endl;
if (exec!="" ) f << "exec=" << exec << endl;
if (params!="" ) f << "params=" << params << endl;
if (workdir!="" ) f << "workdir=" << workdir << endl;
if (manual!="" ) f << "manual=" << manual << endl;
if (iclock!=0 ) f << "clock=" << iclock << endl;
if (useRamTimings ) f << "useramtimings=true" << endl;
@ -371,14 +364,9 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
save();
//Set correct working directory
string wd = workdir;
if (wd=="") {
string::size_type pos = exec.rfind("/");
if (pos!=string::npos)
wd = exec.substr(0,pos);
}
if (!wd.empty()) {
if (wd[0]!='/') wd = gmenu2x->getExePath() + wd;
string::size_type pos = exec.rfind("/");
if (pos != string::npos) {
string wd = exec.substr(0, pos + 1);
chdir(wd.c_str());
}
@ -502,15 +490,6 @@ void LinkApp::setParams(const string &params) {
edited = true;
}
const string &LinkApp::getWorkdir() {
return workdir;
}
void LinkApp::setWorkdir(const string &workdir) {
this->workdir = workdir;
edited = true;
}
const string &LinkApp::getManual() {
return manual;
}

View File

@ -62,8 +62,6 @@ public:
void setExec(const std::string &exec);
const std::string &getParams();
void setParams(const std::string &params);
const std::string &getWorkdir();
void setWorkdir(const std::string &workdir);
const std::string &getManual();
void setManual(const std::string &manual);
const std::string &getSelectorDir();