Commit 851bd475 authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Remove duplicate usage of deleting graphics scene items

parent de562250
......@@ -133,11 +133,7 @@ void ToolBarStateArrow::mouseReleaseWidget()
*/
void ToolBarStateArrow::mouseReleaseEmpty()
{
if (m_selectionRect.count() == 4) {
while (!m_selectionRect.isEmpty())
delete m_selectionRect.takeFirst();
m_selectionRect.clear();
}
cleanup();
}
/**
......
......@@ -50,7 +50,7 @@ ToolBarStateAssociation::ToolBarStateAssociation(UMLScene *umlScene)
*/
ToolBarStateAssociation::~ToolBarStateAssociation()
{
delete m_associationLine;
cleanAssociation();
}
/**
......@@ -186,6 +186,7 @@ void ToolBarStateAssociation::setFirstWidget()
//TODO why is this needed?
m_pUMLScene->setPos(pos);
cleanAssociation();
m_firstWidget = widget;
m_associationLine = new QGraphicsLineItem();
......
......@@ -45,7 +45,7 @@ ToolBarStateMessages::ToolBarStateMessages(UMLScene *umlScene)
*/
ToolBarStateMessages::~ToolBarStateMessages()
{
delete m_messageLine;
cleanMessage();
}
/**
......@@ -225,6 +225,7 @@ void ToolBarStateMessages::setFirstWidget(ObjectWidget* firstObject)
yclick = 0;
}
else {
// TODO use cleanMessage()
if (m_messageLine)
delete m_messageLine;
m_messageLine = new QGraphicsLineItem();
......
......@@ -630,9 +630,8 @@ void AssociationLine::createCollaborationLine()
{
const QPen p = pen();
// recreate
delete m_collaborationLineItem;
delete m_collaborationLineHead;
//recreate
removeCollaborationLine();
m_collaborationLineItem = new QGraphicsLineItem(m_associationWidget);
m_collaborationLineItem->setPen(p);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment