Fix qml warnings in SpaceHomePage

This commit is contained in:
Tobias Fella
2025-09-01 13:22:05 +02:00
parent 5f6c248181
commit 5a71dfcd7a

View File

@@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com> // SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
pragma ComponentBehavior: Bound
import QtQuick import QtQuick
import QtQuick.Controls as QQC2 import QtQuick.Controls as QQC2
import QtQuick.Layouts import QtQuick.Layouts
@@ -8,7 +10,7 @@ import QtQuick.Layouts
import org.kde.kirigami as Kirigami import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.components as KirigamiComponents import org.kde.kirigamiaddons.components as KirigamiComponents
import org.kde.neochat.libneochat import org.kde.neochat
import org.kde.neochat.settings as Settings import org.kde.neochat.settings as Settings
ColumnLayout { ColumnLayout {
@@ -90,16 +92,15 @@ ColumnLayout {
text: i18nc("@button", "Add to Space") text: i18nc("@button", "Add to Space")
icon.name: "list-add" icon.name: "list-add"
onClicked: { onClicked: {
const menu = roomMenuComponent.createObject(addNewButton); (roomMenuComponent.createObject(addNewButton) as KirigamiComponents.ConvergentContextMenu).popup();
menu.popup();
} }
} }
QQC2.Button { QQC2.Button {
text: i18nc("@action:button", "Leave this space…") text: i18nc("@action:button", "Leave this space…")
icon.name: "go-previous" icon.name: "go-previous"
onClicked: Qt.createComponent('org.kde.neochat', 'ConfirmLeaveDialog').createObject(root.QQC2.ApplicationWindow.window, { onClicked: (Qt.createComponent('org.kde.neochat', 'ConfirmLeaveDialog').createObject(root.QQC2.ApplicationWindow.window, {
room: root.room room: root.room
}).open(); }) as ConfirmLeaveDialog).open();
} }
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
@@ -197,7 +198,7 @@ ColumnLayout {
const dialog = Qt.createComponent('org.kde.neochat.libneochat', 'CreateRoomDialog').createObject(root, { const dialog = Qt.createComponent('org.kde.neochat.libneochat', 'CreateRoomDialog').createObject(root, {
connection: root.room.connection, connection: root.room.connection,
parentId: parentId parentId: parentId
}); }) as CreateRoomDialog;
dialog.newChild.connect(childName => { dialog.newChild.connect(childName => {
spaceChildrenModel.addPendingChild(childName); spaceChildrenModel.addPendingChild(childName);
}); });
@@ -208,7 +209,7 @@ ColumnLayout {
const dialog = Qt.createComponent('org.kde.neochat.libneochat', 'CreateSpaceDialog').createObject(root, { const dialog = Qt.createComponent('org.kde.neochat.libneochat', 'CreateSpaceDialog').createObject(root, {
connection: root.room.connection, connection: root.room.connection,
parentId: parentId, parentId: parentId,
}); }) as CreateSpaceDialog;
dialog.newChild.connect(childName => { dialog.newChild.connect(childName => {
spaceChildrenModel.addPendingChild(childName); spaceChildrenModel.addPendingChild(childName);
}); });
@@ -219,7 +220,7 @@ ColumnLayout {
const dialog = Qt.createComponent('org.kde.neochat.spaces', 'SelectExistingRoomDialog').createObject(root, { const dialog = Qt.createComponent('org.kde.neochat.spaces', 'SelectExistingRoomDialog').createObject(root, {
connection: root.room.connection, connection: root.room.connection,
parentId: parentId, parentId: parentId,
}); }) as SelectExistingRoomDialog;
dialog.addChild.connect((childId, setChildParent, canonical) => { dialog.addChild.connect((childId, setChildParent, canonical) => {
// We have to get a room object from the connection as we may not // We have to get a room object from the connection as we may not
// be adding to the top level parent. // be adding to the top level parent.