[PATCH] Partially fix dive downloading

Linus Torvalds torvalds at linux-foundation.org
Sat Jun 15 16:53:29 PDT 2013


From: Linus Torvalds <torvalds at linux-foundation.org>
Date: Sat, 15 Jun 2013 13:45:04 -1000
Subject: [PATCH] Partially fix dive downloading

The Qt branch didn't set the preexisting dive count, so matching old
dives didn't work and it always downloaded all of them.

Also, we need to autogroup dives before displaying them if autogrouping
is on.

Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

This makes the Qt branch *almost* usable for downloading new dives.

I say "almost", because now downloading works, and you can edit the dive 
trip itself, but editing the dives is too painful. The dive notes edit 
nicely, but the equipment editing is not nearly as good, and very 
confusing. And without the multi-dive editing it's just all painful.

Also, sometimes the dive note headers ("Divemaster"/"Buddy"/"Suit") seem 
to disappear.

There's also something odd going on with the serial number on my Suunto. 
I'll need to try to figure that out.

Anyway, this patch improves on things. 

 qt-ui/models.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 601f2f6280ba..b85c06741e1f 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -1057,6 +1057,9 @@ void DiveTripModel::setupModelData()
 		endRemoveRows();
 	}
 
+	if (autogroup)
+		autogroup_dives();
+	dive_table.preexisting = dive_table.nr;
 	while (--i >= 0) {
 		struct dive* dive = get_dive(i);
 		update_cylinder_related_info(dive);
-- 
1.8.3



More information about the subsurface mailing list