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

David Faure faure at kde.org
Thu Jan 1 13:41:37 UTC 2015


On Tuesday 23 December 2014 11:25:16 Marko Käning wrote:
> > What does `kde4-config --path xdgdata-mime` return?
> 
> $ kde4-config --path xdgdata-mime
> /Users/marko/.local/share/mime/:/opt/local/share/mime/

OK, so this works in kdelibs4 because when compiling kdecore, the install 
prefix gets compiled into it (config-prefix.h.cmake sets KDEDIR to the install 
prefix), and then KStandardDirs adds that plus "/share" to the list of XDG 
data dirs.

This was a transitional solution, it doesn't conform to the XDG specification, 
it breaks when installing libs and apps into different prefixes, and it's not 
practical anyway for the Qt5+KF5 setup where Qt itself (QStandardPaths) is 
looking into the XDG data dirs, without the information of where KF5 or the 
apps got installed. (Qt itself could very well be somewhere else than in 
/opt/local...)

But if /opt/local is such a common prefix on Mac, maybe we can extend 
qstandardpaths on mac to know about it...

So, how about something like the patch below? Can you test it? Should we also 
honour $XDG_DATA_DIRS and $XDG_CONFIG_DIRS, in case someone sets up MacPorts 
with a different prefix than /opt/local?

http://www.davidfaure.fr/2014/qstandardpaths_mac.mm.diff

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



More information about the kde-mac mailing list