<feed xmlns='http://www.w3.org/2005/Atom'>
<title>subsurface.git/qt-models, branch v4.9.1</title>
<subtitle>forked from https://github.com/subsurface/subsurface</subtitle>
<id>https://git.tsegers.com/subsurface.git/atom?h=v4.9.1</id>
<link rel='self' href='https://git.tsegers.com/subsurface.git/atom?h=v4.9.1'/>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/'/>
<updated>2019-07-27T21:57:31Z</updated>
<entry>
<title>Crash fix: prevent crash in MapLocationModel::reload</title>
<updated>2019-07-27T21:57:31Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-07-27T20:30:09Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=b0f1b258064bcbeb9cfc70dd4346dde5a90546ea'/>
<id>urn:sha1:b0f1b258064bcbeb9cfc70dd4346dde5a90546ea</id>
<content type='text'>
Commit 0c387549164d7eec3ea6647c54ada2fba7f8d5e6 introduced a
bug in MapLocationModel::reload() by setting an entry in the
name-to-location map before the location was initialized.

Move the setting of the map entry back where it was before:
after the assignment of the location variable.

Moreover, define the location variable directly on allocation
of the location to avoid thus bugs in the future.

Why did we not get a "might be used unitialized" warning
anyway?

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Undo: make editing of dive number undoable</title>
<updated>2019-07-20T04:44:13Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-07-17T13:49:45Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=726d08c2f71920acd8e5cc9b2d6850d1249466aa'/>
<id>urn:sha1:726d08c2f71920acd8e5cc9b2d6850d1249466aa</id>
<content type='text'>
When pressing F2 in the dive list, the number can be edited.
Make this action undoable by implementing a EditNumber command.

This command is differs from the other undo commands, as not the
currently selected dives are changed. This means that the EditCommand
needs an alternative constructor taking a single dive. This constructor
was implemented in the base class so that all edit commands can now
be called with a single dive.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Core: dynamically resize weight table</title>
<updated>2019-07-18T13:01:07Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-06-26T15:21:03Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=a5e7f4253ac98ad18354973fda7049e9daaea8eb'/>
<id>urn:sha1:a5e7f4253ac98ad18354973fda7049e9daaea8eb</id>
<content type='text'>
Replace the fixed-size weightsystem table by a dynamically
relocated table. Reuse the table-macros used in other parts
of the code.

The table stores weightsystem entries, not pointers to
weightsystems. Thus, ownership of the description string is
taken when adding a weightsystem. An extra function adds
a cloned weightsystem at the end of the table.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: remove includes from qthelper.h</title>
<updated>2019-07-18T12:42:55Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-07-15T21:44:39Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=8f119dcf72db445530b39e0722c3afad7c130efb'/>
<id>urn:sha1:8f119dcf72db445530b39e0722c3afad7c130efb</id>
<content type='text'>
To reduce interdependencies, remove the dive.h and divelist.h
includes in qthelper.h

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: move deco function declarations to deco.h</title>
<updated>2019-07-18T12:42:55Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-07-15T21:36:14Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=0136d76cf4fd5c62f4224d2d721fce2b78097104'/>
<id>urn:sha1:0136d76cf4fd5c62f4224d2d721fce2b78097104</id>
<content type='text'>
Another tiny step in making dive.h smaller: move function
declarations to deco.h if these functions are defined in deco.c
and don't directly concern dives.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: remove includes from qt-models/models.h</title>
<updated>2019-07-18T12:42:55Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-07-15T21:16:29Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=16214e753adda16867184df8a57301a13f2e041c'/>
<id>urn:sha1:16214e753adda16867184df8a57301a13f2e041c</id>
<content type='text'>
qt-models/models.h included dive.h and divelist.h. Remove these
unnecessary includes, to reduce interdependencies. A drop in the
bucket, for sure.

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