[Kst] branches/work/kst/kst1kde4/kst/src/libkst
Andrew Walker
arwalker at sumusltd.com
Thu Apr 29 01:56:44 CEST 2010
SVN commit 1120368 by arwalker:
continue kst1kde4
M +16 -5 kstobject.h
--- branches/work/kst/kst1kde4/kst/src/libkst/kstobject.h #1120367:1120368
@@ -313,21 +313,32 @@
mutable KstRWLock _lock;
};
-/* Does locking for you automatically. */
template<class T, class S>
KstObjectList<QExplicitlySharedDataPointer<S> > kstObjectSubList(KstObjectList<QExplicitlySharedDataPointer<T> >& list) {
- list.lock().readLock();
KstObjectList<QExplicitlySharedDataPointer<S> > rc;
- typename KstObjectList<QExplicitlySharedDataPointer<T> >::Iterator it;
+ typename KstObjectList<QExplicitlySharedDataPointer<T> >::iterator it;
+ //
+ // does locking for you automatically...
+ //
+
+ list.lock().readLock();
+
for (it = list.begin(); it != list.end(); ++it) {
- S *x = dynamic_cast<S*>((*it).data());
+ S *x;
+
+ x = dynamic_cast<S*>((*it).data());
if (x != 0L) {
- rc.append(x);
+ QExplicitlySharedDataPointer<S> xPtr;
+
+ xPtr = x;
+
+ rc.append(xPtr);
}
}
list.lock().unlock();
+
return rc;
}
More information about the Kst
mailing list