[Uml-devel] branches/work/soc-umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Sat Sep 6 09:43:01 UTC 2008
SVN commit 857721 by fischer:
Remove some deprecated methods and endl.
M +34 -44 associationwidget.cpp
M +0 -1 dialog_utils.cpp
M +0 -4 newumlwidget.h
M +6 -12 umlscene.cpp
--- branches/work/soc-umbrello/umbrello/associationwidget.cpp #857720:857721
@@ -88,11 +88,10 @@
UMLAssociation * myAssoc = m_umldoc->findAssociation( assocType, umlRoleA, umlRoleB, &swap );
if (myAssoc != NULL) {
if (assocType == at_Generalization) {
- uDebug() << " Ignoring second construction of same generalization"
- << endl;
+ uDebug() << " Ignoring second construction of same generalization";
} else {
uDebug() << " constructing a similar or exact same assoc " <<
- "as an already existing assoc (swap=" << swap << ")" << endl;
+ "as an already existing assoc (swap=" << swap << ")";
// now, just create a new association anyways
myAssoc = NULL;
}
@@ -421,7 +420,6 @@
setTextPosition( tr_Name );
if (newLabel) {
- m_pName->setActivated();
umlScene()->addWidget(m_pName);
}
@@ -638,7 +636,6 @@
}
m_role[role].m_pChangeWidget->setText(strChangeWidget);
}
- m_role[role].m_pChangeWidget->setActivated();
if (newLabel) {
setTextPosition( tr );
@@ -708,7 +705,7 @@
UMLAssociation::assocTypeHasUMLRepresentation(m_AssocType)) {
UMLObject *myObj = m_umldoc->findObjectById(getID());
if (myObj == NULL) {
- uError() << "cannot find UMLObject " << ID2STR(getID()) << endl;
+ uError() << "cannot find UMLObject " << ID2STR(getID());
return false;
} else {
const Uml::Object_Type ot = myObj->getBaseType();
@@ -1066,7 +1063,7 @@
UMLAssociation *umla = static_cast<UMLAssociation*>(umlObject());
return umla->getObjectId(role);
}
- uError() << "m_pWidget is NULL" << endl;
+ uError() << "m_pWidget is NULL";
return Uml::id_None;
}
if (m_role[role].m_pWidget->getBaseType() == Uml::wt_Object)
@@ -1134,13 +1131,12 @@
uDebug() << "segStart=(" << segStart.x() << "," << segStart.y()
<< "), segEnd=(" << segEnd.x() << "," << segEnd.y()
<< "), midSeg=(" << midSegX << "," << midSegY
- << "), mp=(" << mp.x() << "," << mp.y() << ")"
- << endl;
+ << "), mp=(" << mp.x() << "," << mp.y() << ")";
*/
if (midSegX > mp.x() || midSegY < mp.y()) {
m_nLinePathSegmentIndex++;
uDebug() << "setting m_nLinePathSegmentIndex to "
- << m_nLinePathSegmentIndex << endl;
+ << m_nLinePathSegmentIndex;
computeAssocClassLine();
}
}
@@ -1185,8 +1181,7 @@
//->avoid movement during opening
//->print warn and stay at old position
uWarning() << "called during load of XMI for ViewType: "
- << umlScene()->getType() << ", and BaseType: " << getBaseType()
- << endl;
+ << umlScene()->getType() << ", and BaseType: " << getBaseType();
return;
}
/*to be here a line segment has moved.
@@ -1529,7 +1524,7 @@
//->avoid movement during opening
//->print warn and stay at old position
uDebug() << "called during load of XMI for ViewType: " << umlScene()->getType()
- << ", and BaseType: " << getBaseType() << endl;
+ << ", and BaseType: " << getBaseType();
return;
}
@@ -2082,7 +2077,7 @@
q = m_LinePath.getPoint(lastSegment - 1);
pWidget = m_role[B].m_pWidget;
} else if (role != tr_Name) {
- uError() << "called with unsupported Text_Role " << role << endl;
+ uError() << "called with unsupported Text_Role " << role;
return QPointF(-1, -1);
}
@@ -2227,7 +2222,7 @@
}
break;
default:
- uError() << "unexpected Text_Role " << tr << endl;
+ uError() << "unexpected Text_Role " << tr;
return;
break;
}
@@ -2394,9 +2389,8 @@
if ( (x < 0 || x > FloatingTextWidget::restrictPositionMax) ||
(y < 0 || y > FloatingTextWidget::restrictPositionMax) ) {
uDebug() << "(x=" << x << " , y=" << y << ") "
- << "- was blocked because at least one value is out of bounds: ["
- << "0 ... " << FloatingTextWidget::restrictPositionMax << "]"
- << endl;
+ << "- was blocked because at least one value is out of bounds: ["
+ << "0 ... " << FloatingTextWidget::restrictPositionMax << "]";
return;
}
ft->setX( x );
@@ -2437,7 +2431,7 @@
(ftY < 0 || ftY > FloatingTextWidget::restrictPositionMax) ) {
uDebug() << "blocked because the FloatingTextWidget original position ("
<< ftX << "," << ftY << " is out of bounds: [0 ... "
- << FloatingTextWidget::restrictPositionMax << "]" << endl;
+ << FloatingTextWidget::restrictPositionMax << "]";
return;
}
QPointF pos = calculateTextPosition(role);
@@ -2449,7 +2443,7 @@
(ftNewY < 0 || ftNewY > FloatingTextWidget::restrictPositionMax) ) {
uDebug() << "blocked because the FloatingTextWidget new position ("
<< ftNewX << "," << ftNewY << " is out of bounds: [0 ... "
- << FloatingTextWidget::restrictPositionMax << "]" << endl;
+ << FloatingTextWidget::restrictPositionMax << "]";
return;
}
bool oldIgnoreSnapToGrid = ft->getIgnoreSnapToGrid();
@@ -2528,7 +2522,7 @@
if (m_pAssocClassWidget == NULL || m_pAssocClassLine == NULL)
return;
if (m_nLinePathSegmentIndex < 0) {
- uError() << "m_nLinePathSegmentIndex is not set" << endl;
+ uError() << "m_nLinePathSegmentIndex is not set";
return;
}
QPointF segStart = m_LinePath.getPoint(m_nLinePathSegmentIndex);
@@ -2560,7 +2554,7 @@
return;
}
if (m_pAssocClassLine == NULL) {
- uError() << "cannot select because m_pAssocClassLine is NULL" << endl;
+ uError() << "cannot select because m_pAssocClassLine is NULL";
return;
}
if (m_pAssocClassLineSel0)
@@ -2730,7 +2724,7 @@
// don't worry about here, I don't think it can get here as
// line is widget on seq. diagram
// here just in case - remove later after testing
- uDebug() << "mt_Properties: assoctype is " << atype << endl;
+ uDebug() << "mt_Properties: assoctype is " << atype;
} else { //standard assoc dialog
umlScene()->updateDocumentation( false );
showDialog();
@@ -2846,7 +2840,7 @@
break;
default:
- uDebug() << "Menu_Type " << sel << " not implemented" << endl;
+ uDebug() << "Menu_Type " << sel << " not implemented";
}//end switch
}
@@ -3082,8 +3076,7 @@
};
uDebug() << "findPointRegion(rect(" << rect.x() << "," << rect.y()
<< "," << rect.width() << "," << rect.height() << "), p("
- << point.x() << "," << point.y() << ")) = " << regionStr[region]
- << endl;
+ << point.x() << "," << point.y() << ")) = " << regionStr[region];
*/
// Move some regions to the standard ones.
switch (region) {
@@ -3141,7 +3134,7 @@
return QPointF(rectMidY + yoff, rectMidX); // swap back X and Y
}
if (dY == 0) {
- uError() << "usage error: " << "North/South (dY == 0)" << endl;
+ uError() << "usage error: " << "North/South (dY == 0)";
return QPointF(0,0);
}
const float m = (float)dY / (float)dX;
@@ -3156,7 +3149,7 @@
if (dY == 0)
return QPointF(rectMidY, rectMidX + xoff); // swap back X and Y
if (dX == 0) {
- uError() << "usage error: " << "East/West (dX == 0)" << endl;
+ uError() << "usage error: " << "East/West (dX == 0)";
return QPointF(0,0);
}
const float m = (float)dY / (float)dX;
@@ -3215,7 +3208,7 @@
return rectMidY;
// should be rectMidX, but we go back to Qt coord.sys.
if (dY == 0) {
- uError() << "usage error: " << "North/South (dY == 0)" << endl;
+ uError() << "usage error: " << "North/South (dY == 0)";
return -1;
}
const float m = (float)dY / (float)dX;
@@ -3231,7 +3224,7 @@
return rectMidX;
// should be rectMidY, but we go back to Qt coord.sys.
if (dX == 0) {
- uError() << "usage error: " << "East/West (dX == 0)" << endl;
+ uError() << "usage error: " << "East/West (dX == 0)";
return -1;
}
const float m = (float)dY / (float)dX;
@@ -3323,9 +3316,9 @@
qreal intercept = findInterceptOnEdge(ownWidget->boundingRect(), region, refpoint);
if (intercept < 0) {
uDebug() << "updateAssociations: error from findInterceptOnEdge for"
- << " assocType=" << assocwidget->getAssocType()
- << " ownWidget=" << ownWidget->getName()
- << " otherWidget=" << otherWidget->getName() << endl;
+ << " assocType=" << assocwidget->getAssocType()
+ << " ownWidget=" << ownWidget->getName()
+ << " otherWidget=" << otherWidget->getName();
continue;
}
insertIntoLists(intercept, assocwidget);
@@ -3675,8 +3668,7 @@
connect(ent, SIGNAL(entityConstraintRemoved(UMLClassifierListItem*)),
this, SLOT(slotClassifierListItemRemoved(UMLClassifierListItem*)));
default:
- uError() << "UMLAssociation constructor: cannot associate UMLObject of type "
- << ot << endl;
+ uError() << "UMLAssociation constructor: cannot associate UMLObject of type " << ot;
}
}
@@ -3690,7 +3682,7 @@
void AssociationWidget::slotClassifierListItemRemoved(UMLClassifierListItem* obj)
{
if (obj != umlObject()) {
- uDebug() << "obj=" << obj << ": umlObject()=" << umlObject() << endl;
+ uDebug() << "obj=" << obj << ": umlObject()=" << umlObject();
return;
}
setUMLObject(NULL);
@@ -3705,7 +3697,7 @@
{
UMLAttribute *attr = getAttribute();
if (attr == NULL) {
- uError() << "getAttribute returns NULL" << endl;
+ uError() << "getAttribute returns NULL";
return;
}
setVisibility(attr->getVisibility(), B);
@@ -3861,7 +3853,7 @@
return NULL;
UMLClassifier *c = dynamic_cast<UMLClassifier*>(o);
if (c == NULL)
- uError() << "getWidget(" << role << ") is not a classifier" << endl;
+ uError() << "getWidget(" << role << ") is not a classifier";
return c;
}
@@ -4009,12 +4001,12 @@
Uml::IDType bId = STR2ID(widgetbid);
NewUMLRectWidget *pWidgetA = Widget_Utils::findWidget( aId, widgets, pMessages );
if (!pWidgetA) {
- uError() << "cannot find widget for roleA id " << ID2STR(aId) << endl;
+ uError() << "cannot find widget for roleA id " << ID2STR(aId);
return false;
}
NewUMLRectWidget *pWidgetB = Widget_Utils::findWidget( bId, widgets, pMessages );
if (!pWidgetB) {
- uError() << "cannot find widget for roleB id " << ID2STR(bId) << endl;
+ uError() << "cannot find widget for roleB id " << ID2STR(bId);
return false;
}
setWidget(pWidgetA, A);
@@ -4148,7 +4140,7 @@
QString aclsegindex = qElement.attribute("aclsegindex", "0");
m_nLinePathSegmentIndex = aclsegindex.toInt();
} else {
- uError() << "cannot find assocclass " << assocclassid << endl;
+ uError() << "cannot find assocclass " << assocclassid;
}
}
@@ -4217,7 +4209,6 @@
case Uml::tr_Coll_Message_Self:
m_pName = ft;
ft->setLink(this);
- ft->setActivated();
if(FloatingTextWidget::isTextValid(ft->text()))
ft->show();
else
@@ -4233,8 +4224,7 @@
setRoleName( ft->text(), B );
break;
default:
- uDebug() << "unexpected FloatingTextWidget (textrole "
- << role << ")" << endl;
+ uDebug() << "unexpected FloatingTextWidget (textrole " << role << ")";
delete ft;
break;
}
--- branches/work/soc-umbrello/umbrello/dialog_utils.cpp #857720:857721
@@ -72,7 +72,6 @@
targetWidget->setName(name);
}
else {
- targetWidget->cleanup();
delete targetWidget;
targetWidget = NULL;
}
--- branches/work/soc-umbrello/umbrello/newumlwidget.h #857720:857721
@@ -280,9 +280,6 @@
qreal m_origZ;
void setZ(qreal z) { setZValue(z); }
qreal getZ() const { return zValue(); }
- void setActivated() {}
- bool activate(IDChangeLog*) { return true;}
- void cleanup() {}
qreal onWidget(const QPointF& pos) const {
if(this->contains(mapFromScene(pos))) {
QSizeF s = boundingRect().size();
@@ -290,7 +287,6 @@
}
return 0;
}
- void constrain(qreal, qreal) {}
////////////////////////////////////////////////////////////////////////////////
};
--- branches/work/soc-umbrello/umbrello/umlscene.cpp #857720:857721
@@ -1,5 +1,4 @@
/***************************************************************************
- * *
* 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 *
@@ -377,7 +376,6 @@
w->setX(m_Pos.x());
w->setY(m_Pos.y());
w->setVisible(true);
- w->setActivated();
w->setFont(getFont());
// [PORT]
@@ -431,7 +429,6 @@
return;
newWidget->setVisible(true);
- newWidget->setActivated();
newWidget->setFont(getFont());
// [PORT]
@@ -734,7 +731,6 @@
continue;
//make sure message doesn't have any associations
removeAssociations(obj);
- obj->cleanup();
//make sure not in selected list
m_MessageList.removeAll(obj);
delete obj;
@@ -904,7 +900,6 @@
if (getType() == dt_Sequence && t == wt_Object)
checkMessages(static_cast<ObjectWidget*>(o));
- o->cleanup();
if (t == wt_Message) {
m_MessageList.removeAll(static_cast<MessageWidget*>(o));
} else
@@ -1496,12 +1491,12 @@
if (/* [PORT] obj->isActivated() || */ obj->getBaseType() == wt_Message)
continue;
- if (obj->activate(0)) {
+// [PORT] if (obj->activate(0)) {
obj->setVisible(true);
- } else {
- m_WidgetList.removeAll(obj);
- delete obj;
- }
+// } else {
+// m_WidgetList.removeAll(obj);
+// delete obj;
+// }
}//end foreach
//Activate Message widgets
@@ -1511,7 +1506,7 @@
// if (obj->isActivated())
// continue;
- obj->activate(m_pDoc->getChangeLog());
+// [PORT] obj->activate(m_pDoc->getChangeLog());
obj->setVisible(true);
}//end foreach
@@ -3643,7 +3638,6 @@
if (widget == NULL)
return NULL;
if (!widget->loadFromXMI(widgetElement)) {
- widget->cleanup();
delete widget;
return 0;
}
More information about the umbrello-devel
mailing list