Author: sparky                       Date: Tue Nov  1 17:28:55 2005 GMT
Module: vfmg                          Tag: DEVEL
---- Log message:
- some cosmetics
- BTW, DR17 is slow (ther WMs 0.5s):
real    1m0.136s
user    0m43.939s
sys     0m15.380s

---- Files affected:
vfmg:
   vfmg (1.73.2.22 -> 1.73.2.23) 

---- Diffs:

================================================================
Index: vfmg/vfmg
diff -u vfmg/vfmg:1.73.2.22 vfmg/vfmg:1.73.2.23
--- vfmg/vfmg:1.73.2.22 Tue Nov  1 15:49:45 2005
+++ vfmg/vfmg   Tue Nov  1 18:28:50 2005
@@ -7,6 +7,7 @@
 use Encode qw(encode decode);
 
 # header {{{
+# default options {{{
 my $o_help=0;
 my $o_tags=0;
 my $o_end=0;
@@ -51,6 +52,7 @@
        DR17                    =>      "$ENV{'HOME'}/.e/e/applications/all",
        enlightenment   =>      "$ENV{'HOME'}/.enlightenment/icons",
 );
+# }}}
 
 Getopt::Long::Configure("bundling");
 GetOptions(
@@ -60,10 +62,13 @@
        'verbose|v'             =>      \$o_verbose,
        
        'exec|x!'               =>      \$opt{exec},
-       'exec-full|X!'  =>      \$opt{exec_full},
+       'exec-full|full-exec|X!'
+                                       =>      \$opt{exec_full},
        'icons|i!'              =>      \$opt{icons},
-       'icons-full|I!' =>      \$opt{icons_full},
-       'icons-scale|S!'=>      \$opt{icons_scale},
+       'icons-full|full-icons|I!'      
+                                       =>      \$opt{icons_full},
+       'icons-scale|scale-icons|S!'
+                                       =>      \$opt{icons_scale},
        'icons-dir|d=s' =>      \$opt{icons_dir},
        'icons-ext|T=s' =>      \$opt{icons_ext},
 
@@ -120,13 +125,13 @@
                      default: "$defopt{convert}"
 
     -f, --full-regen - regenerate everything (delete scaled icons)
-    -D, --destdir=   - directory to seve multifile menu
+    -D, --destdir=   - directory to save multifile menu
 EOF
        print "                       (used in: ",
                (join ", ", sort keys %destdir), ")\n";
        print<<EOF;
 
-  Most boolean options have oposite --no-<name> version too.
+  All but diagnostics boolean options have oposite --no-<name> version too.
 
 EOF
        exit;
@@ -810,7 +815,7 @@
 }
 
 sub DR17 { # {{{
-       my ($no, $dir, $tab)[EMAIL PROTECTED];
+       my ($no, $dir, $tab, $dr)[EMAIL PROTECTED];
        my $sort = 1;
        my $apps = "";
        my @edje = qw(edje_cc -id . -fd . icon.edc);
@@ -819,17 +824,12 @@
                $name = $$d[LOCALENAME];
                print $tab.$name."..";
                
-
+               unlink $$dr{icon};
                my $icon = $$d[ICON];
-               $icon = "blank.xpm" unless $icon;
-               $icon = scale_icon($icon);
-               die "No icon $icon\n" unless -r $icon;
-               unlink "/tmp/icon.$opt{icons_ext}";
-               symlink $icon, "/tmp/icon.$opt{icons_ext}";
-               die "No icon /tmp/icon.$opt{icons_ext}\n" unless -r 
"/tmp/icon.$opt{icons_ext}";
+               $icon = $$dr{tmp}."/blank.xpm" unless -r $icon;
+               scale_icon($icon);
+               die "No icon $$dr{icon}\n" unless -r $$dr{icon};
                print "..";
-
-               
                
                if($menu[$no]{$entry} < 0) {
                        my $file = "$opt{icons_dir}/$$d[FILENAME].eap";
@@ -854,7 +854,7 @@
                                "-set-generic",$name);
                        
                        print "..DONE\n";
-                       DR17($menu[$no]{$entry},$subdir,$tab."\t");
+                       DR17($menu[$no]{$entry},$subdir,$tab."\t",$dr);
                        $sort++;
                }
        }
@@ -1268,7 +1268,15 @@
                unless $opt{icons_scale};
        $| = 1;
        print "Generating DR17 menu, this may take a long time\n";
-       chdir("/tmp");
+       my %DR;
+       $DR{tmp} = $ENV{'TMPDIR'};
+       $DR{tmp} = $ENV{'TMP'}  unless -d $DR{tmp};
+       $DR{tmp} = "/tmp"  unless -d $DR{tmp};
+       $DR{icon} = $DR{tmp}."/icon.".$opt{icons_ext};
+       
+       $opt{convert} =~ s/\%out/$DR{icon}/g;
+       chdir($DR{tmp});
+       unlink $DR{icon};
        # icon is allways neaded
        open F_OUT, "> blank.xpm"; # {{{
        print F_OUT <<EOF;
@@ -1295,9 +1303,10 @@
        } } } } }
 EOF
        close F_OUT; # }}}
-       DR17($opt{strip},$opt{destdir},"");
+       DR17($opt{strip},$opt{destdir},"",\%DR);
        unlink "blank.xpm";
        unlink "icon.edc";
+       unlink $DR{icon};
        exit;
 } # }}}
 if($o_output eq "icewm") {
================================================================

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

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to