Re: [Tracker] [PATCH] Application Indexing

Il giorno sab, 03/03/2007 alle 16.49 +0100, Michael Biebl ha scritto:

1) we need to watch the dirs for desktop files (use
tracker_add_service_path to watch /usr/share/applications)

2) we use (1) above to work out its a desktop file (im not sure about
checking the extension is .desktop - Im only really interested in apps
in /usr/share/applications)

/usr/share/applications is a good default, but you should also check
the environment variable XDG_DATA_DIRS. This contains a list of paths
[2]. You should also check these paths (you have to append
"applications" to each element in XDG_DATA_DIRS).

As well as XDG_HOME_DIR for user defined launchers. See GNOME Admin
Guide for an overview on XDG desktop entry spec, menu definition spec
and basedir spec.

The algorithm should be something like

        if $XDG_DATA_HOME == NULL then
          find .desktop files in ~/.local/share
        else find .desktop files in $XDG_DATA_HOME/applications/
        if $XDG_DATA_DIRS == NULL then
          find .desktop files in ~/.local/share
        else find .desktop files in $XDG_DATA_DIRS/applications/
Please also note that fd.o desktop entry spec defines an Hidden key as
well as NoDisplay key. IMHO tracker should ignore them, as it ignores
files in trash.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]