mirror of
https://github.com/davatorium/rofi.git
synced 2025-07-31 21:59:25 -04:00
Improve matching for DesktopFile run mode
This commit is contained in:
parent
47c110ed94
commit
541c653913
1 changed files with 22 additions and 9 deletions
|
@ -317,16 +317,29 @@ static int drun_token_match ( const Mode *data,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DRunModePrivateData *rmpd = (DRunModePrivateData *) data->private_data;
|
DRunModePrivateData *rmpd = (DRunModePrivateData *) data->private_data;
|
||||||
if ( rmpd->entry_list[index].name &&
|
int match = 1;
|
||||||
token_match ( tokens, rmpd->entry_list[index].name, not_ascii, case_sensitive ) ) {
|
if(tokens ) {
|
||||||
return 1;
|
for ( int j = 0; match && tokens != NULL && tokens[j] != NULL; j++ ) {
|
||||||
}
|
int test = 0;
|
||||||
if ( rmpd->entry_list[index].generic_name &&
|
char *ftokens[2] = { tokens[j], NULL };
|
||||||
token_match ( tokens, rmpd->entry_list[index].generic_name, not_ascii, case_sensitive ) ) {
|
if ( !test && rmpd->entry_list[index].name &&
|
||||||
return 1;
|
token_match ( ftokens, rmpd->entry_list[index].name, not_ascii, case_sensitive ) ) {
|
||||||
}
|
test =1;
|
||||||
|
}
|
||||||
|
if ( !test && rmpd->entry_list[index].generic_name &&
|
||||||
|
token_match ( ftokens, rmpd->entry_list[index].generic_name, not_ascii, case_sensitive ) ) {
|
||||||
|
test =1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
if ( !test && token_match( ftokens, rmpd->entry_list[index].exec, not_ascii, case_sensitive)){
|
||||||
|
test = 1;
|
||||||
|
}
|
||||||
|
if ( test == 0 ) {
|
||||||
|
match = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return match;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int drun_mode_get_num_entries ( const Mode *sw )
|
static unsigned int drun_mode_get_num_entries ( const Mode *sw )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue