? patch1.dat ? patch2.dat Index: Gtk2/Ex/Dialogs/ChooseDirectory.pm =================================================================== RCS file: /cvsroot/gtk2-perl-ex/Gtk2-Ex/Dialogs/lib/Gtk2/Ex/Dialogs/ChooseDirectory.pm,v retrieving revision 1.1 diff -u -r1.1 ChooseDirectory.pm --- Gtk2/Ex/Dialogs/ChooseDirectory.pm 10 Feb 2005 20:37:58 -0000 1.1 +++ Gtk2/Ex/Dialogs/ChooseDirectory.pm 3 Oct 2005 00:57:12 -0000 @@ -27,6 +27,7 @@ use Carp; use Cwd; +use Cwd 'abs_path'; use Gtk2; use Gtk2::Ex::Constants qw( :truth :pad :pack :align :justify ); use File::Basename; @@ -185,6 +186,7 @@ my $CWD = getcwd(); $cfg->{path} =~ s!^\./!$CWD/!; } + $cfg->{path} = abs_path($cfg->{path}); my $base_path = dirname( $cfg->{path} ); if ( -d $cfg->{path} ) { $dialog->set_current_folder( $cfg->{path} ); } else { $dialog->set_current_folder( $base_path ); } Index: Gtk2/Ex/Dialogs/ChooseFile.pm =================================================================== RCS file: /cvsroot/gtk2-perl-ex/Gtk2-Ex/Dialogs/lib/Gtk2/Ex/Dialogs/ChooseFile.pm,v retrieving revision 1.1 diff -u -r1.1 ChooseFile.pm --- Gtk2/Ex/Dialogs/ChooseFile.pm 10 Feb 2005 20:37:58 -0000 1.1 +++ Gtk2/Ex/Dialogs/ChooseFile.pm 3 Oct 2005 00:57:12 -0000 @@ -27,6 +27,7 @@ use Carp; use Cwd; +use Cwd 'abs_path'; use Gtk2; use Gtk2::Ex::Constants qw( :truth :pad :pack :align :justify ); @@ -186,6 +187,7 @@ my $CWD = getcwd(); $cfg->{path} =~ s!^\./!$CWD/!; } + $cfg->{path} = abs_path($cfg->{path}); if ( -d $cfg->{path} ) { $dialog->set_current_folder( $cfg->{path} ); } else { $dialog->set_filename( $cfg->{path} ); } } else { $dialog->set_current_folder( getcwd() ); } Index: 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 --- Gtk2/Ex/Dialogs/ChoosePreviewFile.pm 10 Feb 2005 20:37:58 -0000 1.1 +++ Gtk2/Ex/Dialogs/ChoosePreviewFile.pm 3 Oct 2005 00:57:12 -0000 @@ -27,8 +27,9 @@ use Carp; use Cwd; +use Cwd 'abs_path'; use Gtk2; -use Gnome2::VFS; +use File::Type; use Gtk2::Ex::Constants qw( :truth :pad :pack :align :justify ); sub import { @@ -187,6 +188,7 @@ my $CWD = getcwd(); $cfg->{path} =~ s!^\./!$CWD/!; } + $cfg->{path} = abs_path($cfg->{path}); if ( -d $cfg->{path} ) { $dialog->set_current_folder( $cfg->{path} ); } else { $dialog->set_filename( $cfg->{path} ); } } else { $dialog->set_current_folder( getcwd() ); } @@ -305,14 +307,12 @@ } $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 = File::Type->mime_type( $file_name); 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 +322,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++ ) {