<feed xmlns='http://www.w3.org/2005/Atom'>
<title>subsurface.git/qt-models, branch v4.9.0</title>
<subtitle>forked from https://github.com/subsurface/subsurface</subtitle>
<id>https://git.tsegers.com/subsurface.git/atom/qt-models?h=v4.9.0</id>
<link rel='self' href='https://git.tsegers.com/subsurface.git/atom/qt-models?h=v4.9.0'/>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/'/>
<updated>2019-06-23T18:08:46Z</updated>
<entry>
<title>Cleanup: unify selection signals</title>
<updated>2019-06-23T18:08:46Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-06-23T10:46:42Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=2e230da3610dd1fc61badaf328a084512895fb90'/>
<id>urn:sha1:2e230da3610dd1fc61badaf328a084512895fb90</id>
<content type='text'>
For historic reasons, there where three distinct signals concerning
dive-selection from the undo-machinery:
1) divesSelected: sent newly selected dives
2) currentDiveChanged: sent if the current dive changed
3) selectionChanged: sent at the end of a command if either the selection
   or the current dive changed

Since now the undo-commands do a full reset of the selection, merge these
three signals into a single signal.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Undo: unify selection behavior in dive-list commands</title>
<updated>2019-06-23T18:08:46Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-06-23T09:13:41Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=e1abf9485cf59f1b8cb79d827fa386af48f095a4'/>
<id>urn:sha1:e1abf9485cf59f1b8cb79d827fa386af48f095a4</id>
<content type='text'>
Some commands tried to retain the current selection on undo/redo,
others set the selection to the modified dives.

The latter was introduced because it was easier in some cases, but
it is probably more user-friendly because the user gets feedback
on the change.

Therefore, unify to always select the affected dives on undo()/redo().

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Undo: don't send signals batched by trip</title>
<updated>2019-06-23T18:08:46Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-06-23T07:22:26Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=27944a52b1c2a1c68ccfe88c4a84d3f74fb8b512'/>
<id>urn:sha1:27944a52b1c2a1c68ccfe88c4a84d3f74fb8b512</id>
<content type='text'>
Since the default view is batched by trips, signals were sent trip-wise.
This seemed like a good idea at first, but when more and more parts used
these signals, it became a burden. Therefore push the batching to the
part of the code where it is needed: the trip view.

The divesAdded and divesDeleted are not yet converted, because these
are combined with trip addition/deletion. This should also be detangled,
but not now.

Since the dive-lists were sorted in the processByTrip function, the
dive-list model now does its own sorting. This will have to be
audited.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Dive list: cache shown flag in model (quick-fix for undo-crash)</title>
<updated>2019-06-23T18:08:46Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-06-22T18:48:59Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=cbcddaa396f6668fef7750eb2721bc70ca11d0e4'/>
<id>urn:sha1:cbcddaa396f6668fef7750eb2721bc70ca11d0e4</id>
<content type='text'>
We have a very fundamental problem with data-duplication in
core and qt-models. In a particular case, this led to an easily
reproducible crash:
1) An undo command moved the last dive of a trip to another.
2) When an undo-command removed the last dive of
   a trip to a different trip, the dive was removed from the
   trip in the core. Then, the model was updated.
3) That lead at first to a rearrangement of the trips, because
   the trip with the added dive is moved before the trip with
   the removed dive.
4) In such a case, the filter-model checks the visibility of
   the trip.
5) Since the trip with the removed dive has no dives in the core,
   visibility was determined as false.
6) From this point on the mappings of the QSortFilterProxyModel
   were messed up. Accesses led to crashes. It is unclear
   whether this is a Qt bug or only a QOI issue.

As a quick-fix, cache the visibility flag of trips directly
in the Qt-models. Don't set the visibility directly in the
core, but go via the Qt-models. Thus, a more clear layering
is achieved.

In the long run, we can hopefully get rid of the data-duplication
in the models.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: return directly from data() methods</title>
<updated>2019-06-19T20:11:10Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-06-08T06:49:12Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=38ba434966409987e5dfb894c27c8c03168cfdc6'/>
<id>urn:sha1:38ba434966409987e5dfb894c27c8c03168cfdc6</id>
<content type='text'>
There is this anti-pattern in QModel data() functions to assign
to a "ret" variable and return at the end of the function. This
is inefficient, as the object is not directly constructed at
the space reserved by the caller.

Change the functions in WeightModel and CylinderModel to return
the objects directly.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: move trip-related functions into own translation unit</title>
<updated>2019-06-19T20:11:10Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-05-31T14:09:14Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=7f4d9db962e73aa5d5089c43c99b78b3690ffb87'/>
<id>urn:sha1:7f4d9db962e73aa5d5089c43c99b78b3690ffb87</id>
<content type='text'>
These functions were spread out over dive.c and divelist.c.
Move them into their own file to make all this a bit less monolithic.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: move tag functions into own translation unit</title>
<updated>2019-06-19T20:11:10Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-05-30T16:29:36Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=6200909ba4ffba2d79770b7eacdb615eeb2c88c1'/>
<id>urn:sha1:6200909ba4ffba2d79770b7eacdb615eeb2c88c1</id>
<content type='text'>
Make dive.h a bit slimmer. It's only a drop in the bucket - but at
least when modifying tag functions not the *whole* application is
rebuilt anymore.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: fix a few comments and debug messages</title>
<updated>2019-05-21T04:23:16Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-05-19T16:20:50Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=879f52180c077e924c7e44eb4c38017606df2834'/>
<id>urn:sha1:879f52180c077e924c7e44eb4c38017606df2834</id>
<content type='text'>
This is just minor fixes that are not user-visible:
Fix a few erroneous comments and a debug message. These are
copy &amp; paste mistakes and mistakes introduced during code-
refactoring.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: small coding style fixes</title>
<updated>2019-05-15T14:42:14Z</updated>
<author>
<name>Dirk Hohndel</name>
<email>dirk@hohndel.org</email>
</author>
<published>2019-05-15T14:42:14Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=2feedf46fa86c19095a9f302d1d7a44d3416384d'/>
<id>urn:sha1:2feedf46fa86c19095a9f302d1d7a44d3416384d</id>
<content type='text'>
And addressing a cut and paste error in a comment.

Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
<entry>
<title>Cleanup: remove UTF8 macros</title>
<updated>2019-05-12T19:25:43Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-05-11T20:45:49Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=e362afe43ca4144838fd544bcb048d4a033690bc'/>
<id>urn:sha1:e362afe43ca4144838fd544bcb048d4a033690bc</id>
<content type='text'>
At some places we use UTF8 string literals. Therefore, we effectively
only support UTF8 build systems. We might just as well remove all
the other UTF_* macros and use direct string literals.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
</feed>
