<table><tr><td style="">broulik created this revision.<br />broulik added reviewers: Plasma, davidedmundson.<br />Restricted Application added a project: Plasma.<br />Restricted Application added a subscriber: plasma-devel.<br />broulik requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D9978" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>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.<br />
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.<br />
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.</p>
<p>BUG: 389132<br />
FIXED-IN: 5.12.0</p>
<p>CHANGELOG: Fixed memory leak when there are a lot of items in notification history</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Looks just like before<br />
<a href="https://phabricator.kde.org/F5663539" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">F5663539: Screenshot_20180119_093731.png</a></p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Spawned a gazillion notifications, verified that RAM consumption doesn't go through the roof.</li>
<li class="remarkup-list-item">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.</li>
<li class="remarkup-list-item">Spawned a persistent notification, it showed up above the history</li>
<li class="remarkup-list-item">Dismissing persistenet notification in the popup by clicking X button worked fine</li>
<li class="remarkup-list-item">Dismissing history item by clicking X button worked fine</li>
<li class="remarkup-list-item">Interactive screenshot preview worked just fine when in the history</li>
<li class="remarkup-list-item">Disabled history, history was cleared</li>
<li class="remarkup-list-item">Disabled job progress, jobs weren't shown anymore</li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D9978" rel="noreferrer">https://phabricator.kde.org/D9978</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>applets/notifications/package/contents/ui/NotificationDelegate.qml<br />
applets/notifications/package/contents/ui/Notifications.qml<br />
applets/notifications/package/contents/ui/main.qml</div></div></div><br /><div><strong>To: </strong>broulik, Plasma, davidedmundson<br /><strong>Cc: </strong>plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>