[KDE/Mac] Thoughts on standard directories in Qt5 - QStandardPaths
Ian Wadham
iandw.au at gmail.com
Sun Dec 7 03:57:52 UTC 2014
On 07/12/2014, at 6:22 AM, Marko Käning wrote:
> I just stumbled over this interesting post from David from August, which shows
> nicely how qtpaths can be used to locate files.
>
> Begin forwarded message:
>
>> From: David Faure <faure at kde.org>
>> Subject: Re: Suggestion to ntroduce an application for testing config paths and access to files installed by cmake or created at runtime
>> Date: 22 Aug 2014 09:35:17 GMT+2
>> To: Marko Käning <mk-lists at email.de>
>> Cc: kde-frameworks-devel at kde.org
>>
>> On Friday 22 August 2014 09:21:13 Marko Käning wrote:
>>> 1) files installed by cmake indeed land where the application expects them
>>> at runtime
>>
>> You can write a script that checks that, using the "qtpaths" executable.
>>
>> For instance xmlgui says
>>
>> kxmlguiclient.cpp:199: const QString file = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, QStringLiteral("ui/ui_standards.rc"));
>>
>> so the script can check that with
>>
>> qtpaths --locate-file ConfigLocation ui/ui_standards.rc
>>
>> which returns this, for me:
>>
>> /d/kde/inst/kde_frameworks/etc/xdg/ui/ui_standards.rc
>>
>> (technically it should be GenericConfigLocation but it's the same on Unix and GenericConfigLocation was only added recently to qtpaths).
</snip>
That's an interesting utility (qtpaths).
> Which reveals for our case:
> ---
> $ XDG_CONFIG_HOME=/opt/kde/install/darwin/mavericks/clang/kf5-qt5/frameworks/kxmlgui/inst/etc/xdg XDG_DATA_HOME=/opt/kde/install/darwin/mavericks/clang/kf5-qt5/kde/kdegames/bovo/inst/share /opt/kde/install/darwin/mavericks/clang/kf5-qt5/qt5/inst/bin/qtpaths --locate-file ConfigLocation ui/ui_standards.rc
> /opt/kde/install/darwin/mavericks/clang/kf5-qt5/frameworks/kxmlgui/inst/etc/xdg/ui/ui_standards.rc
> $ XDG_CONFIG_HOME=/opt/kde/install/darwin/mavericks/clang/kf5-qt5/frameworks/kxmlgui/inst/etc/xdg XDG_DATA_HOME=/opt/kde/install/darwin/mavericks/clang/kf5-qt5/kde/kdegames/bovo/inst/share /opt/kde/install/darwin/mavericks/clang/kf5-qt5/qt5/inst/bin/qtpaths --locate-file GenericDataLocation themes
>
> ---
> that indeed the folder “themes" cannot be found like this.
The files in the "themes" tree are read-only files - graphics content (theme.svg files) and
config/credits for the themes (themerc files), two files for each theme. Being read-only,
they should get installed (in Linux) in $XDG_DATA_DIRS or its defaults, but not in
$XDG_DATA_HOME.
Bovo cannot find the theme.svg and themerc file-pair for any of its Theme objects
because there is a KF5 porting bug in the Theme constructor (see my earlier email).
@EVERYONE: Here is another gem from David that I discovered. It's a bit old, but it does
explain some of the design theory behind Frameworks, Qt5 and QF5 - in slideshow form:
https://devdays.kdab.com/wp-content/uploads/2012/Qt_Addons_KDE_Frameworks.pdf
Cheers. Ian W.
More information about the kde-mac
mailing list