[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Mon Apr 4 07:54:02 CEST 2005
CVS commit by staikos:
update unused objects again until an additional layer is implemented to add
objects to a list of "forced" updates. It's still a race, but it's smaller than
now this way.
The proper fix has to be done in the UI and then this will be removed again.
M +13 -27 updatethread.cpp 1.46
--- kdeextragear-2/kst/kst/updatethread.cpp #1.45:1.46
@@ -24,5 +24,4 @@
#include "kstdatacollection.h"
#include "kstdoc.h"
-#include "kstimage.h"
#include "kstrvector.h"
#include "kstvcurve.h"
@@ -153,5 +152,7 @@ bool UpdateThread::doUpdates(bool force,
{
// Must make a copy to avoid deadlock
- KstBaseCurveList cl = kstObjectSubList<KstDataObject, KstBaseCurve>(KST::dataObjectList);
+ KstBaseCurveList cl;
+ KstDataObjectList dol;
+ kstObjectSplitList<KstDataObject, KstBaseCurve>(KST::dataObjectList, cl, dol);
// Update all curves
@@ -186,30 +187,15 @@ bool UpdateThread::doUpdates(bool force,
}
}
- }
-
- // HACK: remove this (FIXME)
- {
- // Must make a copy to avoid deadlock
- KstImageList cl = kstObjectSubList<KstDataObject, KstImage>(KST::dataObjectList);
- // Update all curves
- for (uint i = 0; i < cl.count(); ++i) {
- KstImagePtr bcp = cl[i];
- assert(bcp.data());
+ // Update all data objects
+ for (uint i = 0; i < dol.count(); ++i) {
+ KstDataObjectPtr dp = dol[i];
+ assert(dp.data());
#if UPDATEDEBUG > 1
- kdDebug() << "updating image: " << (void*)bcp << " - " << bcp->tagName() << endl;
-#endif
- bcp->writeLock();
- KstObject::UpdateType ut = bcp->update(_updateCounter);
- bcp->writeUnlock();
-
- if (U != KstObject::UPDATE) {
- U = ut;
- if (U == KstObject::UPDATE) {
-#if UPDATEDEBUG > 0
- kdDebug() << "Image " << bcp->tagName() << " said UPDATE" << endl;
+ kdDebug() << "updating data object: " << (void*)dp << " - " << dp->tagName() << endl;
#endif
- }
- }
+ dp->writeLock();
+ dp->update(_updateCounter);
+ dp->writeUnlock();
if (_done || (_paused && !force)) {
More information about the Kst
mailing list