[Uml-devel] KDE/kdesdk/umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Thu Dec 13 08:55:55 UTC 2007
SVN commit 747973 by fischer:
Some code and documentation format changes.
M +22 -52 codeoperation.cpp
M +15 -12 codeoperation.h
--- trunk/KDE/kdesdk/umbrello/umbrello/codeoperation.cpp #747972:747973
@@ -21,37 +21,28 @@
#include <kdebug.h>
// local includes
-#include "codedocument.h"
-#include "codegenerator.h"
#include "classifiercodedocument.h"
#include "uml.h"
#include "umldoc.h"
#include "umlobject.h"
-// Constructors/Destructors
-//
-
CodeOperation::CodeOperation ( ClassifierCodeDocument * doc , UMLOperation * parentOp, const QString & body, const QString & comment)
: CodeMethodBlock ( doc, parentOp, body, comment)
{
init(parentOp);
}
-CodeOperation::~CodeOperation ( ) { }
+CodeOperation::~CodeOperation ( )
+{
+}
-//
-// Methods
-//
-
-// Accessor methods
-//
-
/**
* Add a Parameter object to the m_parameterVector List
*/
/*
-void CodeOperation::addParameter ( CodeParameter * add_object ) {
+void CodeOperation::addParameter ( CodeParameter * add_object )
+{
m_parameterVector.append(add_object);
}
*/
@@ -60,71 +51,54 @@
* Remove a Parameter object from m_parameterVector List
*/
/*
-void CodeOperation::removeParameter ( CodeParameter * remove_object ) {
+void CodeOperation::removeParameter ( CodeParameter * remove_object )
+{
m_parameterVector.remove(remove_object);
}
*/
/**
* Get the list of Parameter objects held by m_parameterVector
- * @return QPtrList<CodeParameter *> list of Parameter objects held by
+ * @return QList<CodeParameter*> list of Parameter objects held by
* m_parameterVector
*/
/*
-QPtrList<CodeParameter> CodeOperation::getParameterList ( ) {
+QList<CodeParameter*> CodeOperation::getParameterList ( )
+{
return m_parameterVector;
}
*/
-/**
- * Get the parent UMLOperation of this codeoperation.
- */
-UMLOperation * CodeOperation::getParentOperation( ) {
+UMLOperation * CodeOperation::getParentOperation( )
+{
return dynamic_cast<UMLOperation*>(getParentObject());
}
-// Other methods
-//
-
-/** Save the XMI representation of this object
- */
-void CodeOperation::saveToXMI ( QDomDocument & doc, QDomElement & root ) {
+void CodeOperation::saveToXMI ( QDomDocument & doc, QDomElement & root )
+{
QDomElement blockElement = doc.createElement( "codeoperation" );
-
// set attributes
setAttributesOnNode(doc, blockElement);
-
root.appendChild( blockElement );
}
-/**
- * load params from the appropriate XMI element node.
- */
void CodeOperation::loadFromXMI ( QDomElement & root )
{
setAttributesFromNode(root);
}
-QString CodeOperation::findTag (UMLOperation * op) {
+QString CodeOperation::findTag (UMLOperation * op)
+{
return QString("operation_" + ID2STR(op->getID()));
}
-/** set attributes of the node that represents this class
- * in the XMI document.
- */
void CodeOperation::setAttributesOnNode ( QDomDocument & doc, QDomElement & elem)
{
-
CodeMethodBlock::setAttributesOnNode(doc,elem); // superclass
-
}
-/** set the class attributes of this object from
- * the passed element node.
- */
void CodeOperation::setAttributesFromNode ( QDomElement & element)
{
-
CodeMethodBlock::setAttributesFromNode(element); // superclass
// now set local attributes
@@ -138,36 +112,32 @@
UMLObject * obj = UMLApp::app()->getDocument()->findObjectById(id);
UMLOperation * op = dynamic_cast<UMLOperation*>(obj);
- if(op)
+ if (op)
init(op);
else
- uError()<<"ERROR: could'nt load code operation because of missing UMLoperation, corrupt savefile?"<<endl;
-
+ uError() << "ERROR: could not load code operation because of missing UMLoperation, corrupt savefile?";
}
void CodeOperation::setAttributesFromObject(TextBlock * obj)
{
-
CodeMethodBlock::setAttributesFromObject(obj);
CodeOperation * op = dynamic_cast<CodeOperation*>(obj);
- if(op)
+ if (op)
init((UMLOperation*) op->getParentObject());
-
}
void CodeOperation::init (UMLOperation * parentOp)
{
-
- m_canDelete = false; // we cant delete these with the codeeditor, delete the UML operation instead.
+ setCanDelete(false); // we cant delete these with the codeeditor, delete the UML operation instead.
setTag(CodeOperation::findTag(parentOp));
// not needed.. done by parent "ownedcodeblock" class
// connect(parentOp,SIGNAL(modified()),this,SLOT(syncToParent()));
-
}
-void CodeOperation::updateContent() {
+void CodeOperation::updateContent()
+{
// Empty. Unlike codeaccessor methods for most (all?) languages
// we don't auto-generate content for operations
}
--- trunk/KDE/kdesdk/umbrello/umbrello/codeoperation.h #747972:747973
@@ -17,21 +17,20 @@
#ifndef CODEOPERATION_H
#define CODEOPERATION_H
-#include <qstring.h>
+#include <QtCore/QString>
#include "codemethodblock.h"
#include "operation.h"
-// class CodeParameter;
+/**
+ *
+ */
class CodeOperation : public CodeMethodBlock
{
Q_OBJECT
public:
- // Constructors/Destructors
- //
-
/**
* Constructors
*/
@@ -49,20 +48,22 @@
UMLOperation * getParentOperation( );
/**
- * Save the XMI representation of this object
+ * Save the XMI representation of this object.
*/
virtual void saveToXMI ( QDomDocument & doc, QDomElement & root );
/**
- * load params from the appropriate XMI element node.
+ * Load params from the appropriate XMI element node.
*/
virtual void loadFromXMI ( QDomElement & root );
- /** Find the value of the tag that this operation would have.
+ /**
+ * Find the value of the tag that this operation would have.
*/
static QString findTag (UMLOperation * op) ;
- /** set the class attributes from a passed object
+ /**
+ * Set the class attributes from a passed object.
*/
virtual void setAttributesFromObject (TextBlock * obj);
@@ -72,14 +73,16 @@
protected:
// list of parameters used by this code operation.
- // QPtrList<CodeParameter> m_parameterVector;
+ // QList<CodeParameter*> m_parameterVector;
- /** set attributes of the node that represents this class
+ /**
+ * Set attributes of the node that represents this class
* in the XMI document.
*/
virtual void setAttributesOnNode ( QDomDocument & doc, QDomElement & blockElement);
- /** set the class attributes of this object from
+ /**
+ * Set the class attributes of this object from
* the passed element node.
*/
virtual void setAttributesFromNode ( QDomElement & element);
More information about the umbrello-devel
mailing list