Proposed draft for the thumbnail D-Bus specification

Philip Van Hoof spam at pvanhoof.be
Thu Sep 4 06:47:13 PDT 2008


On Thu, 2008-09-04 at 08:54 -0400, Havoc Pennington wrote:

> 
> > org.freedesktop.PowerManagement.BlackLight
> >  org.freedesktop.PowerManagement.BlackLight.GetBrightness ()
> >  org.freedesktop.PowerManagement.BlackLight.SetBrightness ()
> 
> This is kinda weird (an "inner interface") - think about how it would
> map to Java or C++ or even GObject. At the very least the mapping
> would involve a lot of typing, because you can't do a "using" with an
> interface in the same way you can with a package or namespace, and in
> GObject this is going to be a very long function name.

We plan to remove the org.freedesktop.Thumbnailer.Manager completely.
That's because a Register() doesn't make it possible to persist the
registration of an activable specialized thumbnailer.

We would want to make it possible to shutdown the thumbnailer, and
specialized thumbnailers too, after a specific timeout.

So the idea is to require each specialized thumbnailer to install
a .service file an make itself activatable that way. Then we let it
register itself on the filesystem somewhere (registering that it is the
one supporting [mime-type] on the system).

We are just figuring out how we solve conflicts like:

Thumbnailer X supports A B and C

Thumbnailer Y supports B C and Z

Will X do B and C, or will Y ?



A first idea was to just do this:

gchar *mime_type = g_file_info_get_content_type (info)
gchar *mimet_file = g_strdup_printf ("$XDG../thumbnailers/%s.service",
	 	mangle_string (mime_type);

FILE *file = fopen (mimet_file, "r")

g_free (mimet_file);

if (file) {
   char buf[200];
   fgets (file, buf, 200);

   DBusGProxy *proxy =  dbus_g_proxy_new_for_name (connection, buf,
				THUMBNAILER_PATH,
				THUMBNAILER_INTERFACE);

   dbus_g_proxy_call (proxy, "Create", &error, 
		   G_TYPE_STRV, urlss,
		   G_TYPE_INVALID, 
		   G_TYPE_INVALID);

} else if (we_support (mime_type)) {
	plugin_call (file, mime_type, ...);
} else
	Emit `Error` (0, "No support for" mime_type, ..)

But that meant that $XDG../thumbnailers/%s.service would need to be
written by packagers. So package for Y would overwrite files of package
for X. This is not good for packaging, they say (packagers would hate
us).


Anyway, rethinking all this ... for readers of the draft: discard the
org.freedesktop.Thumbnailer.Manager stuff. It's already outdated.


-- 
Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://pvanhoof.be/blog
http://codeminded.be






More information about the xdg mailing list