Keep only active entries in the Not Synced list #3171
authorJocelyn Turcotte <jturcotte@woboq.com>
Wed, 6 Jan 2016 17:39:32 +0000 (18:39 +0100)
committerJocelyn Turcotte <jturcotte@woboq.com>
Thu, 7 Jan 2016 10:37:50 +0000 (11:37 +0100)
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
src/gui/protocolwidget.h

index 4aa3161f058213767039a4a812834967cb35a2fe..557856023d89dd2c80c4c09006763e018fbe83c5 100644 (file)
@@ -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
index 3559c0ab026029099d6d18eadbdeb8fdc7af8032..7f8659c2761f05a93cb7678115d594586592f52c 100644 (file)
@@ -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 );