mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
62b869b24a
commit
03f9e29146
2 changed files with 8 additions and 27 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue