<feed xmlns='http://www.w3.org/2005/Atom'>
<title>subsurface.git/map-widget, branch v4.9.3</title>
<subtitle>forked from https://github.com/subsurface/subsurface</subtitle>
<id>https://git.tsegers.com/subsurface.git/atom?h=v4.9.3</id>
<link rel='self' href='https://git.tsegers.com/subsurface.git/atom?h=v4.9.3'/>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/'/>
<updated>2019-09-06T18:48:47Z</updated>
<entry>
<title>Cleanup: remove accessor functions from MapLocation</title>
<updated>2019-09-06T18:48:47Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-08-31T22:18:15Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=4eaf6b20bece25516d6ba29e372ac84de690cde7'/>
<id>urn:sha1:4eaf6b20bece25516d6ba29e372ac84de690cde7</id>
<content type='text'>
Let's face it: this is a value type. No point in having Java-style
getters and setters. Replace by plain old and boring member variables.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Map: export isSelected as attribute from MapLocationModel</title>
<updated>2019-09-06T18:48:47Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-08-31T21:24:21Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=1d01fff0061bde6260259a9a2b46f80a31ad1218'/>
<id>urn:sha1:1d01fff0061bde6260259a9a2b46f80a31ad1218</id>
<content type='text'>
Recently we changed the MapLocationModel-items to store whether
they are selected. Thus, we can directly export an isSelected
flag instead of calling a function taking a dive-site argument.

1) This makes the QML easier to read.
2) This avoids passing pointers through QML which has caused
   us lots of pain.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Map: calculate the z value in the model</title>
<updated>2019-09-06T18:48:47Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-08-30T16:09:37Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=652b78657ebe18ff101d3f6cd2ac9f3458db1881'/>
<id>urn:sha1:652b78657ebe18ff101d3f6cd2ac9f3458db1881</id>
<content type='text'>
Since not fully reloading the map on selection change,
the selected sites were not moved to the top. Not calculating
the z-value in QML, but making it a simple model property
helps.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Desktop: show all selected dive sites on click</title>
<updated>2019-09-06T18:48:47Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-08-30T15:38:54Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=488eb1542336088245841d79549e26938e2d3fd9'/>
<id>urn:sha1:488eb1542336088245841d79549e26938e2d3fd9</id>
<content type='text'>
When clicking a dive site on the map, the QML code would set
the selected dive site, but then all dives of dive sites in
the vicinity were set. But still only the clicked-on dive site
was shown.

Therefore, don't set the list of selected dive sites in QML,
but later in DiveListView::selectDives(), where we know all
the dives that were selected.

This, again, gives nasty entanglement of diverse widgets and
models.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Map: don't fully reset model on selection change</title>
<updated>2019-09-06T18:48:47Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-08-30T14:51:59Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=b39f2406c6a520f0b3743324744f3c55914adc52'/>
<id>urn:sha1:b39f2406c6a520f0b3743324744f3c55914adc52</id>
<content type='text'>
When changing the selection the MapLocationModel was reset.
This lead to crashes on Qt-5.9 which are due to QML accessing
data that was freed during model reset. This putative Qt bug
doesn't happen on newer Qt versions. At least Qt-5.12 is known
to work.

Instead of fighting the bug, let's simply not reset the model
but send a dataChanged() for every element of the MapLocationModel.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Map: generate pixmap name in model</title>
<updated>2019-09-06T18:48:47Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-08-30T13:25:59Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=bce31ab8621537441b42389801e20de56861438c'/>
<id>urn:sha1:bce31ab8621537441b42389801e20de56861438c</id>
<content type='text'>
Experimentation has shown that the image of a flag will
only be changed after dataChanged() if it is a simple
property. The old code had a complex QML expression and
then - for some reason - it didn't work.

To give us better control over the flags and avoid full
reloads of the map therefore introduce a model-property
pixmap name. The name depends on whether the site is
selected and if not, whether we are in divesite-edit mode.
This makes the code rather convoluted. Firstly, we have
to save whether the site is selected in the map-item.
Secondly we have to access the global map-widget, which
in turn has to go to the map-widget helper (layering
violation!).

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Map: explicitly reload selected map on click</title>
<updated>2019-09-06T18:48:47Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-08-30T10:38:25Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=28cb75b73d3d0fa4cd8dcf3aa5884e93cb13a5d2'/>
<id>urn:sha1:28cb75b73d3d0fa4cd8dcf3aa5884e93cb13a5d2</id>
<content type='text'>
When clicking on a flag
 1) The QML would call MapLocationModel::setSelected() with
    fromClick = true
 2) MapLocationModel::setSelected() would emit a signal
    selectedLocationChanged()
 3) MapWidgetHelper would catch that signal and do the actual
    processing.
Other functions would call MapLocationModel::setSelected() with
fromClick = false, which would not emit the selectedLocationChanged()
signal.

Detangle this a bit by calling the selectedLocationChanged() function
directly from QML and remove the fromClick parameter.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Map: replace enterEditMode()/exitEditMode() by updateEditMode()</title>
<updated>2019-09-06T18:48:47Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-08-30T20:19:23Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=f818ac3352b5a66d6fcc452ddc5ebb84a18bb29a'/>
<id>urn:sha1:f818ac3352b5a66d6fcc452ddc5ebb84a18bb29a</id>
<content type='text'>
There weree two functions in MapWidgetHelper: one to enter and
one to exit edit mode. Both functions set the flag and emitted
a signal if the flag had changed.

Since the edit mode only depends on a flag of the filter this
can be simplified to a simple function that updates the flag
and raises the signal if the flag changed.

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Map: catch null divesites in map widget selection code</title>
<updated>2019-08-28T14:12:01Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-08-25T10:21:37Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=b3fd824d189056b845452d57fb967a2b50550921'/>
<id>urn:sha1:b3fd824d189056b845452d57fb967a2b50550921</id>
<content type='text'>
Just to be sure, refuse to add null divesites to the selection.

Moreover, refuse to call the setSelected function on a null-divesite.
I got an unfriendly Qt-Warning there:

"Passing incompatible arguments to C++ functions from JavaScript is
dangerous and deprecated."
"This will throw a JavaScript TypeError in future releases of Qt!"

Signed-off-by: Berthold Stoeger &lt;bstoeger@mail.tuwien.ac.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: construct MapWidgetHelper::pluginObject()</title>
<updated>2019-05-11T19:06:19Z</updated>
<author>
<name>Berthold Stoeger</name>
<email>bstoeger@mail.tuwien.ac.at</email>
</author>
<published>2019-05-09T19:43:18Z</published>
<link rel='alternate' type='text/html' href='https://git.tsegers.com/subsurface.git/commit/?id=ae6f17af0c15ec3d9907a4ba9ca8846dbb0e2721'/>
<id>urn:sha1:ae6f17af0c15ec3d9907a4ba9ca8846dbb0e2721</id>
<content type='text'>
Instead of multiple string-concatenations, create the string object
from a single string literal.

Yes, this is a mostly pointless "optimization". But it saves a few
bytes.

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