Summary: | listAllEngines() sometimes returns empty list | ||
---|---|---|---|
Product: | [Unmaintained] plasma4 | Reporter: | Mark Kretschmann <kretschmann> |
Component: | general | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED WORKSFORME | ||
Severity: | crash | CC: | amarok-bugs-dist, aseigo |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Mark Kretschmann
2009-03-25 11:09:52 UTC
Using KDE 4.2.1, forgot to mention this. listAllEngines just does a KServiceTypeTrader call: KService::List offers = KServiceTypeTrader::self()->query("Plasma/DataEngine", constraint); if there's an error (versus just an empty set returned) you should get some debut output to that effect on console as well. it might be interesting to see what's up in KServiceTypeTrader there; however, it would seem to me to make more sense to do something like what Plasma::Applet does and keep track of the DataEngines loaded by your objects and unload them when they exit. that way you don't even need the list afterwards. looking at the code, however, this all seems a bit superfluous. the dataEngine is ref'd when an applet loads it, and unrefed when the applet is done with it (e.g. when it is deleted). so perhaps the real issue here is that applets aren't getting deleted on exit? Ok, considering what you wrote, I find it now less likely that this is a bug in libPlasma. My new theory is that this only affects specific setups, where Amarok is installed in such a way that ksycoca sometimes does not work reliably. But please let me keep this report open a for a while, until I can be more certain about my suspicions. Will take care of closing it then, or otherwise report my findings. i don't see why you should be needing to delete the engines in this manner in the first place? the applets accessing them via dataEngine will have them automatically deleted for them when they are deleted (and thus the usage count on the engine drops to zero), so just make sure to delete all the applets on exit for that. if other things are using engines, they should similarly keep track of it. but looking at the amarok sources, it's just applets that are using the dataengines, so it seems to me that either the applets aren't being deleted at close or else the reference counting isn't working as expected. Ooook, after some days of thinking and experimenting I can say with some confidence: This is _not_ a bug in Plasma :) The real problem outlined in short: Some people had set $KDEDIR in .bashrc, which ksycoca does not pick up reliably. Moving this to $HOME/.kde/env/myenv.sh fixes the problem (although this solution is not all that obvious;) I've blogged an updated guide for installing Amarok here: http://amarok.kde.org/blog/archives/989-Building-Amarok-SVN-in-HOME-An-Update.html Cheers guys (hey, let's go clubbing some time again!) |