[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Wed Feb 11 13:43:12 CET 2004


CVS commit by staikos: 

make more sense, less crash


  M +23 -13    kstdoc.cpp   1.52
  M +1 -2      kstdoc.h   1.22


--- kdeextragear-2/kst/kst/kstdoc.cpp  #1.51:1.52
@@ -66,4 +66,5 @@ static bool backupFile(const QString& qF
 KstDoc::KstDoc(QWidget *parent, const char *name)
 : QObject(parent, name) {
+  _lock = 0;
     stopping = false;
     UpdateCounter = 0;
@@ -350,4 +351,13 @@ void KstDoc::deleteContents()
 }
 
+
+class FakeLocker {
+  public:
+    FakeLocker(int *x) : _x(x) { *_x = 1; }
+    ~FakeLocker() { *_x = 0; }
+  private:
+    int *_x;
+};
+
 /*****************
     Return values:
@@ -376,10 +386,10 @@ KstObject::UpdateType KstDoc::update(boo
 
   // Prevent reentrancy due to event processing!!
-  if (_lock.locked()) {
+  if (_lock != 0) {
     kdDebug() << "LOCKED" << endl;
     return U;
   }
 
-  QMutexLocker ml(&_lock);
+  FakeLocker ml(&_lock);
 
   UpdateCounter++;

--- kdeextragear-2/kst/kst/kstdoc.h  #1.21:1.22
@@ -24,5 +24,4 @@
 
 // include files for QT
-#include <qmutex.h>
 #include <qobject.h>
 #include <qstring.h>
@@ -110,5 +109,5 @@ private:
   QString title;
   QString absFilePath;
-  QMutex _lock;
+  int _lock;
 
 signals:





More information about the Kst mailing list