1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-23 07:32:47 +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; exec = value;
} else if (name == "params") { } else if (name == "params") {
params = value; params = value;
} else if (name == "workdir") {
workdir = value;
} else if (name == "manual") { } else if (name == "manual") {
manual = value; manual = value;
} else if (name == "wrapper") { } else if (name == "wrapper") {
@ -174,11 +172,7 @@ void LinkApp::setGamma(int gamma) {
bool LinkApp::targetExists() bool LinkApp::targetExists()
{ {
string target = exec; return fileExists(exec);
if (!exec.empty() && exec[0]!='/' && !workdir.empty())
target = workdir + "/" + exec;
return fileExists(target);
} }
bool LinkApp::save() { bool LinkApp::save() {
@ -191,7 +185,6 @@ bool LinkApp::save() {
if (icon!="" ) f << "icon=" << icon << endl; if (icon!="" ) f << "icon=" << icon << endl;
if (exec!="" ) f << "exec=" << exec << endl; if (exec!="" ) f << "exec=" << exec << endl;
if (params!="" ) f << "params=" << params << endl; if (params!="" ) f << "params=" << params << endl;
if (workdir!="" ) f << "workdir=" << workdir << endl;
if (manual!="" ) f << "manual=" << manual << endl; if (manual!="" ) f << "manual=" << manual << endl;
if (iclock!=0 ) f << "clock=" << iclock << endl; if (iclock!=0 ) f << "clock=" << iclock << endl;
if (useRamTimings ) f << "useramtimings=true" << endl; if (useRamTimings ) f << "useramtimings=true" << endl;
@ -371,14 +364,9 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
save(); save();
//Set correct working directory //Set correct working directory
string wd = workdir; string::size_type pos = exec.rfind("/");
if (wd=="") { if (pos != string::npos) {
string::size_type pos = exec.rfind("/"); string wd = exec.substr(0, pos + 1);
if (pos!=string::npos)
wd = exec.substr(0,pos);
}
if (!wd.empty()) {
if (wd[0]!='/') wd = gmenu2x->getExePath() + wd;
chdir(wd.c_str()); chdir(wd.c_str());
} }
@ -502,15 +490,6 @@ void LinkApp::setParams(const string &params) {
edited = true; edited = true;
} }
const string &LinkApp::getWorkdir() {
return workdir;
}
void LinkApp::setWorkdir(const string &workdir) {
this->workdir = workdir;
edited = true;
}
const string &LinkApp::getManual() { const string &LinkApp::getManual() {
return manual; return manual;
} }

View File

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