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