aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-02-10 15:58:59 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-10 10:45:46 -0800
commit9b62d36757137b458b98cd77e5de8c592f070a72 (patch)
treef263fe2fdf982295197b94f6ce2471d4afe1403a /qt-ui
parent9b547e6c718146ab73122a1b1f5d1c94e1ce7e3a (diff)
downloadsubsurface-9b62d36757137b458b98cd77e5de8c592f070a72.tar.gz
Fix broken connection
The old way of creating the mainwindow made things a bit dependent of the order of initialization, and we don't assume that anymore. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index cc0d27df0..4ad0ba3ca 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -792,12 +792,14 @@ DiveCalculatedCeiling::DiveCalculatedCeiling() : is3mIncrement(false), gradientF
gradientFactor->setY(0);
gradientFactor->setBrush(getColor(PRESSURE_TEXT));
gradientFactor->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
- connect(MainWindow::instance()->information(), SIGNAL(dateTimeChanged()), this, SLOT(recalc()));
settingsChanged();
}
void DiveCalculatedCeiling::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
+ if (MainWindow::instance()->information())
+ connect(MainWindow::instance()->information(), SIGNAL(dateTimeChanged()), this, SLOT(recalc()), Qt::UniqueConnection);
+
// We don't have enougth data to calculate things, quit.
if (!shouldCalculateStuff(topLeft, bottomRight))
return;