Re: handling of mime-types
- From: James Henstridge <james daa com au>
- To: JP Rosevear <jpr cr168790-a nmkt1 on wave home com>
- cc: GNOME Mailing List <gnome-devel-list gnome org>
- Subject: Re: handling of mime-types
- Date: Tue, 4 May 1999 08:41:09 +0800 (WST)
Take a look at the header libgnome/gnome-mime-info.h. It will tell you
what program should be run for a particular mime type. You would have to
do a substitution for the file name though. Take a look at gnumeric's
source code for examples.
James.
--
Email: james@daa.com.au
WWW: http://www.daa.com.au/~james/
On Tue, 4 May 1999, JP Rosevear wrote:
> gandalf@pobox.com wrote:
>
> > On Mon, 3 May 1999, Nathan Clegg wrote:
> >
> > > I am writing an application which interprets some mime types. I want to
> > > use the default and user-defined mime-types and handlers found in the
> > > gnome control center. I am confused as to the layout of files in the
> >
> > Why not just use one of the mime funcions provide in gnome-libs (from
> > libgnome/gnome-mime.h):
> >
> > const char *gnome_mime_type (const gchar* filename);
> > const char *gnome_mime_type_or_default (const gchar *filename,
> > const gchar *defaultv);
> > const char *gnome_mime_type_of_file (const char *existing_filename);
> > const char *gnome_mime_type_or_default_of_file (const char
> > *existing_filename,
> > const gchar *defaultv);
> > const char *gnome_mime_type_from_magic (const gchar *filename);
>
> I also was in need of this info. All this works great (ie. I can get the app and
> the mime-type), but now I want to take the mime associated action. All I can find
> are the libgnome/gnome-exec commands which seem to require parsing on my part (ie.
> looking for the %f in the command line and replacing it, calling based on whether
> the prog needs to run in a shell). Is there a function somewhere that will take a
> file name and execute the mime associated app all in one go?
>
> -JP
>
>
> --
> To unsubscribe: mail gnome-devel-list-request@gnome.org with "unsubscribe"
> as the Subject.
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]