#
#
# patch "mtn-browse"
# from [b6cbd29c33318168c2112ce7d90cd0edfaeac93a]
# to [0a418bd30d0bd2b18d477db465d45c981200be2e]
#
============================================================
--- mtn-browse b6cbd29c33318168c2112ce7d90cd0edfaeac93a
+++ mtn-browse 0a418bd30d0bd2b18d477db465d45c981200be2e
@@ -1452,22 +1452,33 @@ sub view_button_clicked_cb($$)
if (defined($mime_obj = Gnome2::VFS::Mime::Type->new($mime_type)));
if (defined($app))
{
- my $status;
- if (($status = $app->launch("file://" . $file_name)) ne "ok")
+
+ # Use the command attribute if it is present rather than the
+ # launch() method as this can crash on some systems.
+
+ if (exists($app->{command}))
{
- my $dialog = Gtk2::MessageDialog->new_with_markup
- ($browser->{window},
- ["modal"],
- "warning",
- "close",
- __x("Gnome cannot launch the helper application\n"
- . "for MIME type {mime_type}.\nGnome gave:\n"
- . "{gnome_error_message}",
- mime_type => $mime_type,
- gnome_error_message => $status));
- $dialog->run();
- $dialog->destroy();
+ system($app->{command} . " " . $file_name . " &");
}
+ else
+ {
+ my $status;
+ if (($status = $app->launch("file://" . $file_name)) ne "ok")
+ {
+ my $dialog = Gtk2::MessageDialog->new_with_markup
+ ($browser->{window},
+ ["modal"],
+ "warning",
+ "close",
+ __x("Gnome cannot launch the helper application\n"
+ . "for MIME type {mime_type}.\nGnome gave:\n"
+ . "{gnome_error_message}",
+ mime_type => $mime_type,
+ gnome_error_message => $status));
+ $dialog->run();
+ $dialog->destroy();
+ }
+ }
}
else
{