Author: sparky
Date: Sat Dec  2 23:20:54 2006
New Revision: 8044

Modified:
   vfmg/trunk/VFMG/Icons.pm
   vfmg/trunk/vfmg
Log:
- move icon preconfiguration to VFMG::Icons


Modified: vfmg/trunk/VFMG/Icons.pm
==============================================================================
--- vfmg/trunk/VFMG/Icons.pm    (original)
+++ vfmg/trunk/VFMG/Icons.pm    Sat Dec  2 23:20:54 2006
@@ -3,6 +3,29 @@
 use strict;
 use warnings;
 
+sub preconf() {
+       eval { $main::opt{icons_dir} = VFMG::Output::icons_dir() }
+               unless length $main::opt{icons_dir};
+
+       $main::opt{icons_ext} = 1 if $main::opt{icons_full};
+
+       return unless $main::opt{icons_scale};
+       if ( length $main::opt{icons_dir} ) {
+               my $conv = (split /\s/, $main::opt{convert})[0];
+               if ( length `which $conv` ) {
+                       $main::opt{icons} = 1;
+                       $main::opt{icons_full} = 1;
+                       $main::opt{icons_ext} = 1;
+               } else {
+                       $main::opt{icons_scale} = 0;
+                       warn "$conv is not executable, not scaling icons.\n";
+               }
+       } else {
+               $main::opt{icons_scale} = 0;
+               warn "Icons destination directory is not specified, not 
scaling.\n";
+       }
+}
+
 our $scale_icon;
 
 my @scale;

Modified: vfmg/trunk/vfmg
==============================================================================
--- vfmg/trunk/vfmg     (original)
+++ vfmg/trunk/vfmg     Sat Dec  2 23:20:54 2006
@@ -196,25 +196,9 @@
 
 # check dependencies
 $opt{exec} = 1 if $opt{exec_full};
-eval { $opt{icons_dir} = VFMG::Output::icons_dir() }
-       unless (length $opt{icons_dir});
-if ($opt{icons_scale}) {
-       if ( length $opt{icons_dir} ) {
-               my $conv = (split /\s/, $opt{convert})[0];
-               if ( length `which $conv` ) {
-                       $opt{icons} = 1;
-                       $opt{icons_full} = 1;
-               } else {
-                       $opt{icons_scale} = 0;
-                       warn "$conv is not executable, not scaling icons.\n";
-               }
-       } else {
-               $opt{icons_scale} = 0;
-               warn "Icons destination directory is not specified, not 
scaling.\n";
-       }
-}
-$opt{icons_ext} = 1 if $opt{icons_full};
-$opt{encoding}="utf8" if $opt{utf};
+eval { VFMG::Icons::preconf() }
+       or $opt{icons_ext} = 0;
+$opt{encoding} = "utf8" if $opt{utf};
 unless (length $opt{destdir}) {
        eval { $opt{destdir} = VFMG::Output::destdir() }
                or delete $opt{destdir};
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to