aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/divelist.c6
-rw-r--r--desktop-widgets/mainwindow.cpp9
-rw-r--r--qt-models/diveimportedmodel.cpp3
3 files changed, 9 insertions, 9 deletions
diff --git a/core/divelist.c b/core/divelist.c
index d67f7935f..ad851ecc8 100644
--- a/core/divelist.c
+++ b/core/divelist.c
@@ -1023,7 +1023,8 @@ dive_trip_t *get_dives_to_autogroup(int start, int *from, int *to, bool *allocat
}
/*
- * Walk the dives from the oldest dive, and see if we can autogroup them
+ * Walk the dives from the oldest dive, and see if we can autogroup them.
+ * But only do this when the user selected autogrouping.
*/
void autogroup_dives(void)
{
@@ -1032,6 +1033,9 @@ void autogroup_dives(void)
int i, j;
bool alloc;
+ if (!autogroup)
+ return;
+
for(i = 0; (trip = get_dives_to_autogroup(i, &from, &to, &alloc)) != NULL; i = to) {
/* If this was newly allocated, add trip to list */
if (alloc)
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index ec2006405..dfa3f4c17 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -612,8 +612,7 @@ void MainWindow::on_actionCloudstorageopen_triggered()
if (!parse_file(fileNamePtr.data(), &dive_table))
setCurrentFile(fileNamePtr.data());
process_loaded_dives();
- if (autogroup)
- autogroup_dives();
+ autogroup_dives();
Command::clear();
hideProgressBar();
refreshDisplay();
@@ -1713,8 +1712,7 @@ void MainWindow::importFiles(const QStringList fileNames)
parse_file(fileNamePtr.data(), &table);
}
process_imported_dives(&table, false, false);
- if (autogroup)
- autogroup_dives();
+ autogroup_dives();
Command::clear();
refreshDisplay();
}
@@ -1738,8 +1736,7 @@ void MainWindow::loadFiles(const QStringList fileNames)
hideProgressBar();
updateRecentFiles();
process_loaded_dives();
- if (autogroup)
- autogroup_dives();
+ autogroup_dives();
Command::clear();
refreshDisplay();
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 {