[plasma/xdg-desktop-portal-kde] src: Rename some ids so they dont shadow properties
David Redondo <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 8f18a08af3fd41262c0b47d17fff1a2177ecceb1 by David Redondo.
Committed on 29/07/2026 at 10:14.
Pushed by davidre into branch 'master'.
Rename some ids so they dont shadow properties
M +7 -7 src/AccessDialog.qml
M +7 -7 src/PipeWireLayout.qml
M +4 -4 src/region-select/RegionSelectOverlay.qml
https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/8f18a08af3fd41262c0b47d17fff1a2177ecceb1
diff --git a/src/AccessDialog.qml b/src/AccessDialog.qml
index ea1cf6b5..06c6bceb 100644
--- a/src/AccessDialog.qml
+++ b/src/AccessDialog.qml
@@ -36,28 +36,28 @@ PortalDialog {
Repeater {
model: root.choices
delegate: Loader {
- id: delegate
+ id: loader
required property var modelData
Kirigami.FormData.label: modelData.label
sourceComponent: modelData.choices.length == 0 ? checkBox : comboBox
Component {
id: checkBox
QQC2.CheckBox {
- Kirigami.FormData.label: delegate.modelData.label
- checked: delegate.modelData.initialChoiceId === "true"
+ Kirigami.FormData.label: loader.modelData.label
+ checked: loader.modelData.initialChoiceId === "true"
onToggled: {
- root.selectedChoices[delegate.modelData.id] = checked ? "true" : "false"
+ root.selectedChoices[loader.modelData.id] = checked ? "true" : "false"
}
}
}
Component {
id: comboBox
QQC2.ComboBox {
- model: delegate.modelData.choices
+ model: loader.modelData.choices
textRole: "value"
valueRole: "id"
- onActivated: root.selectedChoices[delegate.modelData.id] = currentValue
- Component.onCompleted: currentIndex = indexOfValue(delegate.modelData.initialChoiceId)
+ onActivated: root.selectedChoices[loader.modelData.id] = currentValue
+ Component.onCompleted: currentIndex = indexOfValue(loader.modelData.initialChoiceId)
}
}
Component.onCompleted: root.selectedChoices[modelData.id] = modelData.initialChoiceId
diff --git a/src/PipeWireLayout.qml b/src/PipeWireLayout.qml
index 76892e0c..908b03b6 100644
--- a/src/PipeWireLayout.qml
+++ b/src/PipeWireLayout.qml
@@ -15,13 +15,13 @@ Kirigami.CardsLayout {
required property ScreenChooserDialogTemplate dialog
required property var model
- readonly property alias view: view
+ readonly property alias view: repeater
uniformCellWidths: true
visible: view.count > 0
Repeater {
- id: view
+ id: repeater
model: root.model
@@ -33,7 +33,7 @@ Kirigami.CardsLayout {
function selectAndAccept(): void {
root.dialog.clearSelection()
- view.model.setData(view.model.index(model.row, 0), Qt.Checked, Qt.CheckStateRole)
+ repeater.model.setData(repeater.model.index(model.row, 0), Qt.Checked, Qt.CheckStateRole)
root.dialog.dialogButtonBox.accepted()
}
@@ -47,13 +47,13 @@ Kirigami.CardsLayout {
checked: model.checked === Qt.Checked
nodeId: waylandItem.nodeId
syntheticCount: {
- let model = view.model.sourceModel
+ let model = repeater.model.sourceModel
if (model instanceof OutputsModel) {
return (model as OutputsModel).syntheticCount
}
return 0
}
- isOutput: view.model.sourceModel instanceof OutputsModel
+ isOutput: repeater.model.sourceModel instanceof OutputsModel
geometry: model.geometry ?? Qt.rect(0, 0, 0, 0)
backgroundImage: model.imageUrl ?? ""
@@ -71,7 +71,7 @@ Kirigami.CardsLayout {
// Only active if this is a multi-select dialog
onToggled: {
const to = model.checked !== Qt.Checked ? Qt.Checked : Qt.Unchecked;
- view.model.setData(view.model.index(model.row, 0), to, Qt.CheckStateRole)
+ repeater.model.setData(repeater.model.index(model.row, 0), to, Qt.CheckStateRole)
}
// If this is isn't a multi-select dialog, accept on click
@@ -97,7 +97,7 @@ Kirigami.CardsLayout {
return defaultSpan
}
- let model = view.model.sourceModel as OutputsModel
+ let model = repeater.model.sourceModel as OutputsModel
if (!model) { // not an output
return defaultSpan
}
diff --git a/src/region-select/RegionSelectOverlay.qml b/src/region-select/RegionSelectOverlay.qml
index 2cfca1b0..d349a23b 100644
--- a/src/region-select/RegionSelectOverlay.qml
+++ b/src/region-select/RegionSelectOverlay.qml
@@ -85,7 +85,7 @@ MouseArea {
Rectangle {
id: selectionRectangle
color: "transparent"
- border.color: palette.highlight
+ border.color: systemPalette.highlight
border.width: 1
visible: root.selectionEditor.rect.height > 0 && root.selectionEditor.rect.width > 0
x: root.selectionEditor.rect.x - border.width - Screen.virtualX
@@ -96,7 +96,7 @@ MouseArea {
LayoutMirroring.childrenInherit: true
SystemPalette {
- id: palette
+ id: systemPalette
colorGroup: Kirigami.Theme.Active
}
}
@@ -106,7 +106,7 @@ MouseArea {
visible: false
}
FontMetrics {
- id: fontMetrics
+ id: metrics
font: metricsLabel.font
}
@@ -119,7 +119,7 @@ MouseArea {
verticalCenter: selectionRectangle.verticalCenter
}
- fontMetrics: fontMetrics
+ fontMetrics: metrics
visible: selectionRectangle.visible && dragSizeBox.height < selectionRectangle.height && dragSizeBox.width < selectionRectangle.width
opacity: 1
contentItem: QQC2.Label {