Integrating TP-Logger with KDE

Stefano Sanfilippo stefano.k.sanfilippo at gmail.com
Thu Feb 17 20:23:23 CET 2011


In data mercoledì 16 febbraio 2011 01:38:40, Daniele E. Domenichelli ha 
scritto:
> I think you can apply for an account at https://identity.kde.org/ and
> use your scratch area on kde git server (see
> http://community.kde.org/Sysadmin/GitKdeOrgManual )

I'm just about to apply :)

I've defined 4 classes, plus a base "virtual" class doing common 
initialization. Each class correspond to one type of query (by name, by date, 
by keyword, test if valid) and has a common interface.

One creates the Query object (e.g. DateQuery, or SearchTextQuery) supplying 
the path of a valid dbus connection manager as a QString (e.g. 
"org.freedesktop.Telepathy.Connection.gabble.jabber.[...]") , then the object 
may be used to submit queries using a "perform" slot (usually, with a QString 
`key' parameter). The asynchronous response is beared by a "completed(QList<T> 
results)" signal (if no match, an empty list).

For instance:

|   [...]
|
|   // Search for all dates in which "Hi, John" was said...
|
|   DateQuery q(CONNECTION_MANAGER);
|
|   connect(&q, SIGNAL(completed(QList<QDate>)),
|          chatwidget, SLOT(highlightDates(QList<QDate>));
|
|   q.perform("Hi, John!");
|
|   [...]

I've placed everything under a Tp::Logger namespace... Tell me whether it's 
good, or should I follow a different naming convention ;)

Cheers,

--SLS


More information about the KDE-Telepathy mailing list