From e7a5ec46f5577656acd1ce44b34e761193ab015b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 17 Aug 2021 11:14:42 -0700 Subject: 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 --- commands/command.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'commands/command.cpp') diff --git a/commands/command.cpp b/commands/command.cpp index 4125d994b..ff53db16c 100644 --- a/commands/command.cpp +++ b/commands/command.cpp @@ -381,14 +381,9 @@ void addPictures(const std::vector &pictures) execute(new AddPictures(pictures)); } -void removeDevice(int idx) +void editDeviceNickname(struct divecomputer *dc, const QString &nickname) { - execute(new RemoveDevice(idx)); -} - -void editDeviceNickname(int idx, const QString &nickname) -{ - execute(new EditDeviceNickname(idx, nickname)); + execute(new EditDeviceNickname(dc, nickname)); } void createFilterPreset(const QString &name, const FilterData &data) -- cgit v1.2.3-70-g09d2