[Panel-devel] Data engine questions

Ryan Bitanga ephebiphobic at gmail.com
Sun Nov 25 05:49:27 CET 2007


Hey everyone,

Does anyone know of any way I can send messages to a data engine? I
need to communicate with a data engine to get the data engine to
update itself but I won't necessarily use QObjects so signals and
slots aren't viable. I wanted communication to occur only through the
methods of DataEngine so I don't have to include the header file of
that specific data engine. Currently, the only solution I can think of
is using query( msg ), parsing the message in sourceRequested() then
returning false from sourceRequested(). Is there a better way of doing
this?

I'm writing a data engine to record application launch statistics so
application launchers could share a common way of recording recently
launched applications as well as launch frequency. However, writing
the data engine isn't as simple as I had hoped. Data engines are more
suitable for receiving signals from objects that aren't connected to
it, e.g. filesystem and network information, or accepting input with
an associated output. However, there seems to be no lightweight
message passing, e.g. sending a string to the data engine without
needing an associated data object. The query method returns an unused
empty Data object and seems quite wasteful. Even a signal and slot
implementation would require me to include the header file of the data
engine, so I could connect an applicationLaunched() signal to a slot
in the data engine. Would I be better off creating a non-data engine
class?

A data engine would allow the information to be shared with a quick
launch plasmoid, which would need to notify the data engine of
additional launches itself, but a non-data engine would give allow me
to use a more suitable API.

Any suggestions?

- Ryan


More information about the Panel-devel mailing list