summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-25 15:56:50 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-25 15:56:50 +0000
commit4e73cd4e6bbf81776c8b10e8f035d84bdd9632bc (patch)
tree6707ef02a6806ce21a08471ef3e5bdec2465f4c6
parent509059250b46a223051f0d7daa64461596d197d8 (diff)
downloaddrakx-4e73cd4e6bbf81776c8b10e8f035d84bdd9632bc.tar
drakx-4e73cd4e6bbf81776c8b10e8f035d84bdd9632bc.tar.gz
drakx-4e73cd4e6bbf81776c8b10e8f035d84bdd9632bc.tar.bz2
drakx-4e73cd4e6bbf81776c8b10e8f035d84bdd9632bc.tar.xz
drakx-4e73cd4e6bbf81776c8b10e8f035d84bdd9632bc.zip
use a function icon_paths instead of @icon_paths
=> this ensure that $ENV{SHARE_PATH} value (used in @icon_paths) is set independently of the loading order of the modules
-rw-r--r--perl-install/my_gtk.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 21f43f05a..90433cc00 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -379,15 +379,18 @@ sub gtkctree_children {
@l;
}
-my @icon_paths = ($ENV{SHARE_PATH}, "$ENV{SHARE_PATH}/icons", "$ENV{SHARE_PATH}/libDrakX/pixmaps", "/usr/lib/libDrakX/icons", "pixmaps", 'standalone/icons');
+my @icon_paths = ();
+sub add_icon_path { push @icon_paths, @_ }
-sub add_icon_path { @icon_paths = uniq(@icon_paths, @_) }
+sub icon_paths {
+ (@icon_paths, $ENV{SHARE_PATH}, "$ENV{SHARE_PATH}/icons", "$ENV{SHARE_PATH}/libDrakX/pixmaps", "/usr/lib/libDrakX/icons", "pixmaps", 'standalone/icons');
+}
sub gtkcreate_xpm {
my ($f) = @_;
my $rw = gtkroot();
$f =~ m|.xpm$| or $f="$f.xpm";
- if ( $f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach @icon_paths }
+ if ( $f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach icon_paths() }
my @l = Gtk::Gdk::Pixmap->create_from_xpm($rw, new Gtk::Style->bg('normal'), $f) or die "gtkcreate_xpm: missing pixmap file $f";
@l;
}
@@ -395,7 +398,7 @@ sub gtkcreate_xpm {
sub gtkcreate_png {
my ($f) = shift;
$f =~ m|.png$| or $f="$f.png";
- if ( $f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach @icon_paths }
+ if ( $f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach icon_paths() }
my $im = Gtk::Gdk::ImlibImage->load_image($f) or die "gtkcreate_png: missing png file $f";
$im->render($im->rgb_width, $im->rgb_height);
($im->move_image(), $im->move_mask);