Default Program | File Association
Stanislav Brabec
sbrabec at suse.cz
Tue Jan 29 05:37:38 PST 2008
Alexander Larsson wrote:
> On Tue, 2008-01-29 at 13:48 +0100, Stanislav Brabec wrote:
>
> > > Doing it with two different files is a very bad idea. I mean, what file
> > > would a third party app use? And why should a kde and a gnome app
> > > running in the same session launch different apps for the same files?
> >
> > Doing it using XDG_DATA_DIR is also a bad idea - GNOME and KDE are not
> > ready to install desktop files to different directories, if they share
> > the same prefix. And you want to use KDE applications on GNOME (or vice
> > versa), if there is no appropriate application in your desktop.
>
> There is no need to install the desktop files in these dirs, they can
> still go to a shared dir. Just the defaults.list file (and whatever
> other desktop specific config stuff you need).
Ah, I understand. One special XDG_DATA_DIR containing only defaults.list
and maybe several desktop files for desktop specific applications...
It gives sense.
But it does not fix following problem:
It is a very complex task to create correct defaults.list using the
current format. For example (GNOME), you have to do manually:
- Fill eog.desktop for all image MIME types mentioned in eog.desktop
- Find all MIME types not mentioned in eog.desktop but opened by another
GTK/GNOME viewer and fill this viewer to these MIME types.
- Find all MIME types not opened by any of above and fill generic image
viewer there.
It is even a fragile task - if any of the image viewers is removed,
there is no way to find "second best fit" and application has to choose
randomly.
> > I can imagine additional defaults.list section (backward compatible):
> >
> > [Preferred Applications]
> > KDE=amarok.desktop;gwenview.desktop;
> > GNOME=totem.desktop;eog.desktop;
> > All=mplayer.desktop
>
> And say you're writing an application, for instance a web browser (not
> really related to a desktop), how would you pick what application to
> use? You'd have to do some (likely broken) magic to guess what
> environment you're running in, or you have to hardcode things so that
> you'll start the wrong application when you run in some other desktop.
> Either of these is just wrong.
Hmm. Good hint. In case of starting applications from menu it is clearly
defined in the KDE/GNOME supporting library, but here is is a blind
guess.
But this is more generic problem: Application has Qt and GTK frontend
and you want to choose GTK for GNOME and XFCE session and Qt for KDE
session. Now it is done by ugly hacks in many applications (check for
$KDE_FULL_SESSION and $GNOME_DESKTOP_SESSION_ID).
--
Best Regards / S pozdravem,
Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o. e-mail: sbrabec at suse.cz
Lihovarská 1060/12 tel: +420 284 028 966
190 00 Praha 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
More information about the xdg
mailing list