[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Tue Apr 13 23:18:09 CEST 2004


CVS commit by arwalker: 

Update the plugin vectors in the new threading model.


  M +25 -0     updatethread.cpp   1.10


--- kdeextragear-2/kst/kst/updatethread.cpp  #1.9:1.10
@@ -168,8 +168,33 @@ bool UpdateThread::doUpdates(bool force)
   {
     // Must make a copy to avoid deadlock
+    KstPluginList pluginList = kstObjectSubList<KstDataObject,KstPlugin>(KST::dataObjectList);
     KstBaseCurveList cl;
     KstDataObjectList ncl;
     kstObjectSplitList<KstDataObject,KstBaseCurve>(KST::dataObjectList, cl, ncl);
 
+    // Update all data objects that are plugins
+    for (i = 0; i < pluginList.count(); ++i) {
+      KstPluginPtr pp = pluginList[i];
+      if( pp != NULL ) {
+#if UPDATEDEBUG > 0
+        kdDebug() << "updating plugin: " << (void*)pp << " - " << pp->tagName() << endl;
+#endif
+        pp->writeLock();
+        pp->update(_updateCounter);
+        pp->writeUnlock();
+
+        if (_done || _paused) {
+#if UPDATEDEBUG > 1
+          kdDebug() << "4 Returning from scan with U=" << (int)U << endl;
+#endif
+          return U == KstObject::UPDATE;
+        }
+      } else {
+#if UPDATEDEBUG > 0
+        kdDebug() << "updating plugin error: pp is NULL" << endl;
+#endif
+      }
+    }
+    
     // Update all data objects that are not curves
     for (i = 0; i < ncl.count(); ++i) {





More information about the Kst mailing list