mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-29 12:19:03 +03:00
ProtocolWidget: limit the number of items
That should save memory instead of letting the number of items grow to infinity
This commit is contained in:
parent
82c254fecf
commit
63cd5ef563
1 changed files with 7 additions and 0 deletions
|
@ -131,6 +131,13 @@ void ProtocolWidget::slotClearBlacklist()
|
|||
void ProtocolWidget::cleanIgnoreItems(const QString& folder)
|
||||
{
|
||||
int itemCnt = _ui->_treeWidget->topLevelItemCount();
|
||||
|
||||
// Limit the number of items
|
||||
while(itemCnt > 2000) {
|
||||
delete _ui->_treeWidget->takeTopLevelItem(itemCnt - 1);
|
||||
itemCnt--;
|
||||
}
|
||||
|
||||
for( int cnt = itemCnt-1; cnt >=0 ; cnt-- ) {
|
||||
QTreeWidgetItem *item = _ui->_treeWidget->topLevelItem(cnt);
|
||||
bool isErrorItem = item->data(0, IgnoredIndicatorRole).toBool();
|
||||
|
|
Loading…
Reference in a new issue