Hi,

In DataEngine it's often convenient to do something like this:

bool Engine::updateSourceEvent(const QString &name)
{
        setData(name, ...);
}

bool Engine::sourceRequestEvent(const QString &name)
{
    setData(name, DataEngine::Data()); // if async
        updateSourceEvent(name);
    return true;
}

sourceRequestEvent & updateSourceEvent are called like this:
- connectSource() interval = 0 -> sourceRequestEvent called
- query() -> sourceRequestEvent called
- connectSource() interval > 0 -> sourceRequestEvent & updateSourceEvent 
called

That means that in my example updateSourceEvent is called twice at start when 
using the last method. This is bad especially when doing some async calls in 
updateSourceEvent. Of course there could be some extra code to prevent his, 
but is the updateSourceEvent call at start needed?

Petri



Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to