summaryrefslogtreecommitdiffstats
path: root/qt-models/diveimportedmodel.cpp
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2018-10-14 08:20:59 +0200
committerGravatar Jan Mulder <jlmulder@xs4all.nl>2018-10-14 09:22:56 +0200
commitac9bab7e2fdc08a3ce691a2c7035e315ec3d8ff2 (patch)
tree3f4330cfe8867af0ff8b1ea4191dd5b3dd5a429e /qt-models/diveimportedmodel.cpp
parent068b01aef203ee12c2d538141621c8ab5b13f0c8 (diff)
downloadsubsurface-ac9bab7e2fdc08a3ce691a2c7035e315ec3d8ff2.tar.gz
Autogroup only when selected
Comits f427226b3b and 43c3885249f of the undo series introduced 2 calls of autogroup_dives() without checking the autogroup global boolean. This is a bug. An import from DC (for example) then triggers an autogrouping, the divelist is autogrouped, and the UI button is off. This commit solves this. I've chosen for a guard in the autogroup_dives() that now is a no-op when called when the user did not select autogrouping. In additon, simplified the other calls to this function, as we do not need to check before calling any more. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'qt-models/diveimportedmodel.cpp')
-rw-r--r--qt-models/diveimportedmodel.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/qt-models/diveimportedmodel.cpp b/qt-models/diveimportedmodel.cpp
index 6926981d5..e988a8678 100644
--- a/qt-models/diveimportedmodel.cpp
+++ b/qt-models/diveimportedmodel.cpp
@@ -174,8 +174,7 @@ void DiveImportedModel::recordDives()
}
process_imported_dives(diveTable, true, true);
- if (autogroup)
- autogroup_dives();
+ autogroup_dives();
}
QHash<int, QByteArray> DiveImportedModel::roleNames() const {