kde-extraapps/kdeplasma-addons/dataengines/potd/HowToAddProvider.txt
2015-01-15 17:07:43 +00:00

20 lines
854 B
Text

HOW TO ADD A NEW PICTURE OF THE DAY AND HOW TO USE THE ENGINE
- in the data engine "apod"
Add your provider in the Potd class, updateSource( const QString &identifier ) method
- in the applet, you get a QImage and you can call the provider with
Plasma::DataEngine *engine = dataEngine( "potd" );
QDate mCurrentDate = QDate::currentDate();
const QString identifier = QString("apod") + ":" + mCurrentDate.toString( Qt::ISODate );
engine->disconnectSource( identifier, this );
engine->connectSource( identifier, this );
const Plasma::DataEngine::Data data = engine->query( identifier );
QImage mImage = data[ identifier ].value<QImage>();
- TO DEBUG your new provider you need to comment the lines about caching the pic in
potd.cpp at the beginning of the
bool PotdEngine::updateSource( const QString &identifier )
method.