sdrtrunk icon indicating copy to clipboard operation
sdrtrunk copied to clipboard

Unable to sort current playlist by frequency

Open gingerhax opened this issue 9 months ago • 2 comments

sdrtrunk Version 0.6.0 beta 5 (aarch)

Describe the bug Clicking the column title "Frequency" in Playlist does not sort the column by frequency. All other columns (System, Site, Name, Protocol) sort correctly

To Reproduce Steps to reproduce the behavior: Open Playlist Click the column header "Frequency" Frequencies are rearranged in an order which is not numerically sorted

Expected behavior The channels in view would sort in order (1xx.xxx, 2xx.xxx, 3xx.xxx, 4xx.xxx, etc)

Screenshots Before sorting image After clicking the column header, attempting to sort image

Desktop (optional - complete the following information):

  • OS: MacOS Sonoma 14.2 with M1
  • RAM: 8GB

gingerhax avatar Nov 21 '23 14:11 gingerhax

I think the current sorting behavior appeared after your fix for bug https://github.com/DSheirer/sdrtrunk/issues/1654.

I barely know Java, but I've been staring at your frequency column comparator lambda for a while and I wonder if o1 and o2 are actually CellDataFeatures objects that you need to unpack with getValue()? My best guess is that the hashCode() fallback is the only case ever being run.

raineth avatar Mar 01 '24 07:03 raineth

I got a working build environment set up, and I was right about the second part but not the first. The comparator is being passed the strings generated by FrequencyCellValueFactory and those are sorted on their hashCode().

raineth avatar Mar 08 '24 21:03 raineth