[qet] [4199] Bug fix

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


Revision: 4199
Author:   blacksun
Date:     2015-09-11 22:11:01 +0200 (Fri, 11 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 07:48:00 UTC (rev 4198)
+++ trunk/sources/qetgraphicsitem/reportelement.cpp	2015-09-11 20:11:01 UTC (rev 4199)
@@ -44,8 +44,11 @@
 	link_type == "next_report"? inverse_report=PreviousReport : inverse_report=NextReport;
 
 		//We make these connections, to be always aware about the conductor properties
-	connect (terminals().first(), &Terminal::conductorWasAdded, this, &ReportElement::conductorWasAdded);
-	connect (terminals().first(), &Terminal::conductorWasRemoved, this, &ReportElement::conductorWasRemoved);
+	if (terminals().size())
+	{
+		connect (terminals().first(), &Terminal::conductorWasAdded, this, &ReportElement::conductorWasAdded);
+		connect (terminals().first(), &Terminal::conductorWasRemoved, this, &ReportElement::conductorWasRemoved);
+	}
 }
 
 /**
@@ -55,7 +58,8 @@
 ReportElement::~ReportElement()
 {
 	unlinkAllElements();
-	disconnect(terminals().first(), 0, 0, 0);
+	if (terminals().size())
+		disconnect(terminals().first(), 0, 0, 0);
 	if (m_watched_conductor)
 		disconnect(m_watched_conductor, &Conductor::propertiesChange, this, &ReportElement::updateLabel);
 }


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