subsurface/commands/command_device.h
Dirk Hohndel e7a5ec46f5 undo/device: adjust device management infrastructure
We no longer need the remove infrastructure, and the edit nickname function
becomes much more intuitive to use by passing in the dive computer for
which we want to create a nickname instead of the internal index into
the array of devices.

This also removes / simplifies the device list update signals in the
DiveListNotifier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-18 13:22:02 -07:00

29 lines
679 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_DEVICE_H
#define COMMAND_DEVICE_H
#include "command_base.h"
#include "core/device.h"
struct device;
// We put everything in a namespace, so that we can shorten names without polluting the global namespace
namespace Command {
class EditDeviceNickname final : public Base {
public:
EditDeviceNickname(const divecomputer *dc, const QString &nickname);
private:
// for redo and undo
int index;
std::string nickname;
void undo() override;
void redo() override;
bool workToBeDone() override;
};
} // namespace Command
#endif