[Uml-devel] KDE_3_2_BRANCH: kdesdk/umbrello/umbrello
Jonathan Riddell
jri at jriddell.org
Sat Mar 27 13:57:01 UTC 2004
CVS commit by jriddell:
Backport part commit of Fri Mar 26 21:15:00 2004
--
CVS commit by okellogg:
2. Patch by Achim Spangler that corrects the handling of m_bLoading
in UMLDoc.
M +17 -5 umldoc.cpp 1.122.2.6
--- kdesdk/umbrello/umbrello/umldoc.cpp #1.122.2.5:1.122.2.6
@@ -268,9 +268,12 @@ bool UMLDoc::openDocument(const KURL& ur
}
- m_bLoading = true;
-
doc_url = url;
QDir d = url.path(1);
deleteContents();
+ // IMPORTANT: set m_bLoading to true
+ // _AFTER_ the call of UMLDoc::deleteContents()
+ // as it sets m_bLoading to false afer it was temporarely
+ // changed to true to block recording of changes in redo-buffer
+ m_bLoading = true;
QString tmpfile;
KIO::NetAccess::download( url, tmpfile
@@ -381,4 +384,6 @@ void UMLDoc::deleteContents() {
if (listView) {
listView->init();
+ // store old setting - for restore of last setting
+ bool m_bLoading_old = m_bLoading;
m_bLoading = true; // This is to prevent document becoming modified.
// For reference, here is an example of a call sequence that would
@@ -390,4 +395,5 @@ void UMLDoc::deleteContents() {
// addToUndoStack().
removeAllViews();
+ m_bLoading = m_bLoading_old;
if(objectList.count() > 0) {
// clear our object list. We do this explicitly since setAutoDelete is false for the objectList now.
@@ -2195,9 +2201,11 @@ bool UMLDoc::activateView ( int viewID )
bool UMLDoc::activateAllViews() {
bool status = true;
+ // store old setting - for restore of last setting
+ bool m_bLoading_old = m_bLoading;
m_bLoading = true; //this is to prevent document becoming modified when activating a view
for(UMLView *v = m_ViewList.first(); v; v = m_ViewList.next() )
status = status && v->activateAfterLoad();
- m_bLoading = false;
+ m_bLoading = m_bLoading_old;
viewsNotActivated.clear();
return status;
@@ -2314,4 +2322,6 @@ void UMLDoc::loadUndoData() {
if (undoStack.count() > 1) {
int currentViewID = currentView->getID();
+ // store old setting - for restore of last setting
+ bool m_bLoading_old = m_bLoading;
m_bLoading = true;
deleteContents();
@@ -2326,5 +2336,5 @@ void UMLDoc::loadUndoData() {
setModified(true, false);
getCurrentView()->resizeCanvasToItems();
- m_bLoading = false;
+ m_bLoading = m_bLoading_old;
undoStack.setAutoDelete(true);
@@ -2350,4 +2360,6 @@ void UMLDoc::loadRedoData() {
if (redoStack.count() >= 1) {
int currentViewID = currentView->getID();
+ // store old setting - for restore of last setting
+ bool m_bLoading_old = m_bLoading;
m_bLoading = true;
deleteContents();
@@ -2362,5 +2374,5 @@ void UMLDoc::loadRedoData() {
setModified(true, false);
getCurrentView()->resizeCanvasToItems();
- m_bLoading = false;
+ m_bLoading = m_bLoading_old;
redoStack.setAutoDelete(true);
More information about the umbrello-devel
mailing list