Bug#282281: kde: KDE applications take over Gnome file types

tmb@lumo.com, 282281@bugs.debian.org tmb@lumo.com, 282281@bugs.debian.org
Sun, 21 Nov 2004 19:22:00 +0100


Thanks for taking the time to discuss this.

> 1- If you don't want to use KDE applications don't install them, the
> mimesystem list the installed applicationsn, that seems to be right (if
> the app has been installed that's probably because somebody wants to use
> it, isn't it ?)
> 2- KDE applications work fine under GNOME

In both cases, you seem to be thinking in terms of what is convenient 
for a desktop computer used by a single person.  But Debian is used in 
other contexts  as well.  For example, we use it in a computer lab, 
where different people may be using the same machine for running 
different desktops.  If installation of additional packages changes 
preferences or behavior significantly, that's a problem.  Also, giving 
users choices that do not conform to the user interface guidelines for 
their current desktop environment leads to problems.

Furthermore, while KDE applications may "work fine" under Gnome, in the
sense that they work roughly like they would work under KDE, their
appearance and behavior still differs noticeably from that of Gnome
applications, which sounds like it would cause support and usability
problems.

> The mimesystem works in this way:
> 
> 1- it uses the "MimeType=..." entries
> in /usr/share/applications/*.desktop
> 2- for a given mimetype you get a list of applications managing it
> 3- if you don't specify a default for a mimetype it uses the alphabetic
> order

It doesn't seem to be that simple.  There are also /etc/mailcap and
/etc/mailcap.order, and /usr/share/mime-info/ and
/usr/share/applications/mimeinfo.cache.  And then there is
~/.gnome/mime-info/user.* (generated by gnome-vfs-mime-info and using
yet another file format).  KDE applications put themselves into
/usr/share/applications/kde, /usr/share/apps/, and /usr/share/services/
  Different applications seem to be using all these descriptors in
different ways for determining which applications to launch. And then
there is "shared-mime-info", which uses XML descriptors and interacts
with the above in some other way.

(It also seems dangerous to put any of this in /usr/share because the
set of applications available is a host-specific list.  The desktop
descriptors can only be put in /usr/share if every single application
that uses them treats them as advisory only and checks whether the
applications actually exist on the machine where it is running.)

> So now, the default application for a mimetype can be changed in a
> defaults.list file .. perhaps we should make a gnomish version of this
> file to installe with the GNOME meta packages.

Maybe that's a good solution.  Or maybe it turns out that there are
already enough different categories and the desktops just need to use
them more consistently.  Or maybe the problem is harder than that.
Perhaps it would be good to think about this a bit more first.

How MIME types get mapped to applications that handle them is of
fundamental importance for the usability of the Linux desktop.  While
there are many areas where I think consistency is overrated, one area
where consistency is crucially important is that users shouldn't get
presented with unexpected applications hapahzardly.  For an expert user,
that is annoying, and for a novice user it is devastatingly confusing to
be in an application that almost looks like what they expect but is
somehow different.

Here are some principles I'd suggest thinking about; to avoid complex
circumlocutions, I'm writing about it from the perspective of a Gnome
user, but you can reverse Gnome and KDE and the same principles should
apply:

(1) Gnome should have a predictable set of preferred MIME type handlers
that are known to work correctly and that users get out of the box if
they don't do anything else. These may not be the applications you or
I prefer, or the applications most users eventually use, but they should
be the applications that are least surprising, most usable, and most
reliable.

(2) A mapping of MIME types to applications should never change for a
user without explicit user interaction and consent (the only exception 
is if the application is missing or crashes, in which case the user 
needs to make an explicit new selection).

(3) Developers should recognize that which MIME handlers are used depends
on the context: the identity of the user, the installed set of
applications, and the desktop that the user is currently running.

(4) There are several different categories of applications: those that
are assumed to satisfy Gnome interface guidelines, those that are known
to differ from them but still are considered "desktop" applications and
strive for some level of integration (e.g., KDE), those that pop up
their own window but don't even try to integrate with the desktop (older
X11 apps, most Java apps, text-app-in-xterm), and those that are pure
text applications.  The only applications that should get offered to
users as choices for opening files are those that are assumed to satisfy
the Gnome interface guidelines; the user should have to take an explicit
additional action (like selecting "Advanced...") in order to select
possibly non-compliant applications.

(5) Users should be informed about the availability of newly installed
MIME handlers and offered a choice.  Windows does this at install time
("Would you like to associate this application...?"), which is kind of
obscure.  There doesn't seem to be an ideal solution, but Gnome could
pop up a dialog box when, say, a new PDF viewer has been installed and
say "One or more new applications have become available for handling
this MIME type; would you like to continue to use the application you
are currently using or select a new application?"  However, this choice
should only be offered explicitly for applications that are known to be
common alternatives (i.e., Gnome should only offer it for Gnome
applications, not when some KDE application gets installed).

(6) People should strive to make MIME handling consistent for the 
current environment: if I use Konqueror under Gnome, then Konqueror 
should use the Gnome MIME handlers for opening PDFs.  Ditto for Firefox.

Well, altogether, there seem to be several levels of possible problems
and possible solutions.

* In the short term, the Gnome and KDE package maintainers can perhaps
figure out a way to avoid the phenomenon that I observed, namely that
merely installing KDE seems to cause all sorts of things to change/break
under Gnome.  Maybe merely for KDE to stop adding its applications to
/usr/share/applications would do the trick.

* In the long term, Gnome, KDE, and freedesktop.org need to figure out
better mechanisms for MIME handling.  The Shared MIME-Info database
seems to be an attempt at that, but I think it still fails to address
some key issues, like context dependency.  I suspect we also need some
common, desktop-neutral application launching API (freedesktop.org
doesn't seem to have one yet) and we need to get applications like
Mozilla to use it.

Cheers,
Thomas.