Commit 9eda8853 authored by David Faure's avatar David Faure
Browse files

StandardActionManager: compress updates and emit useful signal

When deleting 5000 emails, KMail uses 100% CPU for a long time.
This is because the messagelib code (due to threading etc.) removes
rows one by one from the model. As a result
- StandardActionManager was recalculating selection (slowly, see
safeSelectedRows()) after every item
- StandardMailActionManager was doing the same again
- QSortFilterProxyModel updates its internal mapping at every step.
I can't fix the last one, but I fixed the first two:

1) compress changes with a 0s timer, so we only update the actions
when going back to the event loop
2) emit signal for StandardMailActionManager to use the computed
lists, and more importantly so that it doesn't need its own timer.
StandardActionManager is now the one which decides when StandardMailActionManager
should update.
parent be65c229
Pipeline #30655 passed with stage
in 41 minutes and 39 seconds