<feed xmlns='http://www.w3.org/2005/Atom'>
<title>subsurface.git/qt-models, branch v5.0.0</title>
<subtitle>forked from https://github.com/subsurface/subsurface</subtitle>
<id>https://git.tsegers.com/subsurface.git/atom?h=v5.0.0</id>
<link rel='self' href='https://git.tsegers.com/subsurface.git/atom?h=v5.0.0'/>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/'/>
<updated>2021-02-17T15:26:55Z</updated>
<entry>
<title>planner: pass in_planner argument to decoMode()</title>
<updated>2021-02-17T15:26:55Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2021-02-12T17:19:24Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=642d9c80b3597ab512fe937f05e08c10580c06dd'/>
<id>urn:sha1:642d9c80b3597ab512fe937f05e08c10580c06dd</id>
<content type='text'>
To remove reliance on global state, pass an "in_planner" argument
to decoMode(). Thus, calls to in_planner() can be removed.

This is a more-or-less automated change. Ultimately it would
probably be better to pass the current deco-mode to the affected
functions instead of calling decoMode() with an in_planner
parameter.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>desktop: cache photo and geo icons</title>
<updated>2021-02-10T22:33:15Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2021-02-10T21:16:25Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=b3e4c9c8daee8df29c7d6fc943e37886217d3c98'/>
<id>urn:sha1:b3e4c9c8daee8df29c7d6fc943e37886217d3c98</id>
<content type='text'>
The icons shown in the dive list were rendered for every single
access. Render them only once. This supposes that the
defaultIconMetrics structure does not change once the icons are
rendered!

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>cleanup: make a few DivePlannerModel functions private</title>
<updated>2021-01-20T18:01:50Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2021-01-19T20:20:01Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=e79ac9c7ed2e2516a2601afbff2193633b3a8e73'/>
<id>urn:sha1:e79ac9c7ed2e2516a2601afbff2193633b3a8e73</id>
<content type='text'>
It simplifies reasoning about control flow a lot if it is known
that functions can't be invoked from a different part of the code
base.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>cleanup: remove dive parameter from DivePlotDataModel::setDive()</title>
<updated>2021-01-20T18:01:50Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2021-01-11T15:17:34Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=5e1dcb0655fd6daa7914a78a83c5419bfbc93457'/>
<id>urn:sha1:5e1dcb0655fd6daa7914a78a83c5419bfbc93457</id>
<content type='text'>
This was not used, probably an artifact from days long gone.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>planner: remove DivePlannerPointsModel::startTimeChanged signal</title>
<updated>2021-01-20T18:01:50Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2021-01-20T08:41:21Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=764aa6c5128b452e36dac9cd5101f65f891f43ec'/>
<id>urn:sha1:764aa6c5128b452e36dac9cd5101f65f891f43ec</id>
<content type='text'>
The way the starting time of a new plan was set was bonkers:

1) PlannerWidgets::planDive() invokes DivePlannerPointsModel::
   createSimpleDive().

2) createSimpleDive() calls DivePlannerPointsModel::
   setupStartTime()

3) setupStartTime() emits a signal startTimeChanged()

4) startTimeChanged is caught by PlannerWidget and sets
   the UI field

5) change of the UI field emits a timeChanged() signal which
   is connected to DivePlannerPointsModel::setStartTime()

6) setStartTime() sets the time of the plan and displayed_dive
   and emits dataChanged()

7) dataChanged() replots the dive()

8) Back in DivePlannerPointsModel::createSimpleDive() the diveplan
   start time is overwritten with displayed_dive (the value are
   equal owing to 6)

Wow!

But it gets worse:

9) The initial dive plan is set up in createSimpleDive().

Since the profile is drawn in 7) after clearing the displayed_dive
and before constructing the initial plan, the profile is shown
on a dive without samples. It therefore generates a dummy profile.

To make this somewhat less insane, remove the startTimeChanged()
signal in 3), explicitly set the start time of plan and dive to
the one calculated by setupStartTime() and explicitly set the UI
filed in the plannerWidget.

