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.
This commit is contained in:
Jocelyn Turcotte 2016-01-06 18:39:32 +01:00
parent fd7afa87b7
commit e9ba7c612e
2 changed files with 6 additions and 21 deletions

View 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

View 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 );