From f4bcdf46aa6498c449be8f63c052a7cbeaf8baa6 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 26 Nov 2017 10:42:22 +0100 Subject: Inform LocationFilterModel of changed dive site name Since commit 01d961086c1d175732c597dc9acdba7cc4cd2d26, the location filter list is updated if a dive site is edited. The problem is that if the name of a selected dive site is changed, the selection is lost. Therefore, before repopulating, inform the location filter that a dive site changed its name. The location filter then internally changes the name and can properly transfer the old selection on repopulate. This is performed via the new LocationInformationWidget::nameChanged signal, which is connected to the new LocationFilterModel::changeName slot. A special case to be handled is the following: [ ] Site 1 [x] Site 2 and "Site 2" being renamed to "Site 1", i.e. both sites being merged. Here, the merging is detected and "Site 1" will likewise be checked: [x] Site 1 [x] Site 1 No merging is performed, as the list will be repopulated anyway. Signed-off-by: Berthold Stoeger --- qt-models/filtermodels.h | 1 + 1 file changed, 1 insertion(+) (limited to 'qt-models/filtermodels.h') diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h index 3060f7cf3..45f820984 100644 --- a/qt-models/filtermodels.h +++ b/qt-models/filtermodels.h @@ -68,6 +68,7 @@ public: public slots: void repopulate(); + void changeName(const QString &oldName, const QString &newName); private: explicit LocationFilterModel(QObject *parent = 0); -- cgit v1.2.3-70-g09d2