mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 07:02:29 +02:00
Show a file selector in OPK links only if Exec requires a file
Previously, if a user installed a new version of an OPK with the same name as one that had a link configuration file, GMenu2X could request a file for an application whose new version required no files to launch. In practice, this transition would occur only once per OPK application, when its developer decided to use a custom browser after having used GMenu2X's file browser. This bug would then show GMenu2X's file browser to request a file that would not even be passed to the application. Thanks to Nebuleon for analyzing the problem and the above description.
This commit is contained in:
parent
35724170f8
commit
60aaf5954a
@ -103,6 +103,7 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, const char* linkfile)
|
||||
editable = true;
|
||||
edited = false;
|
||||
|
||||
bool appTakesFileArg = true;
|
||||
#ifdef HAVE_LIBOPK
|
||||
isOPK = !!opk;
|
||||
|
||||
@ -121,6 +122,8 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, const char* linkfile)
|
||||
|
||||
file = gmenu2x->getHome() + "/sections/";
|
||||
|
||||
appTakesFileArg = false;
|
||||
|
||||
while ((ret = opk_read_pair(opk, &key, &lkey, &val, &lval))) {
|
||||
if (ret < 0) {
|
||||
ERROR("Unable to read meta-data\n");
|
||||
@ -169,6 +172,7 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, const char* linkfile)
|
||||
for (auto token : tokens) {
|
||||
if (tmp.find(token) != tmp.npos) {
|
||||
selectordir = CARD_ROOT;
|
||||
appTakesFileArg = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -226,7 +230,7 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, const char* linkfile)
|
||||
if (name == "clock") {
|
||||
setClock( atoi(value.c_str()) );
|
||||
} else if (name == "selectordir") {
|
||||
setSelectorDir( value );
|
||||
if (appTakesFileArg) setSelectorDir(value);
|
||||
} else if (name == "selectorbrowser") {
|
||||
if (value=="false") selectorbrowser = false;
|
||||
} else if (!isOpk()) {
|
||||
|
Loading…
Reference in New Issue
Block a user