[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Fri Apr 13 20:35:27 UTC 2007


SVN commit 653625 by okellogg:

UMLObject::emitModified() does the check against umldoc->loading()

 M  +2 -4      attribute.cpp  
 M  +10 -40    classifier.cpp  
 M  +8 -8      classifierlistitem.cpp  
 M  +6 -18     entity.cpp  
 M  +5 -17     enum.cpp  
 M  +2 -4      operation.cpp  
 M  +12 -9     umlcanvasobject.cpp  
 M  +11 -11    umlrole.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/attribute.cpp #653624:653625
@@ -5,7 +5,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2006                                               *
+ *   copyright (C) 2002-2007                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -59,9 +59,7 @@
 void UMLAttribute::setInitialValue(const QString &iv) {
     if(m_InitialValue != iv) {
         m_InitialValue = iv;
-        UMLDoc *umldoc = UMLApp::app()->getDocument();
-        if (! umldoc->loading())
-            emit modified();
+        UMLObject::emitModified();
     }
 }
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/classifier.cpp #653624:653625
@@ -244,10 +244,7 @@
         kDebug() << "  UMLClassifier::addOperation list after change: " << buf << endl;
      } else
         m_List.append( op );
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading()) {
-        emit modified();
-    }
+    UMLObject::emitModified();
     emit operationAdded(op);
     connect(op,SIGNAL(modified()),this,SIGNAL(modified()));
     return true;
@@ -276,10 +273,7 @@
     // disconnection needed.
     // note that we don't delete the operation, just remove it from the Classifier
     disconnect(op,SIGNAL(modified()),this,SIGNAL(modified()));
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading()) {
-        emit modified();
-    }
+    UMLObject::emitModified();
     emit operationRemoved(op);
     return m_List.count();
 }
@@ -554,10 +548,7 @@
     Uml::Visibility scope = Settings::getOptionState().classState.defaultAttributeScope;
     UMLAttribute *a = new UMLAttribute(this, name, id, scope);
     m_List.append(a);
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading()) {
-        emit modified();
-    }
+    UMLObject::emitModified();
     emit attributeAdded(a);
     connect(a,SIGNAL(modified()),this,SIGNAL(modified()));
     return a;
@@ -571,10 +562,7 @@
     if (type)
         a->setType(type);
     m_List.append(a);
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading()) {
-        emit modified();
-    }
+    UMLObject::emitModified();
     emit attributeAdded(a);
     connect(a,SIGNAL(modified()),this,SIGNAL(modified()));
     return a;
@@ -589,10 +577,7 @@
             m_List.insert(position, att);
         else
             m_List.append(att);
-        UMLDoc *umldoc = UMLApp::app()->getDocument();
-        if (! umldoc->loading()) {
-            emit modified();
-        }
+        UMLObject::emitModified();
         emit attributeAdded(att);
         connect(att, SIGNAL(modified()), this, SIGNAL(modified()));
         return true;
@@ -608,10 +593,7 @@
         kDebug() << "can't find att given in list" << endl;
         return -1;
     }
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading()) {
-        emit modified();
-    }
+    UMLObject::emitModified();
     emit attributeRemoved(a);
     // If we are deleting the object, then we don't need to disconnect..this is done auto-magically
     // for us by QObject. -b.t.
@@ -693,10 +675,7 @@
         return t;
     t = new UMLTemplate(this, name, id);
     m_List.append(t);
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading()) {
-        emit modified();
-    }
+    UMLObject::emitModified();
     emit templateAdded(t);
     connect(t, SIGNAL(modified()), this, SIGNAL(modified()));
     return t;
@@ -708,10 +687,7 @@
         newTemplate->parent()->removeChild(newTemplate);
         this->insertChild(newTemplate);
         m_List.append(newTemplate);
-        UMLDoc *umldoc = UMLApp::app()->getDocument();
-        if (! umldoc->loading()) {
-            emit modified();
-        }
+        UMLObject::emitModified();
         emit templateAdded(newTemplate);
         connect(newTemplate,SIGNAL(modified()),this,SIGNAL(modified()));
         return true;
@@ -732,10 +708,7 @@
             m_List.insert(position,Template);
         else
             m_List.append(Template);
