QWidget::hideEvent(ev);
}
-void ProtocolWidget::cleanIgnoreItems(const QString& folder)
+void ProtocolWidget::cleanItems(const QString& folder)
{
int itemCnt = _ui->_treeWidget->topLevelItemCount();
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
{
if( !progress.hasStarted() ) {
// The sync is restarting, clean the old items
- cleanIgnoreItems(folder);
+ cleanItems(folder);
computeResyncButtonEnabled();
} else if (progress.completedFiles() >= progress.totalFiles()) {
//Sync completed
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 );