[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Mon Apr 5 04:26:40 CEST 2004


CVS commit by staikos: 

Add in explicit deep copy support.  Been testing this one for a week now and
it seems to be better and not much slower.  We need to make deep copies of the
object lists we iterate if they are shared across threads.


  M +2 -1      kstdoc.cpp   1.64
  M +1 -0      kstobject.h   1.22


--- kdeextragear-2/kst/kst/kstdoc.cpp  #1.63:1.64
@@ -27,4 +27,5 @@
 
 // include files for Qt
+#include <qdeepcopy.h>
 #include <qdir.h>
 #include <qfileinfo.h>
@@ -260,5 +261,5 @@ bool KstDoc::openDocument(const KURL &ur
   {
     KST::dataObjectList.lock().readLock();
-    KstDataObjectList dol = KST::dataObjectList;
+    KstDataObjectList dol = QDeepCopy<KstDataObjectList>(KST::dataObjectList);
     KST::dataObjectList.lock().readUnlock();
     for (KstDataObjectList::Iterator i = dol.begin(); i != dol.end(); ++i) {

--- kdeextragear-2/kst/kst/kstobject.h  #1.21:1.22
@@ -72,4 +72,5 @@ typedef KstSharedPtr<KstObject> KstObjec
 template<class T>
 class KstObjectList : public QValueList<T> {
+  friend class QDeepCopy<KstObjectList<T> >;
   public:
     KstObjectList() : QValueList<T>() {}





More information about the Kst mailing list