-        UMLDoc *umldoc = UMLApp::app()->getDocument();
-        if (! umldoc->loading()) {
-            emit modified();
-        }
+        UMLObject::emitModified();
         emit templateAdded(Template);
         connect(Template,SIGNAL(modified()),this,SIGNAL(modified()));
         return true;
@@ -749,10 +722,7 @@
         kWarning() << "can't find att given in list" << endl;
         return -1;
     }
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading()) {
-        emit modified();
-    }
+    UMLObject::emitModified();
     emit templateRemoved(umltemplate);
     disconnect(umltemplate,SIGNAL(modified()),this,SIGNAL(modified()));
     return m_List.count();
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/classifierlistitem.cpp #653624:653625
@@ -5,14 +5,18 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2003-2006                                               *
+ *   copyright (C) 2003-2007                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
+// own header
+#include "classifierlistitem.h"
+
+// qt/kde includes
 #include <kdebug.h>
 #include <klocale.h>
 
-#include "classifierlistitem.h"
+// local includes
 #include "classifier.h"
 #include "uml.h"
 #include "umldoc.h"
@@ -65,9 +69,7 @@
 void UMLClassifierListItem::setType(UMLObject *type) {
     if (m_pSecondary != type) {
         m_pSecondary = type;
-        UMLDoc *umldoc = UMLApp::app()->getDocument();
-        if (! umldoc->loading())
-            emit modified();
+        UMLObject::emitModified();
     }
 }
 
@@ -89,9 +91,7 @@
             m_SecondaryId = type;
         }
     }
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading())
-        emit modified();
+    UMLObject::emitModified();
 }
 
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/entity.cpp #653624:653625
@@ -5,7 +5,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2003-2006                                               *
+ *   copyright (C) 2003-2007                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -97,10 +97,7 @@
 UMLObject* UMLEntity::addEntityAttribute(const QString& name, Uml::IDType id) {
     UMLEntityAttribute* literal = new UMLEntityAttribute(this, name, id);
     m_List.append(literal);
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading()) {
-        emit modified();
-    }
+    UMLObject::emitModified();
     emit entityAttributeAdded(literal);
     connect(literal,SIGNAL(modified()),this,SIGNAL(modified()));
     return literal;
@@ -112,10 +109,7 @@
         attribute->parent()->removeChild(attribute);
         this->insertChild(attribute);
         m_List.append(attribute);
-        UMLDoc *umldoc = UMLApp::app()->getDocument();
-        if (! umldoc->loading()) {
-            emit modified();
-        }
+        UMLObject::emitModified();
         emit entityAttributeAdded(attribute);
         connect(attribute,SIGNAL(modified()),this,SIGNAL(modified()));
         return true;
@@ -136,10 +130,7 @@
         } else {
             m_List.append(attribute);
         }
-        UMLDoc *umldoc = UMLApp::app()->getDocument();
-        if (! umldoc->loading()) {
-            emit modified();
-        }
+        UMLObject::emitModified();
         emit entityAttributeAdded(attribute);
         connect(attribute,SIGNAL(modified()),this,SIGNAL(modified()));
         return true;
@@ -152,11 +143,8 @@
         kDebug() << "can't find att given in list" << endl;
         return -1;
     }
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading()) {
-        emit entityAttributeRemoved(literal);
-    }
-    emit modified();
+    UMLObject::emitModified();
+    emit entityAttributeRemoved(literal);
     // If we are deleting the object, then we don't need to disconnect..this is done auto-magically
     // for us by QObject. -b.t.
     // disconnect(a,SIGNAL(modified()),this,SIGNAL(modified()));
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/enum.cpp #653624:653625
@@ -5,7 +5,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2003-2006                                               *
+ *   copyright (C) 2003-2007                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -89,10 +89,7 @@
     }
     UMLEnumLiteral* literal = new UMLEnumLiteral(this, name, id);
     m_List.append(literal);
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading()) {
-        emit modified();
-    }
+    UMLObject::emitModified();
     emit enumLiteralAdded(literal);
     connect(literal,SIGNAL(modified()),this,SIGNAL(modified()));
     return literal;
@@ -104,10 +101,7 @@
         literal->parent()->removeChild(literal);
         this->insertChild(literal);
         m_List.append(literal);
