this fixes a broken connection

On Tue, Feb 10, 2015 at 3:56 PM, Tomaz Canabrava <[email protected]> wrote:

> Those extra patches fixes the resize and the flickering issues.
>
> On Tue, Feb 10, 2015 at 1:40 PM, Tomaz Canabrava <[email protected]>
> wrote:
>
>>
>>
>> On Tue, Feb 10, 2015 at 1:21 PM, Dirk Hohndel <[email protected]> wrote:
>>
>>> On Tue, Feb 10, 2015 at 12:36:34PM -0200, Tomaz Canabrava wrote:
>>> > There are obvious bugs that i'm working on.
>>> > most notably, it forgets the size of the widgets.
>>>
>>> So do these get us back to a "mostly working" state? I don't want master
>>> to be completely unusable...
>>>
>>
>> not completely.
>>
>>
>>>
>>> /D
>>>
>>>
>>
>
From 0546d9d0ed86fbb374b2c9c0723e233a298c1fd6 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <[email protected]>
Date: Tue, 10 Feb 2015 15:58:59 -0200
Subject: [PATCH 22/22] 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 <[email protected]>
---
 qt-ui/profile/diveprofileitem.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index cc0d27d..4ad0ba3 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;
-- 
2.3.0

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to