Re: Finding installed applications




On Aug 3, 2005, at 8:56 PM, James McArthur wrote:

- From the Gnome Control Center you can specify which applications should
be used for which file types.

How can I query that list from inside my Perl/Gtk2 application so that I
use the correct application to view files?

All that stuff works by mime types and handlers.

It appears that gnome_vfs_mime_get_default_application() is not bound in Gnome2::VFS.

I expect this to work, but it doesn't:

  use strict;
  use Gnome2::VFS -init;
  my $uri = "file://$ENV{HOME}/foo.txt";
  my $mime_type_str = Gnome2::VFS->get_mime_type ($uri);
  my $mime_type = Gnome2::VFS::Mime::Type->new ($mime_type_str);
  my $application = $mime_type->get_default_application;
  print "application => $application\n";

Everything works up until get_default_application, which returns undef. :-/

--
If I lived in Teletubby Land, the homicide rate would be four.
  -- elysse




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]