diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-09-22 19:55:48 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-22 19:58:14 -0700 |
commit | aeac5fcb6d3134e644f78c3390ca6253da86031e (patch) | |
tree | 5ef3a50e487d99f2261c2d755889720bfac290f1 /qt-ui/profile | |
parent | a761a330695df7007349587a599565f328a6998e (diff) | |
download | subsurface-aeac5fcb6d3134e644f78c3390ca6253da86031e.tar.gz |
Add refreshProfile member function to MainWindow class
While the whole idea of calling these functions through the MainWindow
instance is atrocious, until we change the architecture of all this
refreshProfile() is a useful function to have.
In order to make this cleaner to implement I allowed an argument to
ProfileWidget's replot() which allows picking a specific dive. By
defaulting this to 0 we get the previous behavior when calling replot()
without an argument.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 4 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 514edcfc5..5b7c3832a 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -342,12 +342,12 @@ void ProfileWidget2::setupItemOnScene() replotEnabled = true; } -void ProfileWidget2::replot() +void ProfileWidget2::replot(struct dive *d) { if (!replotEnabled) return; dataModel->clear(); - plotDive(0, true); // simply plot the displayed_dive again + plotDive(d, true); } void ProfileWidget2::setupItemSizes() diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index 1127b8498..7e038edc3 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -109,7 +109,7 @@ slots: // Necessary to call from QAction's signals. void pointsRemoved(const QModelIndex &, int start, int end); void plotPictures(); void setReplot(bool state); - void replot(); + void replot(dive *d = 0); /* this is called for every move on the handlers. maybe we can speed up this a bit? */ void recreatePlannedDive(); |