[Notifications] Put history into a ListView

Authored by broulik on Jan 19 2018, 8:55 AM.



Notification uses Repeaters for everything. While this is acceptable for jobs and notifications, of which there are few, the history can turn into a very long list of items. Using a ListView solves memory consumption by creating delegates only as needed.
Since regular notifications and notification history are quite entangled with each other, I had to configure the ListView from within the Notifications loader. To keep code changes as little as possible, the rest of the UI is just moved into the ListView header item.
While this is quite an invasive patch for a feature frozen version it's the least invasive approach I could find and is quite an important memory leak fix for an LTS.

BUG: 389132
FIXED-IN: 5.12.0

CHANGELOG: Fixed memory leak when there are a lot of items in notification history

Test Plan

Looks just like before

  • Spawned a gazillion notifications, verified that RAM consumption doesn't go through the roof.
  • Copied some files, could observe job status at the top of notifications, expanding details and canceling the job worked. Scrolling down did not result in the job delegate being destroyed.
  • Spawned a persistent notification, it showed up above the history
  • Dismissing persistenet notification in the popup by clicking X button worked fine
  • Dismissing history item by clicking X button worked fine
  • Interactive screenshot preview worked just fine when in the history
  • Disabled history, history was cleared
  • Disabled job progress, jobs weren't shown anymore

Diff Detail

R120 Plasma Workspace
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Jan 19 2018, 8:55 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 19 2018, 8:55 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Jan 19 2018, 8:55 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 19 2018, 9:57 AM
This revision was automatically updated to reflect the committed changes.