diff options
author | Christian Kamm <mail@ckamm.de> | 2018-02-21 15:55:33 +0300 |
---|---|---|
committer | ckamm <mail@ckamm.de> | 2018-03-06 15:02:54 +0300 |
commit | 797473ba1fed83a915b8b56f61ace9185aff8a18 (patch) | |
tree | 7642b850426137f031c93e5fbdc0c82b01af513c /src/gui/issueswidget.cpp | |
parent | f82d61ea19b39b846ae1a451015fb72515ed8a52 (diff) |
SyncResult: Make sure the number of conflicts is correct #6226
If the SyncResult incorrectly believes that there are no conflicts, the
tray icon won't be correct and there will be no warning about unresolved
conflicts on the account.
Nevertheless, it's pretty awkward that the IssuesWidget is better
informed about pending conflicts than the Folder itself. This kind of
backwards data flow is very confusing.
Unfortunately the only alternative I see is to either keep track of
this information in two places (also in Folder), or create a common
data-holding class that can serve as a model instance for the issues
view as well as provide data directly to the Folder - which would
have been a much larger change.
Diffstat (limited to 'src/gui/issueswidget.cpp')
-rw-r--r-- | src/gui/issueswidget.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/issueswidget.cpp b/src/gui/issueswidget.cpp index 15de3f107..9896373ee 100644 --- a/src/gui/issueswidget.cpp +++ b/src/gui/issueswidget.cpp @@ -241,6 +241,20 @@ void IssuesWidget::slotProgressInfo(const QString &folder, const ProgressInfo &p return engine.shouldDiscoverLocally(path); }); } + if (progress.status() == ProgressInfo::Done) { + // We keep track very well of pending conflicts. + // Inform other components about them. + QStringList conflicts; + auto tree = _ui->_treeWidget; + for (int i = 0; i < tree->topLevelItemCount(); ++i) { + auto item = tree->topLevelItem(i); + if (ProtocolItem::folderName(item) == folder + && ProtocolItem::status(item) == SyncFileItem::Conflict) { + conflicts.append(ProtocolItem::filePath(item)); + } + } + emit ProgressDispatcher::instance()->folderConflicts(folder, conflicts); + } } void IssuesWidget::slotItemCompleted(const QString &folder, const SyncFileItemPtr &item) |