From kde-commits Fri Sep 04 01:31:38 2009 From: Shawn Starr Date: Fri, 04 Sep 2009 01:31:38 +0000 To: kde-commits Subject: KDE/kdebase/workspace/plasma/dataengines/weather Message-Id: <1252027898.468963.24097.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=125202790724231 SVN commit 1019606 by spstarr: Forgive me for sinning, use a Q_PROPERTY to get aronud the problem of not being able to update the WeatherEngine until we have a nicer solution. This does work however. a FIXME M +22 -0 weatherengine.cpp M +5 -0 weatherengine.h --- trunk/KDE/kdebase/workspace/plasma/dataengines/weather/weatherengine.cpp #1019605:1019606 @@ -99,6 +99,28 @@ return ion; } +/* FIXME: Q_PROPERTY functions to update the list of available plugins */ + +void WeatherEngine::setUpdate(bool update) +{ + Q_UNUSED(update) + + removeSource("ions"); + + // Get the list of available plugins but don't load them + foreach(const KPluginInfo &info, Plasma::DataEngineManager::listEngineInfo("weatherengine")) { + setData("ions", info.pluginName(), + QString("%1|%2").arg(info.property("Name").toString()).arg(info.pluginName())); + kDebug() << "FOUND PLUGINS: " << info.property("Name").toString(); + } +} + +/* This method is unused */ +bool WeatherEngine::update() const +{ + return true; +} + /** * Unload an Ion plugin given a Ion plugin name. */ --- trunk/KDE/kdebase/workspace/plasma/dataengines/weather/weatherengine.h #1019605:1019606 @@ -39,6 +39,7 @@ class WeatherEngine : public Plasma::DataEngine { Q_OBJECT + Q_PROPERTY(bool update READ update WRITE setUpdate) public: /** Constructor @@ -50,6 +51,10 @@ // Destructor ~WeatherEngine(); + // FIXME: Right now use a Q_PROPERTY to force the engine to update plugins installed with KNS, this isn't pretty at all :/ + void setUpdate(bool update); + bool update(void) const; + // initialization void init();