mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
e61641c79c
Even though the functionality is seemingly trivial, this is a bit invasive, as the code has to be split into two distinct parts: 1) Post undo command 2) React to changes to the divelist Don't compile that code on mobile. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
26 lines
725 B
C++
26 lines
725 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
// Note: this header file is used by the undo-machinery and should not be included elsewhere.
|
|
|
|
#ifndef COMMAND_PICTURES_H
|
|
#define COMMAND_PICTURES_H
|
|
|
|
#include "command_base.h"
|
|
|
|
// We put everything in a namespace, so that we can shorten names without polluting the global namespace
|
|
namespace Command {
|
|
|
|
class SetPictureOffset final : public Base {
|
|
public:
|
|
SetPictureOffset(dive *d, const QString &filename, offset_t offset); // Pictures are identified by the unique (dive,filename) pair
|
|
private:
|
|
dive *d; // null means no work to be done
|
|
QString filename;
|
|
offset_t offset;
|
|
|
|
void undo() override;
|
|
void redo() override;
|
|
bool workToBeDone() override;
|
|
};
|
|
|
|
} // namespace Command
|
|
#endif
|