[Pkg-owncloud-commits] [owncloud-client] 78/171: Keep only active entries in the Not Synced list #3171

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Feb 17 09:36:51 UTC 2016


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

hefee-guest pushed a commit to annotated tag upstream/2.1.1+dfsg
in repository owncloud-client.

commit e9ba7c612e4f93a37ac299cc3770756b89e982fe
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date:   Wed Jan 6 18:39:32 2016 +0100

    Keep only active entries in the Not Synced list #3171
    
    Now that we have a separate list for files that could not be synced,
    we can make sure that it only shows entries for files that are still
    not in sync with the server. This allows the user to treat this list
    as action items in order to get everything synced, including the
    blacklist.
    
    Simply remove the keep-errors logic that was used when the lists were
    merged to achieve this result.
---
 src/gui/protocolwidget.cpp | 25 +++++--------------------
 src/gui/protocolwidget.h   |  2 +-
 2 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/src/gui/protocolwidget.cpp b/src/gui/protocolwidget.cpp
index 4aa3161..5578560 100644
--- a/src/gui/protocolwidget.cpp
+++ b/src/gui/protocolwidget.cpp
@@ -126,7 +126,7 @@ void ProtocolWidget::hideEvent(QHideEvent *ev)
     QWidget::hideEvent(ev);
 }
 
-void ProtocolWidget::cleanIgnoreItems(const QString& folder)
+void ProtocolWidget::cleanItems(const QString& folder)
 {
     int itemCnt = _ui->_treeWidget->topLevelItemCount();
 
@@ -136,24 +136,9 @@ void ProtocolWidget::cleanIgnoreItems(const QString& folder)
         itemCnt--;
     }
 
-    // limit also in the protocol widget
-    itemCnt = _issueItemView->topLevelItemCount();
-
-    // Limit the number of items in the issue view
-    while(itemCnt > 2000) {
-        delete _issueItemView->takeTopLevelItem(itemCnt - 1);
-        itemCnt--;
-    }
-
-    // clean up the issue list
-    for( int cnt = itemCnt-1; cnt >=0 ; cnt-- ) {
-        QTreeWidgetItem *item = _issueItemView->topLevelItem(cnt);
-        bool isErrorItem = item->data(0, IgnoredIndicatorRole).toBool();
-        QString itemFolder = item->data(2, Qt::UserRole).toString();
-        if( isErrorItem && itemFolder == folder ) {
-            delete item;
-        }
-    }
+    // The issue list is a state, clear it and let the next sync fill it
+    // with ignored files and propagation errors.
+    _issueItemView->clear();
 }
 
 QString ProtocolWidget::timeString(QDateTime dt, QLocale::FormatType format) const
@@ -261,7 +246,7 @@ void ProtocolWidget::slotProgressInfo( const QString& folder, const ProgressInfo
 {
     if( !progress.hasStarted() ) {
         // The sync is restarting, clean the old items
-        cleanIgnoreItems(folder);
+        cleanItems(folder);
         computeResyncButtonEnabled();
     } else if (progress.completedFiles() >= progress.totalFiles()) {
         //Sync completed
diff --git a/src/gui/protocolwidget.h b/src/gui/protocolwidget.h
index 3559c0a..7f8659c 100644
--- a/src/gui/protocolwidget.h
+++ b/src/gui/protocolwidget.h
@@ -63,7 +63,7 @@ signals:
 
 private:
     void setSyncResultStatus(const SyncResult& result );
-    void cleanIgnoreItems( const QString& folder );
+    void cleanItems( const QString& folder );
     void computeResyncButtonEnabled();
 
     QTreeWidgetItem* createCompletedTreewidgetItem(const QString &folder, const SyncFileItem &item );

-- 
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