After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 149385 - MIME types patch for gedit
MIME types patch for gedit
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
gedit QA volunteers
Depends on:
Blocks:
 
 
Reported: 2004-08-05 12:10 UTC by Darren Adams
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for more mime types (779 bytes, patch)
2004-08-05 12:11 UTC, Darren Adams
none Details | Review

Description Darren Adams 2004-08-05 12:10:28 UTC
Currently, the MimeTypes section of the gedit.desktop.in file only contains
contains text/plain. This patch I've attached includes support for many more
MIME Types, hopefully making gedit more convenient for browsing and editing
other types of files.
Comment 1 Darren Adams 2004-08-05 12:11:19 UTC
Created attachment 30235 [details] [review]
Patch for more mime types
Comment 2 Paolo Borelli 2004-08-05 13:29:33 UTC
the patch should not be needed: specifying text/plain should be enough to
include all the types that inherit from it. I'm closing this as NOTABUG.

Did you see any problems in practice with file association of those MIME types
or did you do the patch just because you thought it was right in theory?

If you saw real problems feel free to reopen.
Comment 3 Darren Adams 2004-08-05 16:04:28 UTC
I think that in theory, gedit should be able to deal with files that have the 
MIME types mentioned in that patch. That isn't why I submitted the patch however.

On my system, files that have the mime type text/plain would open as expected in
gedit. Other files that could be interpereted as plain text (e.g. C source
files, Python or PHP scripts) did not. Instead, a dialog box would appear in
Nautilus, containing the text along the lines of 'Couldn't display
"/home/darren/source-file.c"'. I would then have to right-click on the file and
set it up so that gedit would open it in future.

If you say that it should work then I suppose the problem is with my system, and
I will leave this bug closed.
Comment 4 Paolo Borelli 2004-08-05 17:08:29 UTC
Sorry if I cannot be 100% helpful, but I haven't a system setup with the new
mime stuff yet.

The way it *should* work is that by registering with text/plain gedit should be
associated with all text files. C, Python etc included.

If that's not the case, it may be a bug in the new mime stuff and maybe Ray
(cc'ed) would like to know more details about it.
Comment 5 Darren Adams 2004-08-05 18:00:42 UTC
I was thinking that the problem may be in the mime system rather than in any
specific application. Should a file a bug against Nautilus?
Comment 6 Ray Strode [halfline] 2004-08-05 18:17:29 UTC
Ah so, actually what I think's going on is that php, perl, and python don't have
text media types so they don't get picked up automatically.  Also, another case
that gedit special cases for its file selector are desktop files.

So, I think that application/x-desktop, application/x-python,
application/x-perl, and application/x-php should probably be added to the
MimeType line.

Darren, are you sure C source files aren't working for you by default? I ask
this because C source files do have a text media type.
Comment 7 Darren Adams 2004-08-05 19:54:39 UTC
Ray, at the moment "conventional" (i.e. text/*) source files aren't working for
me by default. To get the 'desired' effect, I have to modify the MimeType line
in the .desktop file as it's shown in the patch then run 'update-desktop-database'.

I have looked at the MIME proposal at
http://freedesktop.org/pipermail/xdg/2004-July/004140.html (what I'm assuming
the new mime system is based on in GNOME 2.7.x) and everthing seems to be right,
but I just can't seem to get it to work.
Comment 8 Paolo Borelli 2004-08-05 23:55:30 UTC
I'm reopening this... can you guys update this with more details once you find
out? As I said at the moment I don't have a full jhbuilded gnome HEAD...
Comment 9 Ernst Sjöstrand 2004-08-07 09:55:43 UTC
I'm running the BMG ebuilds and I see this too. text/plain works but it's not
listed for text/x-csrc.
Comment 10 Alexander Larsson 2004-08-12 08:44:18 UTC
application/x-desktop etc should not be added to the mimetype line, instead
application/x-desktop should inherit from text/plain, and then everything should
work automatically. Its possible that we have bugs in the handling of
inheritance though.
Comment 11 Alexander Larsson 2004-08-12 11:55:09 UTC
I fixed this. You need latest gnome-vfs, eel and shared-mime-info and it should
work.