Merge pull request #2772 from loungecube/patch-1

prevent multiple menu items per .desktop entry
This commit is contained in:
Ingo Bürk 2017-05-29 08:37:44 +02:00 committed by GitHub
commit a7e8c4dd46
1 changed files with 5 additions and 3 deletions

View File

@ -279,6 +279,7 @@ for my $app (keys %apps) {
} }
$choices{$name} = $app; $choices{$name} = $app;
next;
} }
if ((scalar grep { $_ eq 'command' } @entry_types) > 0) { if ((scalar grep { $_ eq 'command' } @entry_types) > 0) {
@ -310,10 +311,11 @@ for my $app (keys %apps) {
# Dont add “geany” if “Geany” is already present. # Dont add “geany” if “Geany” is already present.
my @keys = map { lc } keys %choices; my @keys = map { lc } keys %choices;
next if (scalar grep { $_ eq lc(basename($command)) } @keys) > 0; if (!(scalar grep { $_ eq lc(basename($command)) } @keys) > 0) {
$choices{basename($command)} = $app; $choices{basename($command)} = $app;
} }
next;
}
if ((scalar grep { $_ eq 'filename' } @entry_types) > 0) { if ((scalar grep { $_ eq 'filename' } @entry_types) > 0) {
my $filename = basename($app, '.desktop'); my $filename = basename($app, '.desktop');