mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-17 20:18:05 +02:00
Re-insert proper detection of the %f tokens for OPK apps
This commit is contained in:
parent
47b098cce6
commit
92a6453ff8
@ -56,6 +56,8 @@ using namespace std;
|
||||
|
||||
static const char *tokens[] = { "%f", "%F", "%u", "%U", };
|
||||
|
||||
#define ARRAY_SIZE(x) (!sizeof(x) ?: sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
#ifdef HAVE_LIBOPK
|
||||
LinkApp::LinkApp(GMenu2X *gmenu2x_, const char* linkfile,
|
||||
struct OPK *opk, const char *metadata_)
|
||||
@ -141,6 +143,17 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, const char* linkfile)
|
||||
iconPath = this->icon;
|
||||
updateSurfaces();
|
||||
|
||||
} else if (!strncmp(key, "Exec", lkey)) {
|
||||
string tmp = buf;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(tokens); i++) {
|
||||
if (tmp.find(tokens[i]) != tmp.npos) {
|
||||
selectordir = CARD_ROOT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -623,7 +636,6 @@ void LinkApp::launch(const string &selectedFile) {
|
||||
#endif
|
||||
} else {
|
||||
std::string command = exec + " " + params;
|
||||
INFO("Executing '%s' (%s)\n", title.c_str(), command.c_str());
|
||||
execlp("/bin/sh", "/bin/sh", "-c", command.c_str(), NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user