<div dir="ltr"><span style="color:rgb(0,0,0);font-size:12.8000001907349px">a) Left it as implemented first for now -safer-</span><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br><div>b) Done but when passing the "gaschange" to the helper C function</div><div>the compiler raised a warning, I guessed that's not acceptable, So I</div><div>did this hack. QString > char *. Is that okay?</div><div><br></div><div>c) Done</div></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px"><br></div><div style="color:rgb(0,0,0);font-size:12.8000001907349px">§Yousef<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 11, 2015 at 12:20 AM, Dirk Hohndel <span dir="ltr"><<a href="mailto:dirk@hohndel.org" target="_blank">dirk@hohndel.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Mar 11, 2015 at 12:13:17AM +0200, Yosef Hamza wrote:<br>
> On Tue, Mar 10, 2015 at 11:39 PM, Dirk Hohndel <<a href="mailto:dirk@hohndel.org">dirk@hohndel.org</a>> wrote:<br>
><br>
> > On Tue, Mar 10, 2015 at 11:08:14PM +0200, Yosef Hamza wrote:<br>
> ><br>
> > a) the events are ordered by time, so the moment you have one where<br>
> >    time.seconds > 0 you can stop<br>
> ><br>
><br>
> Yea I thought about that, But Gehad told me before that there was an issue<br>
> that can make events be out of order.<br>
<br>
</span>There is? That would be bad. Gehad, can you comment on that?<br>
<span class=""><br>
> b) even easier, we have a helper function you could use:<br>
> >         get_next_event(ev, "gaschange");<br>
> >    so you call this with current_dc->events<br>
> >    if you get an event back AND its time stamp is 0, remove that event<br>
> >    try again, again with current_dc->events as pointer<br>
> >    repeat until you don't find a gas change<br>
> ><br>
><br>
> That's a better solution indeed I didn't know about, I need to surf the<br>
> helper<br>
> functions more..<br>
<br>
</span>We have a lot of them. And not well structured, not consistently named,<br>
not well documented.<br>
<br>
There's almost a GSoC project hiding here in code cleanup... but the<br>
problem is that this would have to be done by a rather experienced<br>
developer whom I really trust... hard challenge for GSoC...<br>
<span class=""><br>
> c) I wouldn't call replot() in the middle; while it's unlikely that there<br>
> >    would be two gas changes at t=0, still one replot() would be sufficient,<br>
> >    right? So I'd have a little flag (bool eventRemoved) and then call<br>
> >    mark_divelist_changed() and replot() if eventRemoved is true.<br>
> ><br>
> > Makes sense?<br>
><br>
> Yes.<br>
<br>
</span>Excellent.<br>
<span class=""><br>
> > I know that this might feel frustrating. You keep sending patches and I<br>
> > keep criticizing the code and not taking them. This really is intended to<br>
> > help you and to make sure you understand the code and the code we have in<br>
> > the end makes sense. Sure, I could just fix this myself (that would be a<br>
> > lot less work for me) - but it's unlikely that you'd learn something if I<br>
> > did that.<br>
><br>
> No not at all, It give me valuable checkmarks when submitting patches :)<br>
<br>
</span>:-)<br>
<span class="HOEnZb"><font color="#888888"><br>
/D<br>
</font></span></blockquote></div><br></div>