Mailinglist Archive: opensuse-gnome (60 mails)

< Previous Next >
[opensuse-gnome] Junior Job: registering URI scheme handlers with glib 2.27
  • From: Vincent Untz <vuntz@xxxxxxxxxxxx>
  • Date: Tue, 12 Oct 2010 03:45:21 +0200
  • Message-id: <20101012014521.GH2016@xxxxxxxxx>
Hi,

We're going to ship glib 2.28 in openSUSE 11.4, since 2.28 should be out
in December.

There's one change that we must prepare for, though: the way URI scheme
handlers are registered changed. Before, applications used to register
themselves in gconf (see /desktop/gnome/url-handlers). The new glib
won't support that anymore and will use the MIME type system.

See Bastien's post for some more background:
http://www.hadess.net/2010/10/new-control-center-and-you.html

What does it mean for us? It means that we have to patch various
packages for this, and the good news is that by doing this, we can help
upstream. It's really easy to do, and I'm looking for volunteers :-)

Below are some instructions. It's a bit long. And it's late here, so
maybe they won't be really clear to everyone ;-) But just ask if you
want to help and face an issue.

Here is the upstream tracker bug:
https://bugzilla.gnome.org/showdependencytree.cgi?id=631433&hide_resolved=0

Let's take an example: Yelp. If you go the tracker bug, you'll find a
bug for yelp:
https://bugzilla.gnome.org/show_bug.cgi?id=631678
We need to register yelp for the x-scheme-handler/ghelp,
x-scheme-handler/info and x-scheme-handler/man MIME types. So here are
the steps we'll do:

a) branch yelp in the build service (osc branch GNOME:Factory yelp)
b) look for the source of the desktop file in the tarball. In this
case, this is yelp.desktop.in.in.
c) add the MIME types to the MimeType key. If there's no such key,
create one. For yelp, there's no such key, so we create one:
MimeType=x-scheme-handler/ghelp;x-scheme-handler/info;x-scheme-handler/man;
d) make sure that the Exec line has %u or %U as argument. This is
required to accept the URI that has to be opened. %u is for only one
URI, and %U is for multiple URI. In the case of yelp, we probably
want %u, and we see that the Exec line doesn't have %u nor %U, so we
add %u.
e) to make sure you were right to do this, manually simulate the
opening of such an URI. Call "yelp ghelp:evince" and see if it works
fine. (We replaced %u with ghelp:evince).
f) it's also important to make sure that simply calling the Exec line
by removing %u or %U works. For example, if yelp needs --open to
open a URI, you would use "yelp --open %u". But you have to check
that "yelp --open" doesn't fail and just launches yelp. If it
doesn't, then it will be a bit more complex and I suggest for now to
just report in the bug that yelp needs to be adapted.
f) create a patch of these changes, and submit it in bugzilla, as well
as in the build service

Additionally, we need someone to also patch totem with the two patches
that were committed in git for this:

http://git.gnome.org/browse/totem/commit/?id=74833ef98e515104a5ef10b0e59af0b5a0244ed7

http://git.gnome.org/browse/totem/commit/?id=b337849b174efd6b11304ddcdd3cfda015ffef5b

There will be other apps to patch, that are not tracked in the upstream
bug. Looking at what I have in gconf, we probably want to patch the
desktop file for firefox (to support ftp and http) and transmission (to
support magnet). We could also patch xchat (but it needs to be done
carefully -- I'll let that as an exercice to the reader).

Thanks,

Vincent

--
Les gens heureux ne sont pas press├ęs.
--
To unsubscribe, e-mail: opensuse-gnome+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-gnome+help@xxxxxxxxxxxx

< Previous Next >