<feed xmlns='http://www.w3.org/2005/Atom'>
<title>subsurface.git/desktop-widgets, branch v4.8.4</title>
<subtitle>forked from https://github.com/subsurface/subsurface</subtitle>
<id>https://git.tsegers.com/subsurface.git/atom?h=v4.8.4</id>
<link rel='self' href='https://git.tsegers.com/subsurface.git/atom?h=v4.8.4'/>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/'/>
<updated>2018-11-05T15:55:53Z</updated>
<entry>
<title>Dive list: let sort arrows reflect sort order for NR and DATE</title>
<updated>2018-11-05T15:55:53Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2018-11-04T19:24:16Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=da3ea59a25890b5992413e80c4260e4350129061'/>
<id>urn:sha1:da3ea59a25890b5992413e80c4260e4350129061</id>
<content type='text'>
The old code always sorted by "ascending" by default. But
because users typically want their new dives top, "ascending"
was defined for NR and DATE, such that it is actually descending.
Turn these around and intitialize these two fields as
default-descending.

This is possible using the Qt::InitialSortOrderRole role
in DiveTripModel::headerData().

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Dive list: remove sortColumn and currentOrder members</title>
<updated>2018-11-05T15:55:53Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2018-11-04T17:11:30Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=64a1a50e10c4ec8432de9d7cc08921b1b5b490a5'/>
<id>urn:sha1:64a1a50e10c4ec8432de9d7cc08921b1b5b490a5</id>
<content type='text'>
Since the QHeaderView of DiveListView is now the authority
over sort-column and sort-order, it makes little sense
to keep these as member variables. That would only risk
inconsistencies. Remove them and query the QHeaderView
instead.

We still need to keep track of currentLayout, as we
have to detect if it changes to change the underlying
model from tree to list or vice-versa.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Dive list: split reload() in reload() and setSortOrder()</title>
<updated>2018-11-05T15:55:53Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2018-11-04T16:54:38Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=f2f18b4e16656f0eb0d6b41981baa991ade3d33c'/>
<id>urn:sha1:f2f18b4e16656f0eb0d6b41981baa991ade3d33c</id>
<content type='text'>
The DiveListView code had a very fundamental problem with its
header: Each had its own idea of who is responsible for sorting.
Since we can't easily change QHeaderView, accept QHeaderView
as the authority on sort-column and order.

To make this possible, split the reload() function in two
distinct functions:
 - reload() reloads the model and sorts according to the
   current sort criterion.
 - setSortOrder() tells the header to display a certain
   sort criterion. If this is a new criterion, it will then
   emit a signal. In this signal, resort according to that
   criterion.

Thus, the actual sorting code has to be moved from the
headerClicked() to a new sortIndicatorChanged() slot.
Morover, the sorting of the QHeaderView has to be used.

Reported-by: Stefan Fuchs &lt;sfuchs@gmx.de&gt;
Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Dive list: invert default sort order for sort by date / number</title>
<updated>2018-11-02T14:46:01Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2018-11-02T07:09:00Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=76f38ff33b918d4880614ff277b4b611c0ce2998'/>
<id>urn:sha1:76f38ff33b918d4880614ff277b4b611c0ce2998</id>
<content type='text'>
Commit 6dc1d239f81f16133d5954bd2b21ffa0c2dcc755 introduced a
well-defined sort order in the case of equal contents. It changed
the code for sorting by date to simply use the order of the
source model.

BUT: The source-model was already sorted in descending order
on date. Thus setting the default order on descening by date,
the data was then presented as *ascending* by date.

Change this back to descending by always using default-ascending
in the filter model.

Ultimately, the source model should simply reflect the ordering
of the core-data (ascending on date), but such a change is
too invasive shortly before release.

Reported-by: Jan Mulder &lt;jlmulder@xs4all.nl&gt;
Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Dive list: remove forceSort parameter from DiveListView::reload()</title>
<updated>2018-11-01T14:28:15Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2018-10-29T14:14:29Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=6fb3a499e67bc5375e66faef5969afee99a74d25'/>
<id>urn:sha1:6fb3a499e67bc5375e66faef5969afee99a74d25</id>
<content type='text'>
DiveListView::reload() was called for full reset of the dive list
and for changing the view (tree vs. lis) in DiveListView::headerClicked().
Since the latter does sorting by itself, a parameter "forceSort" was
introduced, which defaulted to true, but was set to false by
DiveListView::headerClicked().

