Fix crash when there is already exactly 5 events displayed
And simplify code:
- Add constant for the max number of events that can be displayed at the same time
- Use std::min to simplify a bit the code
- Rename nextIndex to addedEventCount
Edited by Carl Schwan