[KDE/Mac] Thoughts on standard directories in Qt5 - QStandardPaths

Ian Wadham iandw.au at gmail.com
Tue Dec 23 11:03:14 UTC 2014

Hi David,

On 23/12/2014, at 7:42 PM, David Faure wrote:
> On Monday 22 December 2014 20:56:57 René J.V. Bertin wrote:
>> Those almost certainly find their stuff because it's in the proper location
>> w.r.t. the install prefix, as your question implies already.
> I doubt that. Any code that looks up mimetypes using the freedesktop shared-
> mime-info spec, is supposed to look into $XDG_DATA_DIRS, which defaults to 
> /usr/share;/usr/local/share.
> That's unrelated to the install prefix of the app.
> So if shared-mime-info is installed elsewhere, apps need that env var, to find 
> it.
> Can one of you install shared-mime-info with MacPorts and watch where it gets 
> installed? And if not in /usr/share or /usr/local/share, can you check if 
> $XDG_DATA_DIRS is set?

In MacPorts' Portfile for shared-mime-info there are some post-processing lines:
    post-activate {
        ui_debug "Updating MIME database..."
        system "${prefix}/bin/update-mime-database -V ${prefix}/share/mime"

Also, there are files installed in ${prefix}/share/mime (i.e. /opt/local/share/mime).
For my KDE 4 installation "ls /opt/local/share/mime" gives me:

XMLnamespaces  generic-icons  inode/         model/         treemagic      x-content/
aliases        globs          interface/     multipart/     types          x-epoc/
all/           globs2         magic          packages/      uri/
application/   icons          message/       subclasses     version
audio/         image/         mime.cache     text/          video/

And, speaking for myself, I do sometimes need to set $XDG_DATA_DIRS.  This
is because I have installed non-MacPorts versions of KDE 4, using a combination
of kdesrc-build and your very own "cb", "cs" and ".my-setup" technique… :-)

    Tara:/opt/local/share>cd /kdedev/kde4m
    Loading /kdedev/kde4m/.my-setup
    Tara:/kdedev/kde4m>echo $XDG_DATA_DIRS

If I do not set XDG_DATA_DIRS, I sometimes get KMessageBox errors about missing
mime types, when testing KDE 4 apps I have edited and built… :-)

Cheers, Ian W.

More information about the kde-mac mailing list