<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 12, 2015 at 12:25 AM, Lubomir I. Ivanov <span dir="ltr"><<a href="mailto:neolit123@gmail.com" target="_blank">neolit123@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">hey Miika,<br>
<br>
this prevents deletion of divepoints on a newly added dive completely<br>
(Log -> Add dive):<br>
<a href="http://trac.subsurface-divelog.org/changeset/4f9705f3f54fc14d6b38123160f07015c41f3519/subsurface" target="_blank">http://trac.subsurface-divelog.org/changeset/4f9705f3f54fc14d6b38123160f07015c41f3519/subsurface</a><br></blockquote><div><br></div><div>It is also related to 6f795a0059f5b1540d62bab30bc62422717420bb<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
new bug report:<br>
<a href="http://trac.subsurface-divelog.org/ticket/846" target="_blank">http://trac.subsurface-divelog.org/ticket/846</a><br>
<br>
i can't really reproduce what the comment describes:<br>
* If we end up having divepoints that are not within the dive<br>
* profile, we need to just skip the removal to prevent<br>
* crashing due to index out of range.<br>
<br>
i always get this for any dive:<br>
rowCount() == divepoints.count()<br>
can you provide steps?<br></blockquote><div><br></div><div>The bug was not really deterministic. When moving a divepoint around and releasing it, it was occationally possible to drop the point so it was not on the profile. Bug 784 might give a better idea of how to reproduce, even though it was not that obvious.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
but also, shouldn't the check be like so?:<br>
if (rowCount() > divepoints.count())<br></blockquote><div><br></div><div>Sounds about right, if the normal case is they are the same. I do not recall the exact details and cannot dig into this at the moment.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
i wonder how is it even possible for divepoints to not be a part of<br>
the dive profile.<br></blockquote><div><br></div><div>I couldn't figure out why the bug happened, but it is worth a try to debug it further/again.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
if there another underlying bug here perhaps we should remove the<br>
check and fix that instead...<br></blockquote><div><br></div><div>Absolutely, if someone is just able to figure out how this can happen in the first place.<br><br></div><div>miika<br></div></div></div></div>