summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-09-03 12:12:25 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-09-03 12:12:25 (GMT)
commit68de7e50892b61f952161236026485c4166a5052 (patch)
tree9a8055d55182417eb8af844495804422d5bd235b
parentb6546aa95666b20f4789fdf67e685d16756acd8c (diff)
Fix "QObject::disconnect: Unexpected null parameter" warning in stderr
-rw-r--r--src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
index 86a07a3..b7a8fa4 100644
--- a/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
+++ b/src/plugins/render/elevationprofilefloatitem/ElevationProfileFloatItem.cpp
@@ -717,7 +717,9 @@ void ElevationProfileFloatItem::switchToTrackDataSource(int index)
void ElevationProfileFloatItem::switchDataSource(ElevationProfileDataSource* source)
{
- disconnect(m_activeDataSource, SIGNAL(dataUpdated(GeoDataLineString,QVector<QPointF>)),0,0);
+ if (m_activeDataSource) {
+ disconnect(m_activeDataSource, SIGNAL(dataUpdated(GeoDataLineString,QVector<QPointF>)),0,0);
+ }
m_activeDataSource = source;
connect(m_activeDataSource, SIGNAL(dataUpdated(GeoDataLineString,QVector<QPointF>)), this, SLOT(handleDataUpdate(GeoDataLineString,QVector<QPointF>)));
m_activeDataSource->requestUpdate();