Plasma newbie questions and API fuzzyness (perhaps)

Aaron J. Seigo aseigo at kde.org
Thu Mar 20 20:52:08 CET 2008


On Thursday 20 March 2008, Dmitry Suzdalev wrote:
> Ok, perhaps this need to be mentioned in docs - that connectAllSources
> connects all sources that *exist* at the moment when it called. Is it so
> btw? :) Didn't checked.

i've add this clarification to the apidox for DataEngine::connectAllSources.

i'm not sure we want or need this method to connect all sources that ever get 
created, though. connectAllSources is really just a convenience method to 
avoid having to loop over all sources and calling connectSource on each.

> 2. I wonder why the following code inside the data engine:
>
> void MyDataEngine::someFunction()
> {
>         Plasma::DataEngine::Data notificationData;
>         id = 1;
>         // fill data
>
>         setData( QString("notification %1").arg(id), notificationData );
>         kDebug() << "data was set";
> }
>
> produces the following output with applet set up as described in 1. (with
> additional similar sourceRemoved slot):
>
> NotifierApplet::sourceAdded: source "notification 1" added
> NotifierApplet::dataUpdated: source "notification 1" changed
> NotifierApplet::sourceRemoved: source "notification 1" removed
> NotificationsEngine::notify: data was set
> NotifierApplet::dataUpdated: source "notification 1" changed

impossible to say without seeing all of your code. there are  3 ways that 
sourceRemoved can be triggered:

* the number of sources limit was exceeded (if you aren't calling 
setSourceLimit in your code, that isn't it)

* removeSource or clearSources is being called in your engine

* the applet is disconnecting from the source at some point and the source was 
created on demand (in sourceRequested) dropping the usage count to 0.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080320/af8b4ff1/attachment.pgp 


More information about the Panel-devel mailing list