prevent multiple menu items per .desktop entry

If a .desktop entry is being added to the list of Menu items by its "Name" field, it should not be added again by its command or filename.
If it is being added by its command, it should not be added again by its filename.
next
loungecube 2017-05-15 05:02:09 +02:00 committed by GitHub
parent 9178c5b8ca
commit 838616a165
1 changed files with 5 additions and 3 deletions

View File

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