vfmg (DEVEL): vfmg - unbroken checking for icons existance

sparky sparky at pld-linux.org
Sun Oct 30 20:10:22 CET 2005


Author: sparky                       Date: Sun Oct 30 19:10:22 2005 GMT
Module: vfmg                          Tag: DEVEL
---- Log message:
- unbroken checking for icons existance

---- Files affected:
vfmg:
   vfmg (1.73.2.5 -> 1.73.2.6) 

---- Diffs:

================================================================
Index: vfmg/vfmg
diff -u vfmg/vfmg:1.73.2.5 vfmg/vfmg:1.73.2.6
--- vfmg/vfmg:1.73.2.5	Sun Oct 30 19:09:25 2005
+++ vfmg/vfmg	Sun Oct 30 20:10:17 2005
@@ -184,19 +184,24 @@
 		$tags{Exec} = $_;
 	}
 	if ($o_icons) {
-		my $exists;
-		foreach my $dir (@icondirs) {
-			for ('', qw(.xpm .png)) {
-				if (-f "$dir$tags{icon}$_") {
-					$tags{icon} .= $_;
+		my $exists=0;
+		my @idirs;
+		push @idirs, '' if $tags{Icon} =~ m|^/|;
+		push @idirs, @icondirs;
+		foreach my $dir (@idirs) {
+			foreach my $ext ('', qw(.svg .xpm .png)) {
+				if (-f "$dir$tags{Icon}$ext") {
+					$tags{Icon} .= $ext;
+					$exists++;
 					last;
 				}
 			}
-			$exists++;
-			$tags{icon} = "$dir$tags{icon}" if $o_full;
-			last;
+			if ($exists) {
+				$tags{Icon} = "$dir$tags{Icon}" if $o_full;
+				last;
+			}
 		}
-		$tags{icon} = '' unless $exists;
+		$tags{Icon} = '' unless $exists;
 	}
 	my $utfname;
 	if (length $tags{name}) {
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/vfmg/vfmg?r1=1.73.2.5&r2=1.73.2.6&f=u




More information about the pld-cvs-commit mailing list