[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Mon Mar 28 07:44:48 CEST 2005


CVS commit by staikos: 

temporary hack to force images to be updated


  M +36 -1     updatethread.cpp   1.45


--- kdeextragear-2/kst/kst/updatethread.cpp  #1.44:1.45
@@ -22,8 +22,9 @@
 #include <kdebug.h>
 
-#include "kstvcurve.h"
 #include "kstdatacollection.h"
 #include "kstdoc.h"
+#include "kstimage.h"
 #include "kstrvector.h"
+#include "kstvcurve.h"
 #include "threadevents.h"
 
@@ -187,4 +188,38 @@ 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());
+#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;
+#endif
+        }
+      }
+
+      if (_done || (_paused && !force)) {
+#if UPDATEDEBUG > 1
+        kdDebug() << "5 Returning from scan with U=" << (int)U << endl;
+#endif
+        return U == KstObject::UPDATE;
+      }
+    }
+  }
+
   // Update the files
   if (!_paused) { // don't update even if paused && force




More information about the Kst mailing list