From 552009d5013200f01753d71ef4904c0c3a7d2003 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Tue, 3 Sep 2002 10:48:41 +0000 Subject: gtkcreate_png was too stupid to allow subdirectories for images, fix it --- perl-install/ugtk.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/perl-install/ugtk.pm b/perl-install/ugtk.pm index b8b7b4206..25e3b9f0a 100644 --- a/perl-install/ugtk.pm +++ b/perl-install/ugtk.pm @@ -17,7 +17,9 @@ my $use_pixbuf; my $use_imlib; my $use_gnome; -BEGIN { +BEGIN { + require Gtk; + Gtk->init; eval { require Gtk::Gdk::Pixbuf; Gtk::Gdk::Pixbuf->init }; $use_pixbuf = $@ ? 0 : 1; eval { require Gtk::Gdk::ImlibImage; Gtk::Gdk::ImlibImage->init }; @@ -26,8 +28,6 @@ BEGIN { $use_gnome = $@ ? 0 : 1; } -use Gtk; - use c; use log; use common; @@ -752,8 +752,8 @@ sub gtkcreate_png_pixbuf { sub gtkcreate_png { my ($f) = shift; - $f =~ m|.png$| or $f = "$f.png"; - if ($f !~ /\//) { -e "$_/$f" and $f = "$_/$f", last foreach icon_paths() } + $f =~ /\.png$/ or $f .= '.png'; + if ($f !~ /^\//) { -e "$_/$f" and $f = "$_/$f", last foreach icon_paths() } if ($use_imlib) { my $im = Gtk::Gdk::ImlibImage->load_image($f) or die "gtkcreate_png: missing png file $f"; $im->render($im->rgb_width, $im->rgb_height); -- cgit v1.2.1