mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Merge pull request #2948 from nextcloud/bugfix/conflict-dialog-issue
Fix crash when opening conflict dialog
This commit is contained in:
commit
f17c52dccd
@ -413,6 +413,21 @@ void User::slotAddError(const QString &folderAlias, const QString &message, Erro
|
||||
}
|
||||
}
|
||||
|
||||
bool User::isValueableActivity(const Folder *folder, const SyncFileItemPtr &item) const
|
||||
{
|
||||
// Ignore activity from a different account
|
||||
if (folder->accountState() != _account.data()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We just care about conflict issues that we are able to resolve
|
||||
if (item->_status == SyncFileItem::Conflict && !Utility::isConflictFile(item->_file)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void User::slotItemCompleted(const QString &folder, const SyncFileItemPtr &item)
|
||||
{
|
||||
auto folderInstance = FolderMan::instance()->folder(folder);
|
||||
@ -420,8 +435,7 @@ void User::slotItemCompleted(const QString &folder, const SyncFileItemPtr &item)
|
||||
if (!folderInstance)
|
||||
return;
|
||||
|
||||
// check if we are adding it to the right account and if it is useful information (protocol errors)
|
||||
if (folderInstance->accountState() == _account.data()) {
|
||||
if (isValueableActivity(folderInstance, item)) {
|
||||
qCWarning(lcActivity) << "Item " << item->_file << " retrieved resulted in " << item->_errorString;
|
||||
|
||||
Activity activity;
|
||||
|
||||
@ -80,6 +80,8 @@ private:
|
||||
void connectPushNotifications() const;
|
||||
bool checkPushNotificationsAreReady() const;
|
||||
|
||||
bool isValueableActivity(const Folder *folder, const SyncFileItemPtr &item) const;
|
||||
|
||||
private:
|
||||
AccountStatePtr _account;
|
||||
bool _isCurrentUser;
|
||||
|
||||
@ -742,13 +742,12 @@ bool OwncloudPropagator::createConflict(const SyncFileItemPtr &item,
|
||||
conflictItem->_size = item->_previousSize;
|
||||
emit newItem(conflictItem);
|
||||
composite->appendTask(conflictItem);
|
||||
} else {
|
||||
// Directories we can't process in one go. The next sync run
|
||||
// will take care of uploading the conflict dir contents.
|
||||
_anotherSyncNeeded = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Need a new sync to detect the created copy of the conflicting file
|
||||
_anotherSyncNeeded = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user