-        UMLDoc *umldoc = UMLApp::app()->getDocument();
-        if (! umldoc->loading()) {
-            emit modified();
-        }
+        UMLObject::emitModified();
         emit enumLiteralAdded(literal);
         connect(literal,SIGNAL(modified()),this,SIGNAL(modified()));
         return true;
@@ -128,10 +122,7 @@
         } else {
             m_List.append(literal);
         }
-        UMLDoc *umldoc = UMLApp::app()->getDocument();
-        if (! umldoc->loading()) {
-            emit modified();
-        }
+        UMLObject::emitModified();
         emit enumLiteralAdded(literal);
         connect(literal,SIGNAL(modified()),this,SIGNAL(modified()));
         return true;
@@ -144,10 +135,7 @@
         kDebug() << "can't find att given in list" << endl;
         return -1;
     }
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading()) {
-        emit modified();
-    }
+    UMLObject::emitModified();
     emit enumLiteralRemoved(literal);
     // If we are deleting the object, then we don't need to disconnect..this is done auto-magically
     // for us by QObject. -b.t.
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/operation.cpp #653624:653625
@@ -5,7 +5,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2006                                               *
+ *   copyright (C) 2002-2007                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -180,9 +180,7 @@
         m_List.insert(position,parameter);
     else
         m_List.append( parameter );
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading())
-        emit modified();
+    UMLObject::emitModified();
     connect(parameter,SIGNAL(modified()),this,SIGNAL(modified()));
 }
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlcanvasobject.cpp #653624:653625
@@ -5,12 +5,20 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2003-2006                                               *
+ *   copyright (C) 2003-2007                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
+
+// own header
+#include "umlcanvasobject.h"
+
+// qt/kde includes
+#include <kdebug.h>
+#include <klocale.h>
+
+// local includes
 #include "uml.h"
 #include "umldoc.h"
-#include "umlcanvasobject.h"
 #include "classifier.h"
 #include "association.h"
 #include "attribute.h"
@@ -18,8 +26,6 @@
 #include "template.h"
 #include "stereotype.h"
 #include "clipboard/idchangelog.h"
-#include <kdebug.h>
-#include <klocale.h>
 
 UMLCanvasObject::UMLCanvasObject(const QString & name, Uml::IDType id)
         : UMLObject(name, id)
@@ -66,10 +72,7 @@
         m_List.append( assoc );
 
         // Don't emit signals during load from XMI
-        UMLDoc *umldoc = UMLApp::app()->getDocument();
-        if (! umldoc->loading()) {
-            emit modified();
-        }
+        UMLObject::emitModified();
         emit sigAssociationEndAdded(assoc);
         return true;
     }
@@ -88,7 +91,7 @@
             << "can't find given assoc in list" << endl;
         return -1;
     }
-    emit modified();
+    UMLObject::emitModified();
     emit sigAssociationEndRemoved(assoc);
     return m_List.count();
 }
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlrole.cpp #653624:653625
@@ -5,17 +5,23 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2003-2006                                               *
+ *   copyright (C) 2003-2007                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
+// own header
+#include "umlrole.h"
+
+// qt/kde includes
 #include <kdebug.h>
 #include <qregexp.h>
-#include "umlrole.h"
+
+// local includes
 #include "association.h"
 #include "umldoc.h"
 #include "uml.h"
 
+
 // constructor
 UMLRole::UMLRole(UMLAssociation * parent, UMLObject * parentObj, Uml::Role_Type role)
         : UMLObject(const_cast<UMLAssociation*>(parent))
@@ -65,23 +71,17 @@
     }
 
     m_pSecondary = obj;
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading())
-        emit modified();
+    UMLObject::emitModified();
 }
 
 void UMLRole::setChangeability (Uml::Changeability_Type value) {
     m_Changeability = value;
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading())
-        emit modified();
+    UMLObject::emitModified();
 }
 
 void UMLRole::setMultiplicity ( const QString &multi ) {
     m_Multi = multi;
-    UMLDoc *umldoc = UMLApp::app()->getDocument();
-    if (! umldoc->loading())
-        emit modified();
+    UMLObject::emitModified();
 }
 
 Uml::Role_Type UMLRole::getRole() {




More information about the umbrello-devel mailing list