This still indirectly draws the profile via signals in a convoluted
way, but at it straightens out things somewhat. Most importantly,
the profile doesn't have to generate a fake DC.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>mobile/cleanup: reduce the noise in our logs</title>
<updated>2021-01-14T00:16:31Z</updated>
<author>
<name>Dirk Hohndel</name>
<email>dirk@hohndel.org</email>
</author>
<published>2021-01-13T22:25:25Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=4c5997bcbe4bfa38bebb8abe5c6a42edcc7a1e99'/>
<id>urn:sha1:4c5997bcbe4bfa38bebb8abe5c6a42edcc7a1e99</id>
<content type='text'>
There are two sets of messages that tend to dominate the logs
- the RSSI updates from the Qt BLE stack
- the warnings about deprecated signal use in Kirigami

Neither of them provide any value to us when trying to find bugs; and
often they end up hiding the things that we really care about. So let's
just not log them - which is easy as we have our own message handler.

Signed-off-by: Dirk Hohndel &lt;dirk@hohndel.org&gt;
</content>
</entry>
<entry>
<title>profile: pass dive to DiveHandler</title>
<updated>2021-01-10T23:57:39Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2021-01-09T20:18:37Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=235146a95f5d79c54cf3b68b490c1cb0fb146b5f'/>
<id>urn:sha1:235146a95f5d79c54cf3b68b490c1cb0fb146b5f</id>
<content type='text'>
The DiveHandler shows a context menu where a cylinder can be
chosen. This indirectly accesses the global displayed_dive
variable.

Remove this in a step to make the profile reentrant.

The code was quite ominous: instead of simply generating the
list of cylinders, a global model was reset and then accessed
with Qt's cumbersome model/view API. All this trampling over
global state can be removed by simply making the function
that generates the list globally accessible.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>profile: explicitly update profile items</title>
<updated>2021-01-10T23:57:39Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-12-29T22:04:12Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=0104b0a91588cff613b74d36bff66ac54f5cd1a3'/>
<id>urn:sha1:0104b0a91588cff613b74d36bff66ac54f5cd1a3</id>
<content type='text'>
Instead of listening to the dive-data-model changed and
axis changed signals, update the profile items explicitly
once per plot() call. This avoids double replotting of the
dive items.

The old code had at least two replots per plot() call:
one after profileYAxis()-&gt;setMaximum() and one after
dataModel-&gt;emitDataChanged().

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>cleanup: const-ify DivePlotDataModel::*max() functions</title>
<updated>2021-01-10T23:57:39Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-12-29T21:39:12Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=f4103e4998d0a2512b6b8db931a81911b3e908a0'/>
<id>urn:sha1:f4103e4998d0a2512b6b8db931a81911b3e908a0</id>
<content type='text'>
These functions return the maximum partial pressures in the
given dive. Obviously, being pure accessors, they should be
const.

This commit also replaces the macro generating these functions
by a call to a function taking a pointer-to-member. Arguably,
C++'s pointer-to-member syntax is just as horrible as macros,
but at least it doesn't mess with syntax highlighting of
my editor and should be better to debug.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>profile: remove redundant code in DiveCalculatedCeiling</title>
<updated>2021-01-10T23:57:39Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2021-01-02T17:44:05Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=975c123a30de95eafd9b3c2ce2a625a1d05a79dc'/>
<id>urn:sha1:975c123a30de95eafd9b3c2ce2a625a1d05a79dc</id>
<content type='text'>
The DiveCalculatedCeiling profile-item has a recalc()
function, which calls "dataModel-&gt;calculateDecompression()".
This is a questionable reversal of control-flow: The
profile-item should paint the model-data not change it.

The code was supposed to be called under two conditions:

1) The value of the calcceiling3m preferences flag changed.
   This code was buggy for two reasons: Firstly, the cached
   value was always initialized to false, which means that
   sometimes the first call was missed. Secondly, the
   settingsChanged() functions was only called when closing
   the preferences window, not when changing the flag in the
   profile widgets.

2) The datetime of the dive changed. The whole control-flow is
   pretty absurd (due to "bit rot"):
     - The replan-dive command sends a date-time changed signal.
     - The main tab changes the date-time and informs the profile.
     - The profile sends a signal to the item.
     - The item instructs the model to recalculate the
       decompression.
     - The model causes the profile to be redrawn.

In any case, the whole thing is moot, because the decompression
is recalculated for *every* profile plot in create_plot_info_new().

Let's remove the code from the DiveCalculatedCeiling profile-item
and the calculateDecompression() function, which is now not
used anymore.

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