GSoC: DataEngine caching progress.

Brian Pritchett batenkaitos at gmail.com
Sat Jun 26 01:08:26 CEST 2010


Hi,
	So here is a quick update on the progress of the DataEngine caching 
progress. Right now, I have a service called Storage with a simple API that 
can retrieve and save key/data pairs. Only strings and ints can really be 
supported. However, if the datatype isn't a string or an int, it gets 
converted to a base64 string, and passed. This allows to support any datatype.

I've edited DateEngine and have added a setEnableCache(QString, bool) to allow 
any data engine to easily cache a named source. All this member does is call 
DataContainer::setEnableCache(true).

DataEngine can now call to cache any source, at any time. It will only proceed 
if the DataContainer marked to be cached, and is also marked that the data in 
it hasn't been cached (this is done in setData).

I was able to easily make the microblogging plasmoid cache its TimelineSource 
by just calling setEnableCache(true) in its constructor. :)

Things to do:
* Add a timer to cache all the sources that need to be cached, probably every 
2-5 minutes.
* Add the code that retrieves the data and inserts it when a source is 
created.
* Currently, the cached data is saved on disk using KConfig, this needs to 
change to saving in Akonadi.

If you would like to look at the code, there is a branch in branches/work/soc-
storage/plasma. The relevant files are private/storage.h private/storage.cpp 
dataengine.cpp and datacontainer.cpp

I'd be glad to answer any questions! :)
--Brian Pritchett


More information about the Plasma-devel mailing list