Journal integration for Scratch

Tomeu Vizoso tomeu at sugarlabs.org
Mon Jan 12 11:55:36 EST 2009


On Mon, Jan 12, 2009 at 17:38, Bert Freudenberg <bert at freudenbergs.de> wrote:
>
> On 12.01.2009, at 17:03, Tomeu Vizoso wrote:
>
>> On Mon, Jan 12, 2009 at 16:52, Bert Freudenberg <bert at freudenbergs.de>
>> wrote:
>>>
>>> On 12.01.2009, at 10:16, Tomeu Vizoso wrote:
>>>
>>>> Ok, what you just did will tell Sugar that Scratch is able to open
>>>> files with the mime type 'application/x-scratch-project'. But this
>>>> will not affect the icon of those files.
>>>
>>> Is there a way to assign icons for files other than by saving it in an
>>> activity?
>>
>> Currently, only by changing the mime-type.
>
>
> Maybe I misunderstood then. How is the icon for a mime type such as
> application/x-scratch-project found then?

We are using the xdg mime database, the mimetypes.xml file contained
in activities is added to that database. So that's the mechanism
through which activities can associate icons to mime types.

In a python shell inside strace -e open:

>>> gio.content_type_get_icon('image/png')
open("/home/tomeu/.local/share//mime/mime.cache", O_RDONLY|O_LARGEFILE) = 3
open("/home/tomeu/sugar-jhbuild/install/share/mime/mime.cache",
O_RDONLY|O_LARGEFILE) = 3
open("/usr/share/mime/mime.cache", O_RDONLY|O_LARGEFILE) = 3
open("/usr/local/share//mime/aliases", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
open("/usr/local/share//mime/subclasses", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
open("/usr/local/share//mime/icons", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory)
open("/usr/local/share//mime/generic-icons", O_RDONLY|O_LARGEFILE) =
-1 ENOENT (No such file or directory)
open("/usr/share//mime/mime.cache", O_RDONLY|O_LARGEFILE) = 3
open("/usr/share/gdm//mime/aliases", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory)
open("/usr/share/gdm//mime/subclasses", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
open("/usr/share/gdm//mime/icons", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory)
open("/usr/share/gdm//mime/generic-icons", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
<gio.ThemedIcon at 0xb7de8c84: image-png, gnome-mime-image-png, image-x-generic>

Regards,

Tomeu



More information about the Devel mailing list