View Single Post
Old 09-08-2022, 11:37 PM   #1240
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,033
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
New Test Version

2022-09-08
- Sort selectedRows on Edit List--qt gives them in user-selected order.


The issue is that when we get the list of selectedRows(), instead of being in table order, they are returned in the order selected by the user. And the removeRow() method's input parameter is row index.

If you delete 5 before 6, the list has shifted up and all the later indices have moved. But as long as you delete largest index to smallest, it's fine.

The RL code does reverse the list before deleting, so either selectedRows() once returned list order instead of user-selected order, or this has broken a long time...

capink's code works, but I think it changes more than needs to be. Attached version sorts the list without changing RL to call .model() several times.

'Fun' Fact -- Opinions Needed

I was searching for calls in RL to selectionModel().selectedRows() to check for other places with the same issue and I found a rather important one: Add to List.

When you select books in your library, RL calls selectionModel().selectedRows() on the library view table and get the same user-selected order behavior. Which is reflected in the order the books are put in the list!

Did anyone know this? I feel like this is something we should have noticed.

And should it be changed? I honestly it expected the order-in-list of added books to be the order-displayed, not user-selected-order.

At the very least, this general issue appears to be common to several plugins, FFF and Manage Series at least.

And EpubMerge selecting books...

Did I forget about this? Or just never notice it before?

Last edited by JimmXinu; 09-14-2022 at 10:13 AM. Reason: Remove obsolete test version
JimmXinu is online now   Reply With Quote