[weather] brush up WeatherEngine header

wilder-5.14
Friedrich W. H. Kossebau 10 years ago
parent 2d95f93da8
commit ff73fbc508
  1. 33
      dataengines/weather/weatherengine.h

@ -65,31 +65,29 @@ public:
*/ */
WeatherEngine(QObject *parent, const QVariantList &args); WeatherEngine(QObject *parent, const QVariantList &args);
// Destructor
~WeatherEngine() override; ~WeatherEngine() override;
protected: // Plasma::DataEngine API
/** /**
* Load a plugin * We use it to communicate to the Ion plugins to set the data sources.
* @arg pluginName Name of the plugin * @param source The datasource name.
* @return IonInterface returns an instance of the loaded plugin
*/ */
DataEngine* loadIon(const QString& pluginName); bool sourceRequestEvent(const QString &source) override;
protected:
/** /**
* Reimplemented from Plasma::DataEngine. We use it to communicate to the Ion plugins to set the data sources. * @param source The datasource to update.
* @param source The datasource name.
*/ */
bool sourceRequestEvent(const QString &source) override; bool updateSourceEvent(const QString& source) override;
protected Q_SLOTS: protected Q_SLOTS: // expected DataEngine class method
/** /**
* Reimplemented from Plasma::DataEngine. * Slot method with this signature expected in a DataEngine class.
* @param source The datasource to be updated. * @param source The datasource to be updated.
* @param data The new data updated. * @param data The new data updated.
*/ */
void dataUpdated(const QString& source, Plasma::DataEngine::Data data); void dataUpdated(const QString& source, Plasma::DataEngine::Data data);
private Q_SLOTS:
void forceUpdate(IonInterface *ion, const QString &source); void forceUpdate(IonInterface *ion, const QString &source);
/** /**
@ -102,11 +100,6 @@ protected Q_SLOTS:
* @arg source datasource name. * @arg source datasource name.
*/ */
void removeIonSource(const QString& source); void removeIonSource(const QString& source);
/**
* Reimplemented from Plasma::DataEngine.
* @param source The datasource to update.
*/
bool updateSourceEvent(const QString& source) override;
/** /**
* Whenever networking changes, take action * Whenever networking changes, take action
@ -120,6 +113,13 @@ protected Q_SLOTS:
void updateIonList(const QStringList &changedResources = QStringList()); void updateIonList(const QStringList &changedResources = QStringList());
private: private:
/**
* Load a plugin
* @arg pluginName Name of the plugin
* @return IonInterface returns an instance of the loaded plugin
*/
DataEngine* loadIon(const QString& pluginName);
/** /**
* Get instance of a loaded ion. * Get instance of a loaded ion.
* @returns a IonInterface instance of a loaded plugin. * @returns a IonInterface instance of a loaded plugin.
@ -132,6 +132,7 @@ private:
*/ */
QString ionNameForSource(const QString& source) const; QString ionNameForSource(const QString& source) const;
private:
QStringList m_ions; QStringList m_ions;
bool m_networkAvailable; bool m_networkAvailable;
QTimer m_reconnectTimer; QTimer m_reconnectTimer;

Loading…
Cancel
Save