[Pkg-owncloud-commits] [owncloud-client] 05/27: ProtocolWidget: limit the number of items

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Jul 29 16:23:58 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 63cd5ef5637903c983c9be85a67171e84449f071
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Tue Jul 8 21:52:57 2014 +0200

    ProtocolWidget: limit the number of items
    
    That should save memory instead of letting the number of items grow
    to infinity
---
 src/mirall/protocolwidget.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mirall/protocolwidget.cpp b/src/mirall/protocolwidget.cpp
index 965d778..0238129 100644
--- a/src/mirall/protocolwidget.cpp
+++ b/src/mirall/protocolwidget.cpp
@@ -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();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list