really don't store things that shouldn't be stored.
svn path=/trunk/KDE/kdelibs/; revision=1168012
This commit is contained in:
parent
d071b6e301
commit
3af1f71492
@ -58,11 +58,12 @@ void DataContainer::setData(const QString &key, const QVariant &value)
|
|||||||
//If it is not set to be stored,then this is the first
|
//If it is not set to be stored,then this is the first
|
||||||
//setData() since the last time it was stored. This
|
//setData() since the last time it was stored. This
|
||||||
//gives us only one singleShot timer.
|
//gives us only one singleShot timer.
|
||||||
if (isStorageEnabled() && !needsToBeStored()) {
|
if (isStorageEnabled()) {
|
||||||
QTimer::singleShot(180000, this, SLOT(store()));
|
if (!needsToBeStored()) {
|
||||||
|
QTimer::singleShot(180000, this, SLOT(store()));
|
||||||
|
}
|
||||||
|
setNeedsToBeStored(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
setNeedsToBeStored(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataContainer::removeAllData()
|
void DataContainer::removeAllData()
|
||||||
@ -187,7 +188,7 @@ DataEngine* DataContainer::getDataEngine()
|
|||||||
|
|
||||||
void DataContainer::store()
|
void DataContainer::store()
|
||||||
{
|
{
|
||||||
if (!needsToBeStored()){
|
if (!needsToBeStored() || !isStorageEnabled()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,6 +354,7 @@ void DataContainer::checkUsage()
|
|||||||
if (d->relays.count() < 1 &&
|
if (d->relays.count() < 1 &&
|
||||||
receivers(SIGNAL(dataUpdated(QString, Plasma::DataEngine::Data))) < 1) {
|
receivers(SIGNAL(dataUpdated(QString, Plasma::DataEngine::Data))) < 1) {
|
||||||
// DO NOT CALL ANYTHING AFTER THIS LINE AS IT MAY GET DELETED!
|
// DO NOT CALL ANYTHING AFTER THIS LINE AS IT MAY GET DELETED!
|
||||||
|
kDebug() << objectName() << "is unused";
|
||||||
emit becameUnused(objectName());
|
emit becameUnused(objectName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,6 @@ void DataEngine::setPollingInterval(uint frequency)
|
|||||||
|
|
||||||
void DataEngine::removeSource(const QString &source)
|
void DataEngine::removeSource(const QString &source)
|
||||||
{
|
{
|
||||||
//kDebug() << "removing source " << source;
|
|
||||||
SourceDict::iterator it = d->sources.find(source);
|
SourceDict::iterator it = d->sources.find(source);
|
||||||
if (it != d->sources.end()) {
|
if (it != d->sources.end()) {
|
||||||
DataContainer *s = it.value();
|
DataContainer *s = it.value();
|
||||||
@ -617,7 +616,7 @@ DataContainer *DataEnginePrivate::source(const QString &sourceName, bool createW
|
|||||||
}
|
}
|
||||||
sourceQueue.enqueue(s);
|
sourceQueue.enqueue(s);
|
||||||
}
|
}
|
||||||
return it.value();
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!createWhenMissing) {
|
if (!createWhenMissing) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user