summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-01-18 19:17:24 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-19 16:25:13 +1200
commitecf4d18b417aa9c50ddbc936dc65f80c58d64368 (patch)
tree5fc2dbd2c3a3df5e9f6aae5c90efe13f55c8d22f /qt-ui/profile
parent5a1be7620b4786d3522496e839bbdce5794f8ef9 (diff)
downloadsubsurface-ecf4d18b417aa9c50ddbc936dc65f80c58d64368.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r--qt-ui/profile/tankitem.cpp2
1 files changed, 1 insertions, 1 deletions
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();
}