[Uml-devel] Please review this patch for 3.2!
Sebastian Stein
seb_stein at gmx.de
Sun Feb 8 13:05:11 UTC 2004
Hi folks,
attached is patch for KDE_3_2 kdesdk/umbrello. It fixes bug #73926, which is
marked as very high. As you can see the patch would mean a i18n() change. I
can do the patch without the i18n() change, but in this case users won't
be informed why they are not allowed to add the operation to a class. I'm
pretty sure this would confuse most people.
Am I allowed to commit this patch to 3_2 even with i18n() changes? Please cc
me, I'm not subscribed to this list.
Steinchen
--
Umbrello UML Modeller
Description : UML diagram drawing tool for KDE with code generation
Homepage : http://www.umbrello.org/
Bug Reports : http://bugs.kde.org/
CVS : kdesdk/umbrello on cvs.kde.org:/home/kde
-------------- next part --------------
diff -u old/umldoc.cpp new/umldoc.cpp
--- old/umldoc.cpp 2004-02-08 21:49:44.000000000 +0100
+++ new/umldoc.cpp 2004-02-08 21:52:01.000000000 +0100
@@ -872,28 +872,14 @@
<< endl;
return NULL;
}
- UMLOperation *op = NULL;
- if (name == QString::null || name.isEmpty()) {
- op = new UMLOperation( NULL, "", getUniqueID());
- op->setName( classifier->uniqChildName(Uml::ot_Operation) );
- //hack, make op a child of classifier without really adding it as operation
- //this makes the Op.Dialog smoother in case of name conflicts
- // classifier->insertChild( op );
- do {
- UMLOperationDialog operationDialogue(0, op);
- if( operationDialogue.exec() != QDialog::Accepted ) {
- delete op;
- return NULL;
- }
- } while (classifier->checkOperationSignature(op->getName(), params));
- } else {
+ if (name != QString::null && !name.isEmpty()) {
UMLOperation *existingOp = classifier->checkOperationSignature(name, params);
if (existingOp)
return existingOp;
- op = new UMLOperation( 0L, name, getUniqueID());
}
-
- if(params)
+ UMLOperation *op = new UMLOperation(NULL, name, getUniqueID());
+ op->setName( classifier->uniqChildName(Uml::ot_Operation) );
+ if (params)
{
UMLAttributeListIt it(*params);
for( ; it.current(); ++it ) {
@@ -903,6 +889,17 @@
op->addParm(par);
}
}
+ do {
+ UMLOperationDialog operationDialogue(0, op);
+ if( operationDialogue.exec() != QDialog::Accepted ) {
+ delete op;
+ return NULL;
+ } else if (classifier->checkOperationSignature(op->getName(), op->getParmList())) {
+ KMessageBox::information(0, i18n("An operation with the same name and signature already exists. You can not add it again."));
+ } else {
+ break;
+ }
+ } while(1);
// operation name is ok, formally add it to the classifier
classifier->addOperation( op );
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/umbrello-devel/attachments/20040208/7c310225/attachment.sig>
More information about the umbrello-devel
mailing list