From ecf4d18b417aa9c50ddbc936dc65f80c58d64368 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 18 Jan 2015 19:17:24 -0200 Subject: Fix extreme sluggish profile over time Whoa, this deserves a good explanation. Everytime that the mouse moved in add / plan mode, or anytime a new dive was displayed on the profile, this method would be called and connect the dataModel to the modelChanged method. This added the slot in a call-vector that the fired signal would call, adding one call to the Slot per add / plan mouse move (about 20x/s) or each time a new dive was displayed. Quickly filling the vector with more than 200 - 300 calls to this same Slot. The fix is to only connect one time. this made the add / plan mode *so* much smoother... :) Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/tankitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/profile/tankitem.cpp b/qt-ui/profile/tankitem.cpp index 48b586dd5..c0e75a371 100644 --- a/qt-ui/profile/tankitem.cpp +++ b/qt-ui/profile/tankitem.cpp @@ -50,7 +50,7 @@ void TankItem::setData(DivePlotDataModel *model, struct plot_info *plotInfo, str memcpy(pInfoEntry, plotInfo->entry, size); copy_cylinders(d, &diveCylinderStore, false); dataModel = model; - connect(dataModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(modelDataChanged(QModelIndex, QModelIndex))); + connect(dataModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(modelDataChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection); modelDataChanged(); } -- cgit v1.2.3-70-g09d2