[KDE/Mac] Cross-platform with kdeinit5, klauncher5, kded5 and friends

Jeremy Whiting jpwhiting at kde.org
Sat Jan 31 02:24:39 UTC 2015


Ian,

On Fri, Jan 30, 2015 at 7:04 PM, Ian Wadham <iandw.au at gmail.com> wrote:

> Hi Jeremy,
>
> Great work!
>
> On 31/01/2015, at 10:34 AM, Jeremy Whiting wrote:
> > Ok, I took a deep look inside kbuildsycoca5 today. I ran Instruments on
> it and found as Marko already pointed out most of the time spent in there
> is delving deep into /Applications subfolders. I'm not sure exactly what
> it's looking for, mostly .desktop files from what I saw, but it's not
> finding any. Traversing the whole tree is time consuming though, and we
> know it's not likely to find .desktop files inside any .app bundles, so I
> added the attached patch and that sped up both kbuildsycoca5 itself
> (running from the terminal manually) as well as makes kded5 responsive from
> what I can tell. I also ran kmahjongg and was able to save a game, though I
> got a warning about being unable to launch klauncher. I believe that's
> because it's .service file that dbus uses to launch it is not pointing at
> the executable. I'll look into that issue tomorrow.
>
> As far as I can tell, Apple OS X does not use the main *.desktop files
> when launching
> applications (I mean files like ksudoku.desktop).  There are also
> *.desktop files used,
> for example, by games to record details of graphics themes.  But the ones
> that really
> matter, from the point of view of not breaking KDE4/KF5 applications, are
> those used
> to locate plugins, KParts and services (I hope I have used the right
> terms).  When KBS
> finds those *.desktop files, the apps that use them are no longer broken
> on Apple OS X.
>

Right, a quick find in my kdesrc-build prefix (/usr/local/share) for
.desktop files shows these subfolders:
 - applications
 - bomber/themes
 - carddecks/*
 - kf5/locale/countries/*/
 - kf5/locale/currency/
 - kmahjongg/layouts/
 - kservices5/
 - kservices5/cantor/
 - kservicetypes5/
 - ktuberling/pics/
 - kxmlgui5/parley/themes/
 - locale/en_US/kf5_entry.desktop <-- this one is just a .desktop of
translated language names, in every translated language. We used to use
this in kanagram/khangman, but with Qt 5 we simply use QLocale instead
 - picmi/themes
 - plasma/desktoptheme/*/ <-- no idea what these are for, we most
definitely don't need them though imo. Seems like a workspace only runtime
requirement.

Of those I can see each application needing it's own .destop files read,
but not by kbuildsycoca5 I don't think, since it's looking in
ApplicationsLocation and these aren't under there even on linux. I think
there's some other mechanism that's helping find those at runtime iirc.
Parley for instance which uses a copy (shame on parley I know) of kgtheme
uses QStandardPaths::locateAll in GenericDataLocation/parley/themes to find
.desktop files and read them. I guess the original KGTheme probably does
similarly.

As for KParts and services I think most of those come from either
kservices5, kservicetypes5. I'm not sure if those sets of data are cached
by kbuildsycoca5 or not, but they aren't by the code path that's taking a
while on osx currently (VFolder::loadApplications). For example filelight
which has a kpart has installed
/usr/local/share/kservices5/filelightpart.desktop here. As for services I
think those are all defined as dbus services in
$PREFIX/share/dbus/services/*.service

BR,
Jeremy

>
> > Anyway, if you want to test this patch I'll post it on reviewboard once
> someone else has confirmed it improves kbuildsycoca5 slowness. This brings
> us one step closer imo.
> >
> > David,
> >
> > Could you point me at some documentation or explain to me a bit what the
> difference between kinit, kded, kbuildsycoca and klauncher is? I know
> kbuildsycoca checks for system configurations and caches them, like
> contents of .desktop files and such, but I'm not sure where the others fit
> in or what they are for exactly.
> >
> > thanks,
> > Jeremy
> >
> > P.S. uncommenting the qDebug in there is just for testing, when I push
> this to reviewboard I'll remove that change.
>
> We are going to need lots more qDebugs and even a few "fprintf(stderr,"
> lines
> to get to the bottom of what kded5, klauncher5 and kded5 are executing when
> they go wrong on Apple OS X…
>
> Cheers, Ian W.
>
> _______________________________________________
> kde-mac at kde.org
> List Information: https://mail.kde.org/mailman/listinfo/kde-mac
> KDE/Mac Information: http://community.kde.org/Mac
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-mac/attachments/20150130/d7519dad/attachment.html>


More information about the kde-mac mailing list