[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Thu Mar 18 10:17:00 CET 2004


CVS commit by staikos: 

"Living on the edge"

- Add more #ifdef debug groups for debugging the update thread


  M +36 -3     updatethread.cpp   1.7


--- kdeextragear-2/kst/kst/updatethread.cpp  #1.6:1.7
@@ -25,4 +25,6 @@
 #include "threadevents.h"
 
+// 0 - none, 1 - some, 2 - lots, 3 - too much
+#define UPDATEDEBUG 0
 
 UpdateThread::UpdateThread(KstDoc *doc)
@@ -46,5 +48,7 @@ void UpdateThread::run() {
   for (_done = false; !_done; QThread::msleep(50)) {
     if (_paused) {
+#if UPDATEDEBUG > 0
       kdDebug() << "Update thread paused..." << endl;
+#endif
       continue;
     }
@@ -57,4 +61,7 @@ void UpdateThread::run() {
 
     if (doUpdates(force)) {
+#if UPDATEDEBUG > 1
+      kdDebug() << "Update resulted in: TRUE!" << endl;
+#endif
       QApplication::postEvent(_doc, new ThreadEvent(ThreadEvent::UpdateDialogs));
     }
@@ -70,7 +77,9 @@ bool UpdateThread::doUpdates(bool force)
   int lastFrame = -1;
 
+#if UPDATEDEBUG > 0
   if (force) {
     kdDebug() << "Forced update!" << endl;
   }
+#endif
 
   _updateCounter++;
@@ -79,5 +88,7 @@ bool UpdateThread::doUpdates(bool force)
   }
 
-  //kdDebug() << "UPDATE: counter=" << _updateCounter << endl;
+#if UPDATEDEBUG > 2
+  kdDebug() << "UPDATE: counter=" << _updateCounter << endl;
+#endif
 
   // Update the files
@@ -91,4 +102,7 @@ bool UpdateThread::doUpdates(bool force)
     if (_done || _paused) {
       KST::dataSourceList.lock().readUnlock();
+#if UPDATEDEBUG > 1
+      kdDebug() << "1 Returning from scan with U=" << (int)U << endl;
+#endif
       return U == KstObject::UPDATE;
     }
@@ -112,4 +126,7 @@ bool UpdateThread::doUpdates(bool force)
         if (_done || _paused) {
           rv->writeUnlock();
+#if UPDATEDEBUG > 1
+          kdDebug() << "2 Returning from scan with U=" << (int)U << endl;
+#endif
           return U == KstObject::UPDATE;
         }
@@ -124,4 +141,7 @@ bool UpdateThread::doUpdates(bool force)
 
       if (_done || _paused) {
+#if UPDATEDEBUG > 1
+        kdDebug() << "3 Returning from scan with U=" << (int)U << endl;
+#endif
         return U == KstObject::UPDATE;
       }
@@ -143,5 +163,7 @@ bool UpdateThread::doUpdates(bool force)
     for (i = 0; i < ncl.count(); ++i) {
       KstDataObjectPtr dop = ncl[i];
-      //kdDebug() << "updating non-curve: " << (void*)dop << " - " << dop->tagName() << endl;
+#if UPDATEDEBUG > 0
+      kdDebug() << "updating non-curve: " << (void*)dop << " - " << dop->tagName() << endl;
+#endif
 
       dop->writeLock();
@@ -150,4 +172,7 @@ bool UpdateThread::doUpdates(bool force)
 
       if (_done || _paused) {
+#if UPDATEDEBUG > 1
+        kdDebug() << "4 Returning from scan with U=" << (int)U << endl;
+#endif
         return U == KstObject::UPDATE;
       }
@@ -158,5 +183,7 @@ bool UpdateThread::doUpdates(bool force)
       for (i = 0; i < cl.count(); ++i) {
         KstBaseCurvePtr dop = cl[i];
-        //kdDebug() << "updating curve: " << (void*)dop << " - " << dop->tagName() << endl;
+#if UPDATEDEBUG > 0
+        kdDebug() << "updating curve: " << (void*)dop << " - " << dop->tagName() << endl;
+#endif
 
         dop->writeLock();
@@ -165,4 +192,7 @@ bool UpdateThread::doUpdates(bool force)
 
         if (_done || _paused) {
+#if UPDATEDEBUG > 1
+          kdDebug() << "5 Returning from scan with U=" << (int)U << endl;
+#endif
           return U == KstObject::UPDATE;
         }
@@ -171,4 +201,7 @@ bool UpdateThread::doUpdates(bool force)
   }
 
+#if UPDATEDEBUG > 1
+  kdDebug() << "6 Returning from scan with U=" << (int)U << endl;
+#endif
   return U == KstObject::UPDATE;
 }





More information about the Kst mailing list