Protocol, Notifications: Show destination() instead of _file

destination() now consistently points to the file after the successful
sync operation. _file might be the place the item was moved from.
This commit is contained in:
Christian Kamm 2019-03-28 09:32:01 +01:00 committed by Kevin Ottens
parent 47f10fbf96
commit 04e0e22513
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2
2 changed files with 6 additions and 6 deletions

View file

@ -366,13 +366,13 @@ void Folder::etagRetrievedFromSyncEngine(const QString &etag)
void Folder::showSyncResultPopup()
{
if (_syncResult.firstItemNew()) {
createGuiLog(_syncResult.firstItemNew()->_file, LogStatusNew, _syncResult.numNewItems());
createGuiLog(_syncResult.firstItemNew()->destination(), LogStatusNew, _syncResult.numNewItems());
}
if (_syncResult.firstItemDeleted()) {
createGuiLog(_syncResult.firstItemDeleted()->_file, LogStatusRemove, _syncResult.numRemovedItems());
createGuiLog(_syncResult.firstItemDeleted()->destination(), LogStatusRemove, _syncResult.numRemovedItems());
}
if (_syncResult.firstItemUpdated()) {
createGuiLog(_syncResult.firstItemUpdated()->_file, LogStatusUpdated, _syncResult.numUpdatedItems());
createGuiLog(_syncResult.firstItemUpdated()->destination(), LogStatusUpdated, _syncResult.numUpdatedItems());
}
if (_syncResult.firstItemRenamed()) {
@ -383,12 +383,12 @@ void Folder::showSyncResultPopup()
if (renTarget != renSource) {
status = LogStatusMove;
}
createGuiLog(_syncResult.firstItemRenamed()->_originalFile, status,
createGuiLog(_syncResult.firstItemRenamed()->_file, status,
_syncResult.numRenamedItems(), _syncResult.firstItemRenamed()->_renameTarget);
}
if (_syncResult.firstNewConflictItem()) {
createGuiLog(_syncResult.firstNewConflictItem()->_file, LogStatusConflict, _syncResult.numNewConflictItems());
createGuiLog(_syncResult.firstNewConflictItem()->destination(), LogStatusConflict, _syncResult.numNewConflictItems());
}
if (int errorCount = _syncResult.numErrorItems()) {
createGuiLog(_syncResult.firstItemError()->_file, LogStatusError, errorCount);

View file

@ -175,7 +175,7 @@ void SyncRunFileLog::logItem(const SyncFileItem &item)
_out << ts << L;
_out << L;
if (item._instruction != CSYNC_INSTRUCTION_RENAME) {
_out << item._file << L;
_out << item.destination() << L;
} else {
_out << item._file << QLatin1String(" -> ") << item._renameTarget << L;
}