mime apps specification
David Faure
faure at kde.org
Tue Apr 15 12:13:18 PDT 2014
On Monday 14 April 2014 11:14:41 Vladimir Kudrya wrote:
> On 14.04.2014 01:28, Vladimir Kudrya wrote:
> > Maybe example would clarify things? The spec would need an example anyway.
>
> I will update this question taking into account the new patch and
> inability for desktop-specific list to add/remove apps.
>
> $XDG_CONFIG_HOME desktop-specific list:
> [Default Applications]
> foo/bar=app2.desktop
>
> $XDG_CONFIG_HOME list:
> [Added Associations]
> foo/bar=app2.desktop
> [Removed Associations]
> foo/bar=app4.desktop
>
> $XDG_DATA_HOME applications:
> app5.desktop
>
> $XDG_CONFIG_DIRS list:
> [Removed Associations]
> foo/bar=app2.desktop
>
> $XDG_DATA_DIRS desktop-specific list:
> [Default Applications]
> foo/bar=app3.desktop
>
> $XDG_DATA_DIRS list:
> [Default Applications]
> foo/bar=app1.desktop
> [Added Associations]
> foo/bar=app4.desktop
>
> $XDG_DATA_DIRS applications:
> app1.desktop;app2.desktop;app3.desktop
>
>
> Please show how to iterate through the list.
When looking for the default app, we'll get app2, from the very first file in
the list.
When looking for the full list of associated apps:
(the step numbers correspond to the items in the algorithm in the spec) (*)
step 1: result = (), blacklist = ()
step 2: opening $XDG_CONFIG_HOME desktop-specific list, no Added or Removed
group, skipping. Then opening $XDG_CONFIG_HOME list.
step 3: result = (app2)
step 4: blacklist = (app4)
step 5 and 6: no desktop files here, skipping
Then moving up one dir, to $XDG_DATA_HOME applications:
step 3,4: no mimeapps.list found, nothing to do
step 5: result = (app2, app5)
step 6: blacklist = (app4, app5)
Then moving up one dir, to $XDG_CONFIG_DIRS list:
step 3: none
step 4: blacklist = (app4, app5, app2)
step 5 and 6: no desktop files here, skipping
Then moving up one dir, to $XDG_DATA_HOME applications, nothing to do
Then moving up one dir, to $XDG_DATA_DIRS (has both mimeapps.list and apps)
step 3: nothing (do not append app4 to result since it's in the blacklist)
step 4: none
step 5: add app1 and app3 (not app2, it's in the blacklist)
=> result = (app2, app5, app1, app3)
> Is the result app2.desktop;app3.desktop;app1.desktop;app5.desktop?
No. I think you missed the fact that we go up the dirs in order, and process
both (or either, whatever is available) mimeapps.list and .desktop files.
So app5 gets added before we go up to more global dirs.
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5
More information about the xdg
mailing list