Skip to content
  • Benjamin Berg's avatar
    power: Correctly lookup or insert new items into combobox · 8b8b49e9
    Benjamin Berg authored and Georges Basile Stavracas Neto's avatar Georges Basile Stavracas Neto committed
    The code to lookup or insert items into the combobox had a few issues.
    It would assume that the items are sorted, causing existing items to not
    be found and be inserted instead. It also would simply forget to insert
    an item if it was larger than all existing items.
    
    This code is now changed to iterate over all items, finding the best
    insertion point in the process (next item has a larger value, or the
    values are not increasing anymore). The item will only be inserted if it
    has not been found.
    
    Fixes #261
    
    
    (cherry picked from commit b5711c59)
    8b8b49e9