From 9316dbd0d528efa3b6aa638955d1ecf971867461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9nard?= Date: Fri, 25 Apr 2008 19:45:09 +0000 Subject: [PATCH] +checkForUpdate()->protected +int timeSinceLastUpdate()->protected+return uint svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801145 --- datacontainer.cpp | 40 ++++++++++++++++++++-------------------- datacontainer.h | 24 +++++++++++++----------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/datacontainer.cpp b/datacontainer.cpp index f23dd2df9..5570494e3 100644 --- a/datacontainer.cpp +++ b/datacontainer.cpp @@ -69,26 +69,6 @@ void DataContainer::removeAllData() d->updateTs.start(); } -void DataContainer::checkForUpdate() -{ - if (d->dirty) { - emit dataUpdated(objectName(), d->data); - - foreach (SignalRelay* relay, d->relays) { - relay->checkQueueing(); - } - - d->dirty = false; - } -} - -int DataContainer::timeSinceLastUpdate() const -{ - //FIXME: we still assume it's been <24h - //and ignore possible daylight savings changes - return d->updateTs.elapsed(); -} - bool DataContainer::hasUpdates() const { if (d->cached) { @@ -193,6 +173,26 @@ void DataContainer::disconnectVisualization(QObject* visualization) checkUsage(); } +void DataContainer::checkForUpdate() +{ + if (d->dirty) { + emit dataUpdated(objectName(), d->data); + + foreach (SignalRelay* relay, d->relays) { + relay->checkQueueing(); + } + + d->dirty = false; + } +} + +uint DataContainer::timeSinceLastUpdate() const +{ + //FIXME: we still assume it's been <24h + //and ignore possible daylight savings changes + return d->updateTs.elapsed(); +} + } // Plasma namespace #include "datacontainer.moc" diff --git a/datacontainer.h b/datacontainer.h index 8786fa21c..aa5e126b9 100644 --- a/datacontainer.h +++ b/datacontainer.h @@ -41,6 +41,7 @@ namespace Plasma **/ class PLASMA_EXPORT DataContainer : public QObject { + friend class DataEngine; Q_OBJECT public: @@ -75,17 +76,6 @@ class PLASMA_EXPORT DataContainer : public QObject **/ void removeAllData(); - /** - * Checks for whether the data has changed and therefore an update - * signal needs to be emitted. - **/ - void checkForUpdate(); - - /** - * Returns how long ago, in msecs, that the data in this container was last updated - **/ - int timeSinceLastUpdate() const; - /** * @internal **/ @@ -145,6 +135,18 @@ class PLASMA_EXPORT DataContainer : public QObject * requests to be updated. **/ void updateRequested(DataContainer *source); + protected: + /** + * Checks for whether the data has changed and therefore an update + * signal needs to be emitted. + **/ + void checkForUpdate(); + + /** + * Returns how long ago, in msecs, that the data in this container was last updated + **/ + uint timeSinceLastUpdate() const; + private: friend class SignalRelay;