Warning, /plasma/kdeplasma-addons/wallpapers/potd/plugins/HowToAddProvider.txt is written in an unsupported language. File is not indexed.
0001 HOW TO ADD A NEW PICTURE OF THE DAY AND HOW TO USE THE ENGINE
0002
0003 - in the data engine "apod"
0004 Add your provider in the Potd class, updateSource( const QString &identifier ) method
0005
0006 - in the applet, you get a QImage and you can call the provider with
0007
0008 Plasma::DataEngine *engine = dataEngine( "potd" );
0009 QDate mCurrentDate = QDate::currentDate();
0010 const QString identifier = QString("apod") + ":" + mCurrentDate.toString( Qt::ISODate );
0011
0012 engine->disconnectSource( identifier, this );
0013 engine->connectSource( identifier, this );
0014 const Plasma::DataEngine::Data data = engine->query( identifier );
0015 potdProviderData()->wallpaperImage = data[ identifier ].value<QImage>();
0016
0017 - TO DEBUG your new provider you need to comment the lines about caching the pic in
0018 potd.cpp at the beginning of the
0019 bool PotdEngine::updateSource( const QString &identifier )
0020 method.