forked from e16/e16
1
0
Fork 0

Menu generation: Skip if NoDisplay=true.

SVN revision: 61444
This commit is contained in:
Kim Woelders 2011-07-17 18:43:14 +00:00
parent 961e2cf215
commit 9bae0a4caf
1 changed files with 7 additions and 5 deletions

View File

@ -177,7 +177,7 @@ sub MakeMenu {
# Process a .desktop file # Process a .desktop file
sub ProcessFile { sub ProcessFile {
local $f = shift; local $f = shift;
local $Name, $Exec, $Icon, $Cats, $Type, $File; local $Name, $Exec, $Icon, $Cats, $Type, $Ndis, $File;
local $c; local $c;
if (! -f "$f") { if (! -f "$f") {
@ -188,7 +188,7 @@ sub ProcessFile {
# Global ref no # Global ref no
$N++; $N++;
$Name = $Exec = $Icon = ""; $Name = $Exec = $Icon = $Ndis = "";
$Nam1 = $Nam2 = $Nam3 = ""; $Nam1 = $Nam2 = $Nam3 = "";
$Cats = shift; $Cats = shift;
$Type = shift; $Type = shift;
@ -227,6 +227,8 @@ sub ProcessFile {
$Name = ""; $Name = "";
last; last;
} }
} elsif (/^NoDisplay=(.*)$/) {
$Ndis = $1;
} }
if ($Nam1 || $Nam2 || $Nam3) { if ($Nam1 || $Nam2 || $Nam3) {
if ($Nam1) { $Name = $Nam1; } if ($Nam1) { $Name = $Nam1; }
@ -239,9 +241,9 @@ sub ProcessFile {
close FI; close FI;
$Cats =~ s/ +$//; $Cats =~ s/ +$//;
if (!$Name || !$Exec || !$Cats) { if ($Ndis eq "true" || !$Name || !$Exec || !$Cats) {
printf("Skipped: %-24s %-24s %-20s %-20s %s\n", printf("Skipped: %-24s %-4s %-24s %-20s %-20s %s\n",
$f, $Name, $Exec, $Icon, $Cats) if $dbg ge 1; $f, $Name, $Ndis, $Exec, $Icon, $Cats) if $dbg ge 1;
return; return;
} }