? diff.dat Index: Makefile.PL =================================================================== RCS file: /cvsroot/gtk2-perl-ex/Gtk2-Ex/Dialogs/Makefile.PL,v retrieving revision 1.1 diff -u -r1.1 Makefile.PL --- Makefile.PL 10 Feb 2005 20:37:54 -0000 1.1 +++ Makefile.PL 22 Sep 2005 04:57:56 -0000 @@ -6,7 +6,8 @@ VERSION_FROM => 'lib/Gtk2/Ex/Dialogs.pm', PREREQ_PM => { 'Gtk2' => 1.040, 'Gtk2::Ex::Utils' => 0.08, - 'Gnome2::VFS' => 1.003 }, + #'Gnome2::VFS' => 1.003 + }, ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'lib/Gtk2/Ex/Dialogs.pm', AUTHOR => 'Kevin C. Krinke ') : ()), Index: lib/Gtk2/Ex/Dialogs/ChoosePreviewFile.pm =================================================================== RCS file: /cvsroot/gtk2-perl-ex/Gtk2-Ex/Dialogs/lib/Gtk2/Ex/Dialogs/ChoosePreviewFile.pm,v retrieving revision 1.1 diff -u -r1.1 ChoosePreviewFile.pm --- lib/Gtk2/Ex/Dialogs/ChoosePreviewFile.pm 10 Feb 2005 20:37:58 -0000 1.1 +++ lib/Gtk2/Ex/Dialogs/ChoosePreviewFile.pm 22 Sep 2005 04:57:56 -0000 @@ -28,8 +28,9 @@ use Carp; use Cwd; use Gtk2; -use Gnome2::VFS; use Gtk2::Ex::Constants qw( :truth :pad :pack :align :justify ); +my $USE_GNOME2_VFS = TRUE; +$USE_GNOME2_VFS = FALSE if $^O =~ /Win32/; sub import { my $class = shift(); @@ -305,14 +306,17 @@ } $current_preview = undef; } - - my ( $rs, $info ) = Gnome2::VFS->get_file_info( $file_name, [ 'get-mime-type', 'force-slow-mime-type' ] ); - my $mime_type = $info->{mime_type}; + my $mime_type = undef; + if ($USE_GNOME2_VFS) { + require Gnome2::VFS; + my ( $rs, $info ) = Gnome2::VFS->get_file_info( $file_name, [ 'get-mime-type', 'force-slow-mime-type' ] ); + $mime_type = $info->{mime_type}; + } unless ( $mime_type ) { $dialog->set_preview_widget_active( FALSE ); $preview_hbox->hide_all(); } else { - if ( $info->{mime_type} =~ m!^image/! ) { + if ( $mime_type =~ m!^image/! ) { my $pixbuf = new_from_file Gtk2::Gdk::Pixbuf( $file_name ); my $pixbuf_s = $pixbuf->scale_simple( 96, 128, 'nearest' ); undef( $pixbuf ); @@ -322,7 +326,7 @@ $preview_hbox->show_all(); $dialog->set_preview_widget_active( TRUE ); } elsif ( -f $file_name && -r $file_name ) { - if ( $info->{mime_type} =~ m!^text/! ) { + if ( $mime_type =~ m!^text/! ) { if ( open( PFH, "<" . $file_name ) ) { my @raw = (); for ( my $c = 0; $c < 15; $c++ ) {