From d3a9a2fc5296ed210a9211f16050c52c3f4b8a68 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 25 Aug 2010 21:21:04 +0000 Subject: [PATCH] with DataContainer::store() now protected against bogus calls by checking to see if storage is enabled, we can unconditionally mark items as needed to be stored; this way if an item is later marked for storage, it will still work. this was a flaw in my last commit. svn path=/trunk/KDE/kdelibs/; revision=1168014 --- datacontainer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/datacontainer.cpp b/datacontainer.cpp index cdc55c2ac..80b23c18a 100644 --- a/datacontainer.cpp +++ b/datacontainer.cpp @@ -58,12 +58,11 @@ void DataContainer::setData(const QString &key, const QVariant &value) //If it is not set to be stored,then this is the first //setData() since the last time it was stored. This //gives us only one singleShot timer. - if (isStorageEnabled()) { - if (!needsToBeStored()) { - QTimer::singleShot(180000, this, SLOT(store())); - } - setNeedsToBeStored(true); + if (isStorageEnabled() || !needsToBeStored()) { + QTimer::singleShot(180000, this, SLOT(store())); } + + setNeedsToBeStored(true); } void DataContainer::removeAllData()