[plasma/xdg-desktop-portal-kde] src: Unqualified accesses --
David Redondo <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 9a538685fd65df2c9734e06d5dfb5ce9277e7a54 by David Redondo.
Committed on 29/07/2026 at 10:06.
Pushed by davidre into branch 'master'.
Unqualified accesses --
M +11 -6 src/AccessDialog.qml
M +5 -5 src/AppChooserDialog.qml
M +13 -11 src/DynamicLauncherDialog.qml
M +9 -9 src/GlobalShortcutsDialog.qml
M +3 -1 src/PortalDialog.qml
https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/9a538685fd65df2c9734e06d5dfb5ce9277e7a54
diff --git a/src/AccessDialog.qml b/src/AccessDialog.qml
index 62b716d4..ea1cf6b5 100644
--- a/src/AccessDialog.qml
+++ b/src/AccessDialog.qml
@@ -6,6 +6,9 @@ import QtQuick
import QtQuick.Controls as QQC2
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
+import org.kde.xdgdesktopportal
+
+pragma ComponentBehavior: Bound
PortalDialog {
id: root
@@ -33,26 +36,28 @@ PortalDialog {
Repeater {
model: root.choices
delegate: Loader {
+ id: delegate
+ required property var modelData
Kirigami.FormData.label: modelData.label
sourceComponent: modelData.choices.length == 0 ? checkBox : comboBox
Component {
id: checkBox
QQC2.CheckBox {
- Kirigami.FormData.label: modelData.label
- checked: modelData.initialChoiceId === "true"
+ Kirigami.FormData.label: delegate.modelData.label
+ checked: delegate.modelData.initialChoiceId === "true"
onToggled: {
- root.selectedChoices[modelData.id] = checked ? "true" : "false"
+ root.selectedChoices[delegate.modelData.id] = checked ? "true" : "false"
}
}
}
Component {
id: comboBox
QQC2.ComboBox {
- model: modelData.choices
+ model: delegate.modelData.choices
textRole: "value"
valueRole: "id"
- onActivated: root.selectedChoices[modelData.id] = currentValue
- Component.onCompleted: currentIndex = indexOfValue(modelData.initialChoiceId)
+ onActivated: root.selectedChoices[delegate.modelData.id] = currentValue
+ Component.onCompleted: currentIndex = indexOfValue(delegate.modelData.initialChoiceId)
}
}
Component.onCompleted: root.selectedChoices[modelData.id] = modelData.initialChoiceId
diff --git a/src/AppChooserDialog.qml b/src/AppChooserDialog.qml
index e2098537..9d369e4e 100644
--- a/src/AppChooserDialog.qml
+++ b/src/AppChooserDialog.qml
@@ -62,7 +62,7 @@ PortalDialog {
property string text: editText
function acceptResult() {
- if (showingTerminalCommand) {
+ if (root.showingTerminalCommand) {
root.appChooserData.applicationSelected(searchField.text, root.remember)
} else {
grid.currentItemDelegate.click()
@@ -192,9 +192,9 @@ PortalDialog {
text: switch (delegate.model.applicationDesktopFile) {
case root.appChooserData.defaultApp:
- return xi18nc("@info", "%1<nl/><emphasis>Default app for this file type</emphasis>", delegate.model.applicationName);
+ return KI18n.xi18nc("@info", "%1<nl/><emphasis>Default app for this file type</emphasis>", delegate.model.applicationName);
case root.appChooserData.lastUsedApp:
- return xi18nc("@info", "%1<nl/><emphasis>Last used app for this file type</emphasis>", delegate.model.applicationName);
+ return KI18n.xi18nc("@info", "%1<nl/><emphasis>Last used app for this file type</emphasis>", delegate.model.applicationName);
default:
return delegate.model.applicationName;
}
@@ -216,11 +216,11 @@ PortalDialog {
icon.name: root.showingTerminalCommand ? "system-run": "edit-none"
text: {
if (root.showingTerminalCommand) {
- return xi18nc("@info", "Open with <command>%1</command>?", searchField.editText)
+ return KI18n.xi18nc("@info", "Open with <command>%1</command>?", searchField.editText)
} else if (searchField.editText.length > 0) {
return KI18n.i18n("No matches")
} else {
- return xi18nc("@info", "No installed applications can open <filename>%1</filename>", root.appChooserData.fileName)
+ return KI18n.xi18nc("@info", "No installed applications can open <filename>%1</filename>", root.appChooserData.fileName)
}
}
diff --git a/src/DynamicLauncherDialog.qml b/src/DynamicLauncherDialog.qml
index 92683693..068639ee 100644
--- a/src/DynamicLauncherDialog.qml
+++ b/src/DynamicLauncherDialog.qml
@@ -8,6 +8,8 @@ import org.kde.kirigami as Kirigami
import org.kde.iconthemes as KIconThemes
import org.kde.ki18n
+pragma ComponentBehavior: Bound
+
PortalDialog {
id: root
@@ -23,7 +25,7 @@ PortalDialog {
Layout.alignment: Qt.AlignHCenter
implicitWidth: Kirigami.Units.iconSizes.enormous
implicitHeight: implicitWidth
- source: dialog.icon
+ source: root.dialog.icon
}
Kirigami.Heading {
@@ -31,7 +33,7 @@ PortalDialog {
Layout.fillWidth: true
level: 3
wrapMode: Text.Wrap
- text: dialog.name
+ text: root.dialog.name
verticalAlignment: Qt.AlignTop
}
@@ -40,8 +42,8 @@ PortalDialog {
visible: text.length > 0
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideMiddle
- text: launcherURL
- onClicked: Qt.openUrlExternally(launcherURL)
+ text: root.dialog.launcherURL
+ onClicked: Qt.openUrlExternally(root.dialog.launcherURL)
}
}
}
@@ -54,11 +56,11 @@ PortalDialog {
id: icon
implicitHeight: implicitWidth
implicitWidth: Kirigami.Units.iconSizes.enormous
- source: dialog.icon
+ source: root.dialog.icon
KIconThemes.IconDialog {
id: iconDialog
- onIconNameChanged: dialog.icon = iconName
+ onIconNameChanged: root.dialog.icon = iconName
}
TapHandler {
@@ -74,8 +76,8 @@ PortalDialog {
QQC2.TextField {
verticalAlignment: Qt.AlignTop
Layout.fillWidth: true
- onTextChanged: dialog.name = text
- Component.onCompleted: text = dialog.name
+ onTextChanged: root.dialog.name = text
+ Component.onCompleted: text = root.dialog.name
}
}
}
@@ -87,7 +89,7 @@ PortalDialog {
standardButtons: QQC2.DialogButtonBox.NoButton
Loader {
- sourceComponent: root.edit ? editComponent : displayComponent
+ sourceComponent: root.edit ? root.editComponent : root.displayComponent
}
width: contentWidth
@@ -103,12 +105,12 @@ PortalDialog {
Kirigami.Action {
text: KI18n.i18nc("@action accept dialog and create launcher", "Create")
icon.name: "dialog-ok"
- onTriggered: accept()
+ onTriggered: root.accept()
},
Kirigami.Action {
text: KI18n.i18nc("@action", "Cancel")
icon.name: "dialog-cancel"
- onTriggered: reject()
+ onTriggered: root.reject()
}
]
}
diff --git a/src/GlobalShortcutsDialog.qml b/src/GlobalShortcutsDialog.qml
index fa6c121c..3ae6b31b 100644
--- a/src/GlobalShortcutsDialog.qml
+++ b/src/GlobalShortcutsDialog.qml
@@ -47,7 +47,7 @@ PortalDialog {
Layout.fillWidth: true
Layout.fillHeight: true
implicitHeight: contentHeight
- model: newShortcuts
+ model: root.newShortcuts
delegate: QQC2.ItemDelegate {
id: delegate
required property var model
@@ -58,14 +58,14 @@ PortalDialog {
spacing: Kirigami.Units.smallSpacing
Kirigami.TitleSubtitle {
Layout.fillWidth: true
- title: model.display
+ title: delegate.model.display
font: delegate.font
}
Kirigami.Icon {
id: conflictIcon
- visible: model.globalConflict || model.standardConflict || model.internalConflict
+ visible: delegate.model.globalConflict || delegate.model.standardConflict || delegate.model.internalConflict
source: "data-warning"
- QQC2.ToolTip.text: model.conflictText ?? ""
+ QQC2.ToolTip.text: delegate.model.conflictText ?? ""
QQC2.ToolTip.visible: hoverHandler.hovered
HoverHandler {
id: hoverHandler
@@ -75,9 +75,9 @@ PortalDialog {
id: keySequenceItem
Layout.alignment: Qt.AlignRight
showCancelButton: true
- keySequence: model.keySequence
+ keySequence: delegate.model.keySequence
onKeySequenceModified: {
- model.keySequence = keySequence
+ delegate.model.keySequence = keySequence
}
}
}
@@ -86,17 +86,17 @@ PortalDialog {
QQC2.Button {
parent: root.dialogButtonBox
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.HelpRole
- visible: returningShortcuts.length != 0
+ visible: root.returningShortcuts.length != 0
icon.name: "systemsettings"
text: KI18n.i18nc("@action:button", "See Other Shortcuts…")
QQC2.ToolTip.text: KI18n.i18nc("@info:tooltip", "View other shortcuts registered by this application")
QQC2.ToolTip.visible: hovered
- onClicked: KCMUtils.KCMLauncher.openSystemSettings("kcm_keys", component)
+ onClicked: KCMUtils.KCMLauncher.openSystemSettings("kcm_keys", root.component)
}
Binding {
delayed: true
target: root.dialogButtonBox.standardButton(QQC2.DialogButtonBox.Ok)
- value: !(newShortcuts.hasGlobalConflict || newShortcuts.hasInternalConflict)
+ value: !(root.newShortcuts.hasGlobalConflict || root.newShortcuts.hasInternalConflict)
property: "enabled"
}
}
diff --git a/src/PortalDialog.qml b/src/PortalDialog.qml
index a05a8932..8e192e2b 100644
--- a/src/PortalDialog.qml
+++ b/src/PortalDialog.qml
@@ -13,6 +13,8 @@ import QtQuick.Templates as T
import org.kde.kirigami as Kirigami
import Qt5Compat.GraphicalEffects
+pragma ComponentBehavior: Bound
+
Kirigami.AbstractApplicationWindow {
id: root
@@ -298,7 +300,7 @@ Kirigami.AbstractApplicationWindow {
id: contentComponent
QQC2.Control {
- topPadding: contentPadding ? root.edgeSpacing : undefined
+ topPadding: root.contentPadding ? root.edgeSpacing : undefined
bottomPadding: topPadding
leftPadding: topPadding
rightPadding: topPadding