From b3253304a59b85c76f8a70f20ada4139e715a5b3 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 2 Nov 2019 22:52:27 +0100 Subject: Desktop: don't connect to remove() slot of model from TableModel When connecting a model to the TableModel class, it would connect clicking on an item to the remove() slot of the model. This breaks the program flow implied by the undo code: Ui --> Undo-Command --> Model --> UI Moreover, the naming of the remove() slot is illogical, because clicks can also have different effects, as for example in the cylinder-table. Therefore, move the connect() call from TableModel to the callers. In the case of TabDiveSite, move the remove() function from the model to the TabWidget, where it makes more sense. Signed-off-by: Berthold Stoeger --- qt-models/divelocationmodel.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'qt-models/divelocationmodel.h') diff --git a/qt-models/divelocationmodel.h b/qt-models/divelocationmodel.h index a42354737..661debc53 100644 --- a/qt-models/divelocationmodel.h +++ b/qt-models/divelocationmodel.h @@ -46,8 +46,6 @@ private: QString fullText; #ifndef SUBSURFACE_MOBILE bool setData(const QModelIndex &index, const QVariant &value, int role) override; -public slots: - void remove(const QModelIndex &index); #endif // SUBSURFACE_MOBILE public: DiveSiteSortedModel(); -- cgit v1.2.3-70-g09d2