Skip to content

Commit

Permalink
Merge pull request #6045 from nextcloud/backport/6043/stable-3.10
Browse files Browse the repository at this point in the history
[stable-3.10] Display correct conflict part in multiple conflicts resolution dialog.
  • Loading branch information
mgallien authored Sep 12, 2023
2 parents f87fd91 + 13fccdf commit 95180b6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions src/gui/ConflictDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,29 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true

itemSelected: root.existingSelected
itemPreviewUrl: root.existingPreviewUrl
itemSelected: root.conflictSelected
itemPreviewUrl: root.conflictPreviewUrl
itemVersionLabel: qsTr('Local version')
itemDateLabel: root.existingDate
itemFileSizeLabel: root.existingSize
itemDateLabel: root.conflictDate
itemFileSizeLabel: root.conflictSize

onSelectedChanged: function() {
model.existingSelected = itemSelected
model.conflictSelected = itemSelected
}
}

ConflictItemFileInfo {
Layout.fillWidth: true
Layout.fillHeight: true

itemSelected: root.conflictSelected
itemPreviewUrl: root.conflictPreviewUrl
itemSelected: root.existingSelected
itemPreviewUrl: root.existingPreviewUrl
itemVersionLabel: qsTr('Server version')
itemDateLabel: root.conflictDate
itemFileSizeLabel: root.conflictSize
itemDateLabel: root.existingDate
itemFileSizeLabel: root.existingSize

onSelectedChanged: function() {
model.conflictSelected = itemSelected
model.existingSelected = itemSelected
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/gui/ResolveConflictsDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ ApplicationWindow {

font.pixelSize: Style.fontPixelSizeResolveConflictsDialog

checked: realModel.allExistingsSelected
checked: realModel.allConflictingSelected
onToggled: function() {
realModel.selectAllExisting(checked)
realModel.selectAllConflicting(checked)
}
}

Expand All @@ -119,9 +119,9 @@ ApplicationWindow {

font.pixelSize: Style.fontPixelSizeResolveConflictsDialog

checked: realModel.allConflictingSelected
checked: realModel.allExistingsSelected
onToggled: function() {
realModel.selectAllConflicting(checked)
realModel.selectAllExisting(checked)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/syncconflictsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ ConflictSolver::Solution SyncConflictsModel::ConflictInfo::solution() const
if (mConflictSelected == ConflictSolution::SolutionSelected && mExistingSelected == ConflictSolution::SolutionSelected) {
result = ConflictSolver::KeepBothVersions;
} else if (mConflictSelected == ConflictSolution::SolutionDeselected && mExistingSelected == ConflictSolution::SolutionSelected) {
result = ConflictSolver::KeepLocalVersion;
} else if (mConflictSelected == ConflictSolution::SolutionSelected && mExistingSelected == ConflictSolution::SolutionDeselected) {
result = ConflictSolver::KeepRemoteVersion;
} else if (mConflictSelected == ConflictSolution::SolutionSelected && mExistingSelected == ConflictSolution::SolutionDeselected) {
result = ConflictSolver::KeepLocalVersion;
}

return result;
Expand Down

0 comments on commit 95180b6

Please sign in to comment.