Author: sparky                       Date: Thu Dec 22 20:56:53 2005 GMT
Module: vfmg                          Tag: DEVEL
---- Log message:
- add category name to name when promoting (like it was before)

---- Files affected:
vfmg:
   vfmg (1.73.2.45 -> 1.73.2.46) 

---- Diffs:

================================================================
Index: vfmg/vfmg
diff -u vfmg/vfmg:1.73.2.45 vfmg/vfmg:1.73.2.46
--- vfmg/vfmg:1.73.2.45 Mon Dec 12 21:03:12 2005
+++ vfmg/vfmg   Thu Dec 22 21:56:48 2005
@@ -803,7 +803,7 @@
 warn "Omitted ending: $file\n" if(($file ne "")&& $o_end);
 # parse menu file }}}
 
-if( $opt{clear} and not $opt{promote} ) { # {{{
+if ( $opt{clear} and not $opt{promote} ) { # {{{
        my @empty;
        for(my $i=$#menu; $i>=0; $i--) {
                $empty[$i]=1;
@@ -822,28 +822,30 @@
        }
 } #}}}
 
-if( $opt{promote} ) { # {{{
+if ( $opt{promote} ) { # {{{
        my @count;
-       for(my $i=$#menu; $i>=0; $i--) {
-               $count[$i]=0;
-               foreach my $entry(keys %{$menu[$i]}) {
+       for ( my $i = $#menu; $i >= 0; $i-- ) {
+               $count[$i] = 0;
+               foreach my $entry ( keys %{$menu[$i]} ) {
                        my $mno = $menu[$i]{$entry};
-                       if($mno<0) {
+                       if ( $mno < 0 ) {
                                $count[$i]++;
                        } else { # submenu
-                               if($count[$mno]==0) {
-                                       delete($menu[$i]{$entry});
+                               if ( $count[$mno] == 0 ) {
+                                       delete( $menu[$i]{$entry} );
                                } else {
-                                       if($count[$mno]==1) { #only one entry 
in submenu
-                                               foreach my $name(keys 
%{$menu[$mno]}) {
-                                                       
if($menu[$mno]{$name}==-1) { # it's aplication
-                                                               
$menu[$i]{$name}=-1;
+                                       if ( $count[$mno] == 1 ) { #only one 
entry in submenu
+                                               foreach my $name ( keys 
%{$menu[$mno]} ) {
+                                                       warn "Promoting: 
$desktop[$name][1] --> $desktop[$entry][1]\n" if $o_verbose;
+                                                       $desktop[$name][1] = 
$desktop[$entry][1] . " / " . $desktop[$name][1];
+                                                       if ( $menu[$mno]{$name} 
== -1 ) { # it's aplication
+                                                               
$menu[$i]{$name} = -1;
                                                        } else {
-                                                               
$menu[$i]{$name}=$menu[$mno]{$name};
-                                                               
delete($menu[$mno]{$name});
+                                                               
$menu[$i]{$name} = $menu[$mno]{$name};
+                                                               delete( 
$menu[$mno]{$name} );
                                                        }
                                                }
-                                               delete($menu[$i]{$entry});
+                                               delete( $menu[$i]{$entry} );
                                        }
                                        $count[$i]++;
                                }
================================================================

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

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

Reply via email to