aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget/profilewidget2.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-01-30 15:03:48 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-30 19:33:21 +0200
commit03f9e2914654b7c15045955ec2d331457cc89542 (patch)
tree40cb0a89c9f99a6d8d96ab95b7baf254bc54facd /profile-widget/profilewidget2.h
parent62b869b24ada9f6e2e94980774d228dafe1472e2 (diff)
downloadsubsurface-03f9e2914654b7c15045955ec2d331457cc89542.tar.gz
Profile: transport gas id and timestamp via lambda
When adding a gas change event via a context menu, the gas-id and timestamp were passed in two distinct ways. 1) The gas id was extracted from the text of the action. This meant doing rather complicated parsing. 2) The timestamp was passed via the "user data" of the action, which means transporting via "QVariant". There is a much simpler way to pass arbitrary data, that is strongly typed: lambdas. Instead of shoehorning the data onto the action in an archaic way, we can simply connect to a stateful lambda. That's what they're for after all. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/profilewidget2.h')
-rw-r--r--profile-widget/profilewidget2.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h
index fadfbcbc9..aebce54aa 100644
--- a/profile-widget/profilewidget2.h
+++ b/profile-widget/profilewidget2.h
@@ -115,7 +115,6 @@ slots: // Necessary to call from QAction's signals.
void removePictures(const QVector<QString> &fileUrls);
void setPlanState();
void setAddState();
- void changeGas();
void addSetpointChange();
void splitDive();
void addBookmark();
@@ -162,6 +161,7 @@ protected:
private: /*methods*/
+ void changeGas(int tank, int seconds);
void fixBackgroundPos();
void scrollViewTo(const QPoint &pos);
void setupSceneAndFlags();