[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: Re: Dataengnies
From: "Aaron J. Seigo" <aseigo () kde ! org>
Date: 2008-08-27 17:04:11
Message-ID: 200808271104.12031.aseigo () kde ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Wednesday 27 August 2008, Aaron J. Seigo wrote:
> On Wednesday 27 August 2008, Petri Damstén wrote:
> > On Tuesday 26 August 2008 23:38:47 Aaron J. Seigo wrote:
> > > and yes, if the engine is doing any sort of expensive work then the
> > > code needs to protect against it being called while the async job is in
> > > progreess.
> >
> > Yes, that's true.
> >
> > > doing async calls inside the DataEngine subclas itself is really not
> > > the best way to do things. encapsulating it inside a DataContainer
> > > subclass makes it waaaay easier to manage.
> >
> > This was new to me :-) Converted ExecutableEngine to use custom Container
> > (attached). One problem. exec is called in constructor to start process
> > for the first time. checkForUpdate is called when process finished but
> > seems that m_queued is false and dataUpdated is not called. On second
> > exec (first updateRequested signal, which comes after first timeout) it
> > works:
>
> you probably want to do:
>
> emit dataUpdated(objectName(), data());
>
> in ExecutableContainer::finished
actually, scratch that. checkForUpdate is better than doing it manually; the
issue is *probably* that the signal/slot connections haven't been made yet.
it's not safe to start an update from the constructor due to this. so .....
you can do one of two things:
* call ExecutableContainer::exec() from the engine right after it is created
* QTimer::singleShot(0, this, SLOT(exec())); inside the ExecutableContainer
ctor
the first option is probably the safest, however.
--
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
["signature.asc" (application/pgp-signature)]
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic