[Kde-games-devel] KMahjongg frameworks branch

Frederik Schwarzer schwarzer at kde.org
Thu Dec 3 04:06:52 UTC 2015


Am Montag, 30. November 2015, 12:38:14 schrieb Ian Wadham:
> On 30/11/2015, at 10:52 AM, Frederik Schwarzer wrote:

Hi Ian,

> > 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.


> 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.

Regards,
Frederik


More information about the kde-games-devel mailing list