[Kde-games-devel] KMahjongg frameworks branch

Ian Wadham iandw.au at gmail.com
Thu Dec 3 06:16:46 UTC 2015


Hi Frederik,

On 03/12/2015, at 3:06 PM, Frederik Schwarzer wrote:
> Am Montag, 30. November 2015, 12:38:14 schrieb Ian Wadham:
>> On 30/11/2015, at 10:52 AM, Frederik Schwarzer wrote:
>>> it might be a bit more tricky
>>> because the files in question are stored in
>>> /usr/share/kmahjongg/layouts/ and I did not see an equivalent to
>>> that in the QStandardDirs namespace.
>> 
>> Do you mean QStandardPaths(?).
> 
> Yes, sorry. Got confused.
> 
> 
>>> Also there is more things like netaccess and configuration stuff
>>> coming from kdelibs4support. Not sure if I want to tackle these
>>> now.
>> The KMahjongg class is using KGlobal::dirs()->findAllResources() and
>> there is a special example of porting that in
>> https://community.kde.org/Frameworks/Porting_Notes/KStandardDirs.
> 
> Yes, but in KMahjongg, findAllResources() is fed from
>    addResourceType( [...] "kmahjongg/layouts/"));
> and as far as I can tell there is no direct way to find certain files in 
> certain subfolders. So I cannot look for 
> "kmahjongg/layouts/*.desktop". The result is an empty list.
> 
> But as I scrolled down the page a bit more, I probably found the 
> solution. One has to locate the folders and the foreach over them to 
> get the files. I will try that tomorrow.

There is an example even further down of how to hand-code a port
of addResourceType( ), a method which is not available in Qt.

>> Don't ask me what it all means, though.  QStandardPaths has been a
>> real stumbling block in Apple OS X implementation.
> 
> I wonder how it could work so far, since there are so many hard-coded 
> path delimiters in KDE.

The prefixes are not so hard-coded and can be set at app installation time
in KDE 4, e.g. .../share in Linux.  Re Qt 5, argument rages over what
those prefixes should be for KF5 apps and libs in an Apple environment.

Cheers, Ian W.



More information about the kde-games-devel mailing list