status-desktop/test
Jonathan Rainville 2aa759adcf refactor(section-model): change model to be sorted to fix reorder
Part of #3364

To make the drag and drop reorder work correctly on channels, we needed to change the model again so that it was sorted in the model itself.
That is because the drag and drop gives us the value of the position it is dropped to as a single list, so dragging the second item of the second category would mean from position 5 to position to position 4, but what the backend wants is moving the item 2 to position 1.
Sorting the model enables us to get the category that is the parent of that position and call the service with the right positions and id.
It also enables us to reorder the channel in and out of the category.
See the module code to see how the calculation is done with an explanatory comment.
The model needed some changes to support that. Some of the function where changed from dataChange calls to resetModel calls, since we need to re-sort the model.
I tried using beginMove, but it would crash. Maybe there is a bug in NimQML or I used it badly, I'm not sure.
2023-04-19 12:26:15 -04:00
..
libs/StatusGoQt fix(@desktop/cpp): Implement StatusGoQt::sendMessage() function 2023-04-18 10:47:42 +02:00
nim feat(chat): implement marking specific messages as seen 2023-04-17 18:53:42 +02:00
ui-test refactor(section-model): change model to be sorted to fix reorder 2023-04-19 12:26:15 -04:00
unit chore(CPP): Basic project configuration setup using Qt6 2022-06-30 12:16:33 +02:00