[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sat Mar 27 04:41:02 UTC 2004


CVS commit by okellogg: 

Add missing hooks for promoting the parameter kind of a newly created
operation parameter from the dialog to the model.


  M +4 -1      operation.cpp   1.16
  M +5 -1      operation.h   1.14
  M +2 -2      dialogs/umloperationdialog.cpp   1.25


--- kdesdk/umbrello/umbrello/operation.cpp  #1.15:1.16
@@ -41,5 +41,6 @@ UMLOperation::~UMLOperation() {
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-void UMLOperation::addParm(QString type, QString name, QString initialValue, QString doc) {
+UMLAttribute * UMLOperation::addParm(QString type, QString name, QString initialValue,
+                                     QString doc, Uml::Parameter_Kind kind) {
         // make the new parameter (attribute) public, just to be safe
         UMLDoc *umldoc = UMLApp::app()->getDocument();
@@ -47,5 +48,7 @@ void UMLOperation::addParm(QString type,
         a -> setDoc(doc);
         a -> setInitialValue(initialValue);
+        a -> setParmKind(kind);
         addParm(a);
+        return a;
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////////

--- kdesdk/umbrello/umbrello/operation.h  #1.13:1.14
@@ -84,6 +84,10 @@ public:
          * @param name          The name of the parameter.
          * @param initialValue  The initial value of the parameter.
+         * @param kind          Optional: The parameter kind (in|inout|out).
+         *                      Default is "in".
+         * @return      Pointer to the UMLAttribute created.
          */
-        void addParm(QString type, QString name, QString initialValue, QString doc);
+        UMLAttribute * addParm(QString type, QString name, QString initialValue, QString doc,
+                               Uml::Parameter_Kind kind = Uml::pk_In);
 
         /**

--- kdesdk/umbrello/umbrello/dialogs/umloperationdialog.cpp  #1.24:1.25
@@ -254,6 +254,6 @@ void UMLOperationDialog::slotNewParamete
                 }
                 if( !pAtt ) {
-                        m_pOperation->addParm( dlg.getTypeName(), name,
-                                               dlg.getInitialValue(), dlg.getDoc() );
+                        m_pOperation->addParm( dlg.getTypeName(), name, dlg.getInitialValue(),
+                                               dlg.getDoc(), dlg.getParmKind() );
                         m_pParmsLB -> insertItem( dlg.getName() );
                         m_doc -> setModified( true );






More information about the umbrello-devel mailing list