fix download table selection when sorted

pull/24/head
Zlatin Balevsky 2019-10-20 18:47:48 +01:00
parent a1fe3c01b9
commit 9a0b3bb9d6
1 changed files with 5 additions and 2 deletions

View File

@ -717,9 +717,12 @@ class MainFrameView {
}
int selectedDownloaderRow() {
int selected = builder.getVariable("downloads-table").getSelectedRow()
def downloadsTable = builder.getVariable("downloads-table")
int selected = downloadsTable.getSelectedRow()
if (selected < 0)
return selected
if (lastDownloadSortEvent != null)
selected = lastDownloadSortEvent.convertPreviousRowIndexToModel(selected)
selected = downloadsTable.rowSorter.convertRowIndexToModel(selected)
selected
}