[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Thu Sep 15 05:58:06 CEST 2005
SVN commit 460755 by staikos:
- push variables back into the right scope
- use preincrements
- lock the lists before we copy them. We might have to do this elsewhere too. I
don't think we need a deepcopy here.
M +9 -7 kstdoc.cpp
--- trunk/extragear/graphics/kst/kst/kstdoc.cpp #460754:460755
@@ -837,18 +837,20 @@
bool modified = false;
bool again = true;
KstApp *app = KstApp::inst();
- int cnt;
- int prg = 0;
while (again) {
+ KST::vectorList.lock().readLock();
KstVectorList vectorList = KST::vectorList;
+ KST::vectorList.lock().readUnlock();
+ KST::matrixList.lock().readLock();
KstMatrixList matrixList = KST::matrixList;
+ KST::matrixList.lock().readUnlock();
KST::dataObjectList.lock().writeLock();
- cnt = matrixList.count() + vectorList.count() + KST::dataObjectList.count();
+ int cnt = matrixList.count() + vectorList.count() + KST::dataObjectList.count();
KST::dataObjectList.lock().writeUnlock();
- prg = 0;
+ int prg = 0;
app->slotUpdateProgress(cnt, prg, purging);
again = false;
@@ -864,7 +866,7 @@
again = true;
modified = true;
}
- prg++;
+ ++prg;
app->slotUpdateProgress(cnt, prg, purging);
}
KST::dataObjectList.lock().writeUnlock();
@@ -881,7 +883,7 @@
again = true;
modified = true;
}
- prg++;
+ ++prg;
app->slotUpdateProgress(cnt, prg, purging);
}
@@ -895,7 +897,7 @@
again = true;
modified = true;
}
- prg++;
+ ++prg;
app->slotUpdateProgress(cnt, prg, purging);
}
}
More information about the Kst
mailing list