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

Andi Fischer andi.fischer at hispeed.ch
Wed Feb 4 21:47:05 UTC 2009


SVN commit 921357 by fischer:

Fixing some Krazy issues.

 M  +31 -22    artifact.cpp  
 M  +3 -10     artifact.h  
 M  +22 -9     classifier.cpp  
 M  +2 -26     classifier.h  
 M  +1 -1      docgenerators/xhtmlgenerator.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/artifact.cpp #921356:921357
@@ -1,46 +1,45 @@
 /***************************************************************************
- *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2003-2006                                               *
+ *   copyright (C) 2003-2009                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
 #include "artifact.h"
 #include "association.h"
 #include "clipboard/idchangelog.h"
+
 #include <kdebug.h>
 #include <klocale.h>
 
 /**
  * Sets up an Artifact.
- *
- * @param Name              The name of the Concept.
- * @param id                The unique id of the Concept.
+ * @param name   The name of the Concept.
+ * @param id     The unique id of the Concept.
  */
 UMLArtifact::UMLArtifact(const QString & name, Uml::IDType id)
-        : UMLCanvasObject(name, id) {
-    init();
+  : UMLCanvasObject(name, id),
+    m_drawAsType(defaultDraw)
+{
+    m_BaseType = Uml::ot_Artifact;
 }
 
-UMLArtifact::~UMLArtifact() {
-}
-
 /**
- * Initializes key variables of the class.
+ * Standard deconstructor.
  */
-void UMLArtifact::init() {
-    m_BaseType = Uml::ot_Artifact;
-    m_drawAsType = defaultDraw;
+UMLArtifact::~UMLArtifact()
+{
 }
 
 /**
  * Make a clone of this object.
+ * @return the cloned object
  */
-UMLObject* UMLArtifact::clone() const {
+UMLObject* UMLArtifact::clone() const
+{
     UMLArtifact *clone = new UMLArtifact();
     UMLObject::copyInto(clone);
     return clone;
@@ -49,8 +48,11 @@
 /**
  * Creates the UML:Artifact element including its operations,
  * attributes and templates
+ * @param qDoc       the xml document
+ * @param qElement   the xml element
  */
-void UMLArtifact::saveToXMI(QDomDocument& qDoc, QDomElement& qElement) {
+void UMLArtifact::saveToXMI(QDomDocument& qDoc, QDomElement& qElement) 
+{
     QDomElement artifactElement = UMLObject::save("UML:Artifact", qDoc);
     artifactElement.setAttribute("drawas", m_drawAsType);
     qElement.appendChild(artifactElement);
@@ -58,25 +60,32 @@
 
 /**
  * Loads the UML:Artifact element including its operations,
- * attributes and templates
+ * attributes and templates.
+ * @param element   the xml element to load
+ * @return the success status of the operation
  */
-bool UMLArtifact::load(QDomElement& element) {
+bool UMLArtifact::load(QDomElement& element) 
+{
     QString drawAs = element.attribute("drawas", "0");
     m_drawAsType = (Draw_Type)drawAs.toInt();
     return true;
 }
 
 /**
- * sets m_drawAsType for which method to draw the artifact as
+ * Sets m_drawAsType for which method to draw the artifact as.
+ * @param type   the draw type
  */
-void UMLArtifact::setDrawAsType(Draw_Type type) {
+void UMLArtifact::setDrawAsType(Draw_Type type)
+{
     m_drawAsType = type;
 }
 
 /**
- * returns the value of m_drawAsType
+ * Returns the value of m_drawAsType.
+ * @return the value of the draw type attribute
  */
-UMLArtifact::Draw_Type UMLArtifact::getDrawAsType() {
+UMLArtifact::Draw_Type UMLArtifact::getDrawAsType()
+{
     return m_drawAsType;
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/artifact.h #921356:921357
@@ -1,11 +1,10 @@
 /***************************************************************************
- *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2003-2006                                               *
+ *   copyright (C) 2003-2009                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -14,7 +13,6 @@
 
 #include "umlcanvasobject.h"
 
-
 /**
  * This class contains the non-graphical information required for a UML
  * Artifact.
@@ -26,7 +24,8 @@
  * @see UMLCanvasObject
  * Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
  */
-class UMLArtifact : public UMLCanvasObject {
+class UMLArtifact : public UMLCanvasObject
+{
     Q_OBJECT
 public:
 
@@ -41,14 +40,8 @@
     };
 
     explicit UMLArtifact(const QString & name = QString(), Uml::IDType id = Uml::id_None);
-
-    /**
-     * Standard deconstructor.
-     */
     virtual ~UMLArtifact();
 
-    virtual void init();
-
     virtual UMLObject* clone() const;
 
     void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
--- trunk/KDE/kdesdk/umbrello/umbrello/classifier.cpp #921356:921357
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2008                                               *
+ *   copyright (C) 2002-2009                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 #include "classifier.h"
@@ -40,7 +40,6 @@
 
 using namespace Uml;
 
-
 /**
  * Sets up a Classifier.
  *
@@ -55,6 +54,9 @@
     m_isRef = false;
 }
 
+/**
+ * Standard deconstructor.
+ */
 UMLClassifier::~UMLClassifier()
 {
 }
@@ -617,6 +619,9 @@
     return parentConcepts;
 }
 
+/**
+ * Overloaded '==' operator.
+ */
 bool UMLClassifier::operator==(const UMLClassifier & rhs )
 {
   /*
@@ -630,7 +635,6 @@
     return UMLCanvasObject::operator==(rhs);
 }
 
-
 /**
  * Copy the internal presentation of this object into the new
  * object.
@@ -989,6 +993,14 @@
     return templt;
 }
 
+/**
+ * Adds an already created template.
+ * The template object must not belong to any other concept.
+ *
+ * @param newTemplate   Pointer to the UMLTemplate object to add.
+ * @param log           Pointer to the IDChangeLog.
+ * @return  True if the template was successfully added.
+ */
 bool UMLClassifier::addTemplate(UMLTemplate* newTemplate, IDChangeLog* log /* = 0*/)
 {
     QString name = newTemplate->getName();
@@ -1008,11 +1020,13 @@
 }
 
 /**
- * Adds an already created template.
- * The template object must not belong to any other concept.
- *
- * @param newTemplate   Pointer to the UMLTemplate object to add.
- * @param log           Pointer to the IDChangeLog.
+ * Adds an template to the class.
+ * The template object must not belong to any other class.
+ * TODO: If the param IDChangeLog from the method above is not being used,
+ * give position a default value of -1 and the method can replace the above one.
+ * @param templt     Pointer to the UMLTemplate to add.
+ * @param position   The position of the template in the list.
+ *                   A value of -1 will add the template at the end.
  * @return  True if the template was successfully added.
  */
 bool UMLClassifier::addTemplate(UMLTemplate* templt, int position)
@@ -1054,7 +1068,6 @@
     return m_List.count();
 }
 
-
 /**
  * Seeks the template parameter of the given name.
  */
--- trunk/KDE/kdesdk/umbrello/umbrello/classifier.h #921356:921357
@@ -1,11 +1,10 @@
 /***************************************************************************
- *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2008                                               *
+ *   copyright (C) 2002-2009                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 #ifndef CLASSIFIER_H
@@ -47,15 +46,8 @@
     enum ClassifierType { ALL = 0, CLASS, INTERFACE, DATATYPE };
 
     explicit UMLClassifier(const QString & name = QString(), Uml::IDType id = Uml::id_None);
-
-    /**
-     * Standard deconstructor.
-     */
     virtual ~UMLClassifier();
 
-    /**
-     * Overloaded '==' operator.
-     */
     bool operator==(const UMLClassifier & rhs );
 
     virtual void copyInto(UMLObject *lhs) const;
@@ -68,7 +60,6 @@
                                           const QString &init = QString());
 
     UMLAttribute* addAttribute(const QString &name, Uml::IDType id = Uml::id_None);
-
     UMLAttribute* addAttribute(const QString &name, UMLObject *type, Uml::Visibility scope);
 
     bool addAttribute(UMLAttribute* att, IDChangeLog* log = 0,
@@ -79,7 +70,6 @@
     int attributes() ;
 
     UMLAttributeList getAttributeList() const;
-
     UMLAttributeList getAttributeList(Uml::Visibility scope) const;
 
     UMLAttributeList getAttributeListStatic(Uml::Visibility scope) const;
@@ -89,7 +79,6 @@
                                    Model_Utils::NameAndType_List *params = NULL);
 
     bool addOperation(UMLOperation* op, int position = -1);
-
     bool addOperation(UMLOperation* op, IDChangeLog* log);
 
     UMLOperation * checkOperationSignature( const QString& name,
@@ -107,18 +96,6 @@
     UMLTemplate* addTemplate(const QString &name, Uml::IDType id = Uml::id_None);
 
     bool addTemplate(UMLTemplate* newTemplate, IDChangeLog* log = 0);
-
-    /**
-     * Adds an template to the class.
-     * The template object must not belong to any other class.
-     *
-     * @param templt     Pointer to the UMLTemplate to add.
-     * @param position   The position of the template in the list.
-     *                   A value of -1 will add the template at the end.
-     * @return  True if the template was successfully added.
-     */
-    //TODO: if the param IDChangeLog from the method above is not being used,
-    // give position a default value of -1 and the method can replace the above one
     bool addTemplate(UMLTemplate* templt, int position);
 
     int removeTemplate(UMLTemplate* umltemplate);
@@ -198,7 +175,6 @@
 signals:
 
     void operationAdded(UMLClassifierListItem *);
-
     void operationRemoved(UMLClassifierListItem *);
 
     void templateAdded(UMLClassifierListItem*);
@@ -230,4 +206,4 @@
 
 };
 
-#endif // CONCEPT_H
+#endif // CLASSIFIER_H
--- trunk/KDE/kdesdk/umbrello/umbrello/docgenerators/xhtmlgenerator.cpp #921356:921357
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2006      Gael de Chalendar (aka Kleag)                 *
+ *   copyright (C) 2006      Gael de Chalendar (aka Kleag) kleag at free.fr   *
  *   copyright (C) 2006-2009                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/




More information about the umbrello-devel mailing list