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

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Mon Oct 15 04:33:39 UTC 2007


SVN commit 725259 by chehrlic:

add 'const' for operator==() and operator=()

 M  +8 -8      associationwidget.cpp  
 M  +3 -3      associationwidget.h  
 M  +3 -3      attribute.cpp  
 M  +1 -1      attribute.h  
 M  +1 -1      classifier.cpp  
 M  +1 -1      classifier.h  
 M  +1 -1      entity.cpp  
 M  +1 -1      entity.h  
 M  +2 -3      entityattribute.cpp  
 M  +1 -1      entityattribute.h  
 M  +1 -1      enum.cpp  
 M  +1 -1      enum.h  
 M  +1 -1      enumliteral.cpp  
 M  +1 -1      enumliteral.h  
 M  +1 -1      operation.cpp  
 M  +1 -1      operation.h  
 M  +1 -1      stereotype.cpp  
 M  +1 -1      stereotype.h  
 M  +1 -1      template.cpp  
 M  +1 -1      template.h  
 M  +1 -1      umlcanvasobject.cpp  
 M  +1 -1      umlcanvasobject.h  
 M  +1 -1      umlrole.cpp  
 M  +1 -1      umlrole.h  
 M  +1 -1      uniqueconstraint.cpp  
 M  +1 -1      uniqueconstraint.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp #725258:725259
@@ -128,7 +128,7 @@
 AssociationWidget::~AssociationWidget() {
 }
 
