Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-3_4] Avoid needless save when adding a child to a parent that is already part of its dataset #5729

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ EditorWidgetBase {
repeat: false

onTriggered: {
let saved = save();
let saved = form.state === 'Add' ? save() : true;
if (ProjectUtils.transactionMode(qgisProject) !== Qgis.TransactionMode.Disabled) {
// When a transaction mode is enabled, we must fallback to saving the parent feature to have provider-side issues
if (!saved) {
Expand Down Expand Up @@ -375,6 +375,14 @@ EditorWidgetBase {
}
}

BusyIndicator {
id: busyIndicator
anchors.centerIn: parent
width: 36
height: 36
running: orderedRelationModel.isLoading
}

Dialog {
id: deleteDialog
parent: mainWindow.contentItem
Expand Down Expand Up @@ -414,14 +422,6 @@ EditorWidgetBase {
}
}

BusyIndicator {
id: busyIndicator
anchors.centerIn: parent
width: 36
height: 36
running: orderedRelationModel.isLoading
}

EmbeddedFeatureForm {
id: embeddedPopup

Expand Down
18 changes: 9 additions & 9 deletions src/qml/editorwidgets/relationeditors/relation_editor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ EditorWidgetBase {
repeat: false

onTriggered: {
let saved = save();
let saved = form.state === 'Add' ? save() : true;
if (ProjectUtils.transactionMode(qgisProject) !== Qgis.TransactionMode.Disabled) {
// When a transaction mode is enabled, we must fallback to saving the parent feature to have provider-side issues
if (!saved) {
Expand Down Expand Up @@ -175,6 +175,14 @@ EditorWidgetBase {
}
}
}

BusyIndicator {
id: busyIndicator
anchors.centerIn: parent
width: 36
height: 36
running: relationEditorModel.isLoading
}
}

Component {
Expand Down Expand Up @@ -320,14 +328,6 @@ EditorWidgetBase {
}
}

BusyIndicator {
id: busyIndicator
anchors.centerIn: parent
width: 36
height: 36
running: relationEditorModel.isLoading
}

EmbeddedFeatureForm {
id: embeddedPopup

Expand Down
Loading