<feed xmlns='http://www.w3.org/2005/Atom'>
<title>subsurface.git/desktop-widgets, branch v4.9.4</title>
<subtitle>forked from https://github.com/subsurface/subsurface</subtitle>
<id>https://git.tsegers.com/subsurface.git/atom?h=v4.9.4</id>
<link rel='self' href='https://git.tsegers.com/subsurface.git/atom?h=v4.9.4'/>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/'/>
<updated>2020-05-02T12:52:51Z</updated>
<entry>
<title>desktop: fix editing of trips</title>
<updated>2020-05-02T12:52:51Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-05-02T12:02:53Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=a8130f0fa16a35dd647d04449c8e561156e86549'/>
<id>urn:sha1:a8130f0fa16a35dd647d04449c8e561156e86549</id>
<content type='text'>
In 2021035cfcee08ec4c6f9d16683db8ce400bef30 a bug was introduced:
currentTrip of MainTab was not set in trip mode. Thus, when editing
the trip notes, the notes of all selected dives were edited instead.

Set the member variable and not a local variable.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>cleanup: move declaration of utc_mk* functions to new subsurface-time.h header</title>
<updated>2020-05-01T16:42:31Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-05-01T12:07:59Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=9c70261c0e294d46d62d99725a1ae9ddc01eb1cf'/>
<id>urn:sha1:9c70261c0e294d46d62d99725a1ae9ddc01eb1cf</id>
<content type='text'>
No point in slurping in all of dive.h for translation units that only
want to do some time manipulation without ever touching a dive.

Don't call the header "time.h", because we don't want to end up in a
confusion with the system header of the same name.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>cleanup: remove includes from desktop-widgets/locationinformation.h</title>
<updated>2020-05-01T16:42:31Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-05-01T11:51:29Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=50b195142b07e58a1c0e3bfe5c725bf5e3dd4020'/>
<id>urn:sha1:50b195142b07e58a1c0e3bfe5c725bf5e3dd4020</id>
<content type='text'>
Notably, there was a circular include

locationinformation.h &lt;-&gt; importgps.h

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>cleanup: move dive_table from dive.h to divelist.h</title>
<updated>2020-05-01T16:42:31Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-05-01T11:43:52Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=95284c026e763482ef581c8b6298012d2c1fd941'/>
<id>urn:sha1:95284c026e763482ef581c8b6298012d2c1fd941</id>
<content type='text'>
This allows us to decouple dive.h and divelist.h, a small step in
include disentangling.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>desktop: don't replot profile when populating dive information tab</title>
<updated>2020-04-30T21:14:13Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-04-30T19:23:15Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=60b00162a9cc666a1af062d2610f28cfe7df09ae'/>
<id>urn:sha1:60b00162a9cc666a1af062d2610f28cfe7df09ae</id>
<content type='text'>
When the dive mode is changed, the profile has to be replot. This
is by a function of the TabDiveInformation. However, that function
was also executed when populating the tab. Thus, when changing dive,
the profile was plot twice.

Move the profile plotting out of the function. Ultimately, the profile
should listen to the appropriate signals itself.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>selection: replace selectedTrips() by singleSelectedTrip() function</title>
<updated>2020-04-26T20:54:59Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-04-26T20:05:28Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=2021035cfcee08ec4c6f9d16683db8ce400bef30'/>
<id>urn:sha1:2021035cfcee08ec4c6f9d16683db8ce400bef30</id>
<content type='text'>
To check wether the tab widgets should show the trip view, they called
the selectedTrips() function. The trip view was shown if that contained
only one trip. However, the selectedTrips() function was very slow,
because it has to query to core models.

Change the function to singleSelectedTrip(), which returns a trip
if there is exactly one trip selected. The function returns early
if there is more than one trip selected. This makes the select-all
case much faster.

There are two cases which are still very slow:
- List mode, because here all top-level items are queried.
- Dive log with many only top-level items.

Ultimately, we will have to cache the trip selection because
querying the model is too slow.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>desktop: select dives at once</title>
<updated>2020-04-26T20:54:59Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-04-26T19:21:44Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=6e83135fba49680fe1e951d19d6bc6690328c5d8'/>
<id>urn:sha1:6e83135fba49680fe1e951d19d6bc6690328c5d8</id>
<content type='text'>
The old code would call QItemSelectionModel::select() once for every dive.
Instead collect the selection in a QItemSelection and only call
QItemSelectionModel::select() once. This makes selecting multiple dives
significantly faster.

The loop also expanded the trips with selections. This has now to be
done in an extra loop.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>dive list: don't access selected dives via indices</title>
<updated>2020-04-26T20:54:59Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-04-26T17:34:08Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=4f438d1e32a8a690c77f7eba8f80711e35e85df5'/>
<id>urn:sha1:4f438d1e32a8a690c77f7eba8f80711e35e85df5</id>
<content type='text'>
When determining the selected dive sites to highlight them on the
map, the DiveListView code used the local indices of the selected
dives. However, that was unreasonably slow. Even though a layering
violation, let's access the core data structures directly. In my
tests this improved from 700 ms to 0 ms!

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>cleanup: make DiveListView slots private</title>
<updated>2020-04-26T20:54:59Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-04-26T16:57:51Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=2ad3696230e5bbd4f5a339121812d27e857c1789'/>
<id>urn:sha1:2ad3696230e5bbd4f5a339121812d27e857c1789</id>
<content type='text'>
It makes reasoning about code so much easier when one knows that
functions cannot be accessed from the outside. Therefore, make
a number of DiveListView slots private. Moreover, unslotize
functions that never were used in connect calls.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>selection: move test for programmatical selection changes to widget</title>
<updated>2020-04-26T20:54:59Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2020-04-26T16:44:59Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=5d49da5d6b3a16a9f0d08328a5e3dc9b609a1b51'/>
<id>urn:sha1:5d49da5d6b3a16a9f0d08328a5e3dc9b609a1b51</id>
<content type='text'>
The DiveListView widget has to differentiate between programmatical
und user-initiated selection changes. It did so by using the
DiveListNotifier::inCommand() flag.

However,
1) There is only one point of entry for such selection changes,
   viz. the MultiFilterSortModel::selectionChanged() signal
2) This signal is not only emitted in command-context.
   Another source is for example dive-map selection changes.

Therefore, move the programmatical-selection-change status down
to the widget and set/reset it in the diveSelectionChanged() slot.
This makes "select all visible dive sites" somewhat faster. Sadly,
not as much as expected.

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