-AssociationWidget& AssociationWidget::operator=(AssociationWidget & Other) {
+AssociationWidget& AssociationWidget::operator=(const AssociationWidget & Other) {
     m_LinePath = Other.m_LinePath;
 
     m_pView = Other.m_pView;
@@ -182,7 +182,7 @@
     return *this;
 }
 
-bool AssociationWidget::operator==(AssociationWidget & Other) {
+bool AssociationWidget::operator==(const AssociationWidget & Other) {
     if( this == &Other )
         return true;
 
@@ -252,7 +252,7 @@
 QString AssociationWidget::getMulti(Uml::Role_Type role) const
 {
     if (m_role[role].m_pMulti == NULL)
-        return "";
+        return QString();
     return m_role[role].m_pMulti->getText();
 }
 
@@ -263,7 +263,7 @@
 
 QString AssociationWidget::getName() const {
     if (m_pName == NULL)
-        return "";
+        return QString();
     return m_pName->getText();
 }
 
@@ -300,13 +300,13 @@
 
 QString AssociationWidget::getRoleName(Uml::Role_Type role) const {
     if (m_role[role].m_pRole == NULL)
-        return "";
+        return QString();
     return m_role[role].m_pRole->getText();
 }
 
 QString AssociationWidget::getRoleDoc(Uml::Role_Type role) const {
     if (m_pObject == NULL || m_pObject->getBaseType() != ot_Association)
-        return "";
+        return QString();
     UMLAssociation *umla = static_cast<UMLAssociation*>(m_pObject);
     return umla->getRoleDoc(role);
 }
@@ -678,7 +678,7 @@
     return result;
 }
 
-UMLWidget* AssociationWidget::getWidget(Uml::Role_Type role) {
+UMLWidget* AssociationWidget::getWidget(Uml::Role_Type role) const {
     return m_role[role].m_pWidget;
 }
 
@@ -893,7 +893,7 @@
 
 /** Returns a QString Object representing this AssociationWidget */
 QString AssociationWidget::toString() {
-    QString string = "";
+    QString string;
 
     if(m_role[A].m_pWidget) {
         string = m_role[A].m_pWidget -> getName();
--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.h #725258:725259
@@ -94,12 +94,12 @@
     /**
      * Overrides the assignment operator.
      */
-    AssociationWidget& operator=(AssociationWidget & Other);
+    AssociationWidget& operator=(const AssociationWidget & Other);
 
     /**
      * Overrides the equality test operator.
      */
-    bool operator==(AssociationWidget & Other);
+    bool operator==(const AssociationWidget & Other);
 
     /**
      * Overrides the != operator.
@@ -217,7 +217,7 @@
      *
      * @return  Pointer to the role's UMLWidget.
      */
-    UMLWidget* getWidget(Uml::Role_Type role);
+    UMLWidget* getWidget(Uml::Role_Type role) const;
 
     /**
      * Sets the associated widgets.
--- trunk/KDE/kdesdk/umbrello/umbrello/attribute.cpp #725258:725259
@@ -97,7 +97,7 @@
         if (ownParent == NULL) {
             uError() << "parent " << owningObject->getName()
                 << " is not a UMLClassifier" << endl;
-            return "";
+            return QString();
         }
         QString typeName;
         UMLClassifier *type = UMLClassifierListItem::getType();
@@ -136,7 +136,7 @@
     if (ownParent == NULL) {
         uError() << m_Name << ": parent " << owningObject->getName()
             << " is not a UMLClassifier" << endl;
-        return "";
+        return QString();
     }
     QString tempSeparator = separator;
     if (tempSeparator.isEmpty())
@@ -148,7 +148,7 @@
     return fqn;
 }
 
-bool UMLAttribute::operator==( UMLAttribute &rhs) {
+bool UMLAttribute::operator==(const UMLAttribute &rhs) {
     if( this == &rhs )
         return true;
 
--- trunk/KDE/kdesdk/umbrello/umbrello/attribute.h #725258:725259
@@ -53,7 +53,7 @@
     /**
      * Overloaded '==' operator
      */
-    bool operator==( UMLAttribute &rhs);
+    bool operator==(const UMLAttribute &rhs);
 
     /**
      * destructor.
--- trunk/KDE/kdesdk/umbrello/umbrello/classifier.cpp #725258:725259
@@ -402,7 +402,7 @@
     return parentConcepts;
 }
 
-bool UMLClassifier::operator==( UMLClassifier & rhs ) {
+bool UMLClassifier::operator==(const UMLClassifier & rhs ) {
   /*
     if ( m_List.count() != rhs.m_List.count() ) {
         return false;
--- trunk/KDE/kdesdk/umbrello/umbrello/classifier.h #725258:725259
@@ -61,7 +61,7 @@
     /**
      * Overloaded '==' operator.
      */
-    bool operator==( UMLClassifier & rhs );
+    bool operator==(const UMLClassifier & rhs );
 
     /**
      * Copy the internal presentation of this object into the new
--- trunk/KDE/kdesdk/umbrello/umbrello/entity.cpp #725258:725259
@@ -39,7 +39,7 @@
     m_List.clear();
 }
 
-bool UMLEntity::operator==( UMLEntity& rhs ) {
+bool UMLEntity::operator==(const UMLEntity& rhs ) {
     return UMLClassifier::operator==(rhs);
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/entity.h #725258:725259
@@ -54,7 +54,7 @@
     /**
      * Overloaded '==' operator.
      */
-    bool operator==(UMLEntity& rhs);
+    bool operator==(const UMLEntity& rhs);
 
     /**
      * Copy the internal presentation of this object into the new
--- trunk/KDE/kdesdk/umbrello/umbrello/entityattribute.cpp #725258:725259
@@ -90,8 +90,7 @@
 
     if(sig == Uml::st_ShowSig || sig == Uml::st_NoSig) {
         s=m_Vis.toString(true) + ' ';
-    } else
-        s = "";
+    }
 
     if(sig == Uml::st_ShowSig || sig == Uml::st_SigNoVis) {
         QString string = s + getName() + " : " + getTypeName();
@@ -102,7 +101,7 @@
         return s + getName();
 }
 
-bool UMLEntityAttribute::operator==( UMLEntityAttribute &rhs) {
+bool UMLEntityAttribute::operator==(const UMLEntityAttribute &rhs) {
     if( this == &rhs )
         return true;
 
--- trunk/KDE/kdesdk/umbrello/umbrello/entityattribute.h #725258:725259
@@ -51,7 +51,7 @@
     /**
      * Overloaded '==' operator
      */
-    bool operator==( UMLEntityAttribute& rhs);
+    bool operator==(const UMLEntityAttribute& rhs);
 
     /**
      * destructor.
--- trunk/KDE/kdesdk/umbrello/umbrello/enum.cpp #725258:725259
@@ -30,7 +30,7 @@
     m_List.clear();
 }
 
-bool UMLEnum::operator==( UMLEnum & rhs ) {
+bool UMLEnum::operator==(const UMLEnum & rhs ) {
     return UMLClassifier::operator==(rhs);
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/enum.h #725258:725259
@@ -45,7 +45,7 @@
     /**
      * Overloaded '==' operator.
      */
-    bool operator==(UMLEnum& rhs);
+    bool operator==(const UMLEnum& rhs);
 
     /**
      * Copy the internal presentation of this object into the new
--- trunk/KDE/kdesdk/umbrello/umbrello/enumliteral.cpp #725258:725259
@@ -27,7 +27,7 @@
 
 UMLEnumLiteral::~UMLEnumLiteral() { }
 
-bool UMLEnumLiteral::operator==(UMLEnumLiteral& rhs) {
+bool UMLEnumLiteral::operator==(const UMLEnumLiteral& rhs) {
     if ( this == &rhs )  {
         return true;
     }
--- trunk/KDE/kdesdk/umbrello/umbrello/enumliteral.h #725258:725259
@@ -46,7 +46,7 @@
     /**
      * Overloaded '==' operator
      */
-    bool operator==(UMLEnumLiteral &rhs);
+    bool operator==(const UMLEnumLiteral &rhs);
 
     /**
      * Copy the internal presentation of this object into the new
--- trunk/KDE/kdesdk/umbrello/umbrello/operation.cpp #725258:725259
@@ -184,7 +184,7 @@
     return name;
 }
 
-bool UMLOperation::operator==( UMLOperation & rhs ) {
+bool UMLOperation::operator==(const  UMLOperation & rhs ) {
     if( this == &rhs )
         return true;
 
--- trunk/KDE/kdesdk/umbrello/umbrello/operation.h #725258:725259
@@ -61,7 +61,7 @@
     /**
      * Overloaded '==' operator.
      */
-    bool operator==( UMLOperation & rhs );
+    bool operator==( const UMLOperation & rhs );
 
     /**
      * Copy the internal presentation of this object into the new
--- trunk/KDE/kdesdk/umbrello/umbrello/stereotype.cpp #725258:725259
@@ -39,7 +39,7 @@
 
 UMLStereotype::~UMLStereotype() {}
 
-bool UMLStereotype::operator==( UMLStereotype &rhs) {
+bool UMLStereotype::operator==( const UMLStereotype &rhs) {
     if (this == &rhs) {
         return true;
     }
--- trunk/KDE/kdesdk/umbrello/umbrello/stereotype.h #725258:725259
@@ -43,7 +43,7 @@
     /**
      * Overloaded '==' operator
      */
-    bool operator==(UMLStereotype &rhs);
+    bool operator==(const UMLStereotype &rhs);
 
     /**
      * destructor
--- trunk/KDE/kdesdk/umbrello/umbrello/template.cpp #725258:725259
@@ -48,7 +48,7 @@
     return m_pSecondary->getName();
 }
 
-bool UMLTemplate::operator==(UMLTemplate &rhs) {
+bool UMLTemplate::operator==(const UMLTemplate &rhs) {
     if (this == &rhs) {
         return true;
     }
--- trunk/KDE/kdesdk/umbrello/umbrello/template.h #725258:725259
@@ -48,7 +48,7 @@
     /**
      * Overloaded '==' operator
      */
-    bool operator==(UMLTemplate &rhs);
+    bool operator==(const UMLTemplate &rhs);
 
     /**
      * Copy the internal presentation of this object into the new
--- trunk/KDE/kdesdk/umbrello/umbrello/umlcanvasobject.cpp #725258:725259
@@ -210,7 +210,7 @@
 
 }
 
-bool UMLCanvasObject::operator==(UMLCanvasObject& rhs) {
+bool UMLCanvasObject::operator==(const UMLCanvasObject& rhs) {
     if (this == &rhs) {
         return true;
     }
--- trunk/KDE/kdesdk/umbrello/umbrello/umlcanvasobject.h #725258:725259
@@ -52,7 +52,7 @@
     /**
      *  Overloaded '==' operator
      */
-    virtual bool operator==(UMLCanvasObject& rhs);
+    virtual bool operator==(const UMLCanvasObject& rhs);
 
     /**
      * Copy the internal presentation of this object into the new
--- trunk/KDE/kdesdk/umbrello/umbrello/umlrole.cpp #725258:725259
@@ -31,7 +31,7 @@
 
 UMLRole::~UMLRole() { }
 
-bool UMLRole::operator==(UMLRole &rhs) {
+bool UMLRole::operator==(const UMLRole &rhs) {
     if (this == &rhs) {
         return true;
     }
--- trunk/KDE/kdesdk/umbrello/umbrello/umlrole.h #725258:725259
@@ -38,7 +38,7 @@
     /**
      * Overloaded '==' operator
      */
-    bool operator==(UMLRole & rhs);
+    bool operator==(const UMLRole & rhs);
 
     /**
      * Standard deconstructor.
--- trunk/KDE/kdesdk/umbrello/umbrello/uniqueconstraint.cpp #725258:725259
@@ -34,7 +34,7 @@
     init();
 }
 
-bool UMLUniqueConstraint::operator==( UMLUniqueConstraint &rhs) {
+bool UMLUniqueConstraint::operator==(const  UMLUniqueConstraint &rhs) {
     if( this == &rhs )
         return true;
 
--- trunk/KDE/kdesdk/umbrello/umbrello/uniqueconstraint.h #725258:725259
@@ -47,7 +47,7 @@
     /**
      * Overloaded '==' operator
      */
-    bool operator==( UMLUniqueConstraint &rhs);
+    bool operator==(const UMLUniqueConstraint &rhs);
 
     /**
      * destructor.




More information about the umbrello-devel mailing list