To remove complexity, simply let DiveListView::headerClicked() set
the view by itself and remove tha parameter.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Dive list: connect header-signal in constructor</title>
<updated>2018-11-01T14:28:15Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2018-10-29T14:06:23Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=ade0d8e758bd925f919d172c0293eb160502e0fd'/>
<id>urn:sha1:ade0d8e758bd925f919d172c0293eb160502e0fd</id>
<content type='text'>
The QHeaderView::sectionPressed() signal was connected everytime
the list-view was reset. Likewise, setSectionsClickable() was
set to true everythime the list-view was reset.

Once in the constructor is enough.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Dive list: make filter model aware of its source</title>
<updated>2018-11-01T14:28:15Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2018-10-29T13:56:48Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=803111ef02f84119f762ce495710edb2e7f40bdb'/>
<id>urn:sha1:803111ef02f84119f762ce495710edb2e7f40bdb</id>
<content type='text'>
The data-flow from C-core to list-view is as follows:

C-core --&gt; DiveTripModel --&gt; MultiSortFilterModel --&gt; DiveListView

The control-flow, on the other hand, differs as DiveListView
accesses both MultiSortFilterModel and DiveTripModel, whereas
MultiSortFilterModel is mostly unaware of its source model.

This is in principle legitimate, as the MultiSortFilterModel might
be used for different sources. In our particular case, this is
not so. MultiSortFilterModel is written for a particular use case.

Therefore, model control-flow follow after data-flow: Let MultiSortFilterModel
set its own source model and DiveListView access the MultiSortFilterModel,
which then manages its source model.

This is not bike-shedding, but will enable a more flexible and
higher-performance sorting.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Desktop: do not crash in verbose mode on empty dive site</title>
<updated>2018-10-31T14:51:31Z</updated>
<author>
<name>Jan Mulder</name>
<email>jlmulder@xs4all.nl</email>
</author>
<published>2018-10-31T10:17:26Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=68d7e7c4e386f8dfe2068cf8075aeef8f3dff367'/>
<id>urn:sha1:68d7e7c4e386f8dfe2068cf8075aeef8f3dff367</id>
<content type='text'>
Import dives from a DC, and have ssrf started in verbose mode. After
downloading dives, hit ok, to add them to the dive list. This crashes
as we cannot get the uuid from the null dive site.

Added a simple guard to fix this.

Signed-off-by: Jan Mulder &lt;jlmulder@xs4all.nl&gt;
</content>
</entry>
<entry>
<title>Dive site: fix oversight in 920eb7576f</title>
<updated>2018-10-30T22:24:07Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2018-10-30T17:34:36Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=dec9401f48f922c1d8fc6ae40f4f5e50cf781ced'/>
<id>urn:sha1:dec9401f48f922c1d8fc6ae40f4f5e50cf781ced</id>
<content type='text'>
In commit 920eb7576ff3c5fab19c12b7b291042817422ac5 "dive_site *"
was included in Qt's "metatype" system to be able to pass it
through QVariants. One instance was forgotten and a "void *"
was passed in. On readout NULL was returned, which made it
impossible to add new dive-sites under certain circumstances.

Convert this one instance to a proper "dive_site *" QVariant.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Dive site: pass pointer-to-dive_site via QVariant</title>
<updated>2018-10-29T00:09:31Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2018-10-28T20:16:42Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=920eb7576ff3c5fab19c12b7b291042817422ac5'/>
<id>urn:sha1:920eb7576ff3c5fab19c12b7b291042817422ac5</id>
<content type='text'>
There was this ugly pattern of passing pointers-to-dive_site via
a QVariant of void * type. This is of course inherently unsafe.

Pass these pointers using their proper types instead. This makes
it necessary to register them in Qt's meta-type system. Doing so,
fixes a bug: QML couldn't call into updateDiveSiteCoordinates()
because it didn't know the type and thus the coordinates of
the moved flag were not reflected in the divesite-dialog.

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