[qet] [4200] Bug fix

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 4200
Author:   blacksun
Date:     2015-09-12 10:29:45 +0200 (Sat, 12 Sep 2015)
Log Message:
-----------
Bug fix

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/reportelement.cpp

Modified: trunk/sources/qetgraphicsitem/reportelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/reportelement.cpp	2015-09-11 20:11:01 UTC (rev 4199)
+++ trunk/sources/qetgraphicsitem/reportelement.cpp	2015-09-12 08:29:45 UTC (rev 4200)
@@ -93,8 +93,11 @@
 		connect(elmt,                   SIGNAL( yChanged() ),                                       this, SLOT( updateLabel()     ));
 		connect(diagram(),              SIGNAL( reportPropertiesChanged(QString) ),                 this, SLOT( setLabel(QString) ));
 		connect(diagram() -> project(), SIGNAL( projectDiagramsOrderChanged(QETProject*,int,int) ), this, SLOT( updateLabel()     ));
-		connect(elmt->terminals().first(), &Terminal::conductorWasAdded, this, &ReportElement::conductorWasAdded);
-		connect(elmt->terminals().first(), &Terminal::conductorWasRemoved, this, &ReportElement::conductorWasRemoved);
+		if (elmt->terminals().size())
+		{
+			connect(elmt->terminals().first(), &Terminal::conductorWasAdded, this, &ReportElement::conductorWasAdded);
+			connect(elmt->terminals().first(), &Terminal::conductorWasRemoved, this, &ReportElement::conductorWasRemoved);
+		}
 
 		label_ = diagram() -> defaultReportProperties();
 
@@ -124,8 +127,11 @@
 		disconnect(elmt, SIGNAL(xChanged()), this, SLOT(updateLabel()));
 		disconnect(elmt, SIGNAL(yChanged()), this, SLOT(updateLabel()));
 		disconnect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
-		disconnect(elmt->terminals().first(), &Terminal::conductorWasAdded, this, &ReportElement::conductorWasAdded);
-		disconnect(elmt->terminals().first(), &Terminal::conductorWasRemoved, this, &ReportElement::conductorWasRemoved);
+		if (elmt->terminals().size())
+		{
+			disconnect(elmt->terminals().first(), &Terminal::conductorWasAdded, this, &ReportElement::conductorWasAdded);
+			disconnect(elmt->terminals().first(), &Terminal::conductorWasRemoved, this, &ReportElement::conductorWasRemoved);
+		}
 		connected_elements.removeAll(elmt);
 			//if elmt is the owner of m_watched_conductor, we remove it
 		if (elmt->conductors().contains(m_watched_conductor))


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/