From e9ba7c612e4f93a37ac299cc3770756b89e982fe Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 6 Jan 2016 18:39:32 +0100 Subject: [PATCH] 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 4aa3161f0..557856023 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 3559c0ab0..7f8659c27 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 ); -- 2.30.2