1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-29 15:52:48 +02:00

Remove "don't leave" feature

If the application in question daemonizes, it will continue running
no matter whether we start it with system() or execlp(). So I don't
see a reason for this feature to exist and removing it means less
code paths to worry about.
This commit is contained in:
Maarten ter Huurne 2013-08-14 09:03:20 +02:00
parent dfa5413b5b
commit 9c497e7867
3 changed files with 47 additions and 59 deletions

View File

@ -899,7 +899,6 @@ void GMenu2X::editLink() {
sd.addSetting(new MenuSettingString(this, ts, tr["Selector Filter"], tr["Selector filter (Separate values with a comma)"], &linkSelFilter, diagTitle, diagIcon)); sd.addSetting(new MenuSettingString(this, ts, tr["Selector Filter"], tr["Selector filter (Separate values with a comma)"], &linkSelFilter, diagTitle, diagIcon));
sd.addSetting(new MenuSettingDir(this, ts, tr["Selector Screenshots"], tr["Directory of the screenshots for the selector"], &linkSelScreens)); sd.addSetting(new MenuSettingDir(this, ts, tr["Selector Screenshots"], tr["Directory of the screenshots for the selector"], &linkSelScreens));
sd.addSetting(new MenuSettingFile(this, ts, tr["Selector Aliases"], tr["File containing a list of aliases for the selector"], &linkSelAliases)); sd.addSetting(new MenuSettingFile(this, ts, tr["Selector Aliases"], tr["File containing a list of aliases for the selector"], &linkSelAliases));
sd.addSetting(new MenuSettingBool(this, ts, tr["Don't Leave"], tr["Don't quit GMenu2X when launching this link"], &linkApp->runsInBackgroundRef()));
#if defined(PLATFORM_A320) || defined(PLATFORM_GCW0) #if defined(PLATFORM_A320) || defined(PLATFORM_GCW0)
sd.addSetting(new MenuSettingBool(this, ts, tr["Display Console"], tr["Must be enabled for console-based applications"], &linkApp->consoleApp)); sd.addSetting(new MenuSettingBool(this, ts, tr["Display Console"], tr["Must be enabled for console-based applications"], &linkApp->consoleApp));
#endif #endif

View File

@ -68,7 +68,6 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, Touchscreen &ts, InputManager &inputMgr_,
{ {
manual = ""; manual = "";
file = linkfile; file = linkfile;
dontleave = false;
#ifdef ENABLE_CPUFREQ #ifdef ENABLE_CPUFREQ
setClock(gmenu2x->getDefaultAppClock()); setClock(gmenu2x->getDefaultAppClock());
#endif #endif
@ -133,9 +132,6 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, Touchscreen &ts, InputManager &inputMgr_,
} else if (!strncmp(key, "X-OD-Manual", lkey)) { } else if (!strncmp(key, "X-OD-Manual", lkey)) {
manual = buf; manual = buf;
} else if (!strncmp(key, "X-OD-Daemon", lkey)) {
dontleave = !strncmp(val, "true", lval);
} else if (!strncmp(key, "Icon", lkey)) { } else if (!strncmp(key, "Icon", lkey)) {
/* Read the icon from the OPK only /* Read the icon from the OPK only
* if it doesn't exist on the skin */ * if it doesn't exist on the skin */
@ -239,8 +235,6 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, Touchscreen &ts, InputManager &inputMgr_,
params = value; params = value;
} else if (name == "manual") { } else if (name == "manual") {
manual = value; manual = value;
} else if (name == "dontleave") {
if (value=="true") dontleave = true;
#if defined(PLATFORM_A320) || defined(PLATFORM_GCW0) #if defined(PLATFORM_A320) || defined(PLATFORM_GCW0)
} else if (name == "consoleapp") { } else if (name == "consoleapp") {
if (value == "true") consoleApp = true; if (value == "true") consoleApp = true;
@ -339,7 +333,6 @@ bool LinkApp::save() {
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 (manual!="" ) f << "manual=" << manual << endl; if (manual!="" ) f << "manual=" << manual << endl;
if (dontleave ) f << "dontleave=true" << endl;
#if defined(PLATFORM_A320) || defined(PLATFORM_GCW0) #if defined(PLATFORM_A320) || defined(PLATFORM_GCW0)
if (consoleApp ) f << "consoleapp=true" << endl; if (consoleApp ) f << "consoleapp=true" << endl;
#endif #endif
@ -656,9 +649,7 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
if (isOPK) if (isOPK)
command += " ; umount -l " + opkMount; command += " ; umount -l " + opkMount;
#endif #endif
if (dontleave) {
system(command.c_str());
} else {
gmenu2x->saveSelection(); gmenu2x->saveSelection();
if (selectedFile == "") { if (selectedFile == "") {
@ -718,7 +709,6 @@ void LinkApp::launch(const string &selectedFile, const string &selectedDir) {
//try relaunching gmenu2x //try relaunching gmenu2x
gmenu2x->main(); gmenu2x->main();
} }
}
const string &LinkApp::getExec() { const string &LinkApp::getExec() {
return exec; return exec;

View File

@ -109,7 +109,6 @@ public:
const std::string &getFile() { return file; } const std::string &getFile() { return file; }
void renameFile(const std::string &name); void renameFile(const std::string &name);
bool &runsInBackgroundRef() { return dontleave; }
}; };
#endif #endif