<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 29, 2016 at 9:54 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 29 April 2016 at 11:18, Rick Walsh <<a href="mailto:rickmwalsh@gmail.com">rickmwalsh@gmail.com</a>> wrote:<br>
><br>
> diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp<br>
> index 6e0abf0..350d15a 100644<br>
> --- a/qt-models/cylindermodel.cpp<br>
> +++ b/qt-models/cylindermodel.cpp<br>
> @@ -274,7 +274,7 @@ bool CylindersModel::setData(const QModelIndex &index,<br>
> const QVariant &value, in<br>
>         case USE:<br>
>                 if (CHANGED()) {<br>
>                         int use = vString.toInt();<br>
> -                       if (use > NUM_GAS_USE - 1)<br>
> +                       if (use > NUM_GAS_USE - 1 || use < 0)<br>
>                                 use = 0;<br>
>                         cyl->cylinder_use = (enum cylinderuse)use;<br>
>                         changed = true;<br>
><br>
<br>
</span>our clamp on the backend isn't optimal as the UI seems a bit broken.<br>
the user has no idea what to write in that field...<br>
<br>
at least with this patch, it won't read random adjacent memory (attached).<br>
<span class=""><br>
>> > but it's probably a good thing to also limit the user on the UI side -<br>
>> > i.e. once a bad value is entered that field should be auto-adjusted to<br>
>> > a good value.<br>
>> ><br>
>> Agreed. I think this should be a drop-down list. Or remove the field from<br>
>> the table entirely. I couldn't work out if/how it's used at all.<br>
>><br>
<br>
</span>i've spent some time today, trying to make this into a combobox like<br>
the one in the "Type" column, but i'm giving up as it doesn't work for<br>
some reason...<br>
BTW, there is something fishy about the item delegate used for the<br>
"Use" column, as the source code reads that it's supposed to be a<br>
combobox, already!<br></blockquote><div><br></div><div>Lubomir<br></div><div>I have some time today - can you quicly explains what should be wrong so I can try to fix?<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
for now, i suggest that you file a bug report in the tracker.<br>
<br>
lubomir<br>
--<br>
<br>_______________________________________________<br>
subsurface mailing list<br>
<a href="mailto:subsurface@subsurface-divelog.org">subsurface@subsurface-divelog.org</a><br>
<a href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface" rel="noreferrer" target="_blank">http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface</a><br>
<br></blockquote></div><br